Struct konst::string::RSplitTerminator
source · pub struct RSplitTerminator<'a, 'p, P: Pattern<'p>> { /* private fields */ }
Expand description
Const equivalent of core::str::RSplitTerminator<'a, P>
This is constructed with rsplit_terminator
like this:
konst::string::rsplit_terminator(string, delim)
Implementations§
source§impl<'a, 'p, P: Pattern<'p>> RSplitTerminator<'a, 'p, P>
impl<'a, 'p, P: Pattern<'p>> RSplitTerminator<'a, 'p, P>
sourcepub const fn next(self) -> Option<(&'a str, Self)>
pub const fn next(self) -> Option<(&'a str, Self)>
Advances the iterator and returns the next value.
sourcepub const fn remainder(&self) -> &'a str
pub const fn remainder(&self) -> &'a str
Gets the remainder of the string.
§Example
let iter = konst::string::rsplit_terminator("=foo=bar=baz", "=");
assert_eq!(iter.remainder(), "=foo=bar=baz");
let (elem, iter) = iter.next().unwrap();
assert_eq!(elem, "baz");
assert_eq!(iter.remainder(), "=foo=bar");
let (elem, iter) = iter.next().unwrap();
assert_eq!(elem, "bar");
assert_eq!(iter.remainder(), "=foo");
let (elem, iter) = iter.next().unwrap();
assert_eq!(elem, "foo");
assert_eq!(iter.remainder(), "");
Trait Implementations§
source§impl<'a, 'p, P: Pattern<'p>> ConstIntoIter for RSplitTerminator<'a, 'p, P>
impl<'a, 'p, P: Pattern<'p>> ConstIntoIter for RSplitTerminator<'a, 'p, P>
§type Kind = IsIteratorKind
type Kind = IsIteratorKind
What kind of type this is: Read more
§type IntoIter = RSplitTerminator<'a, 'p, P>
type IntoIter = RSplitTerminator<'a, 'p, P>
The iterator that this can be converted into.
Auto Trait Implementations§
impl<'a, 'p, P> Freeze for RSplitTerminator<'a, 'p, P>
impl<'a, 'p, P> RefUnwindSafe for RSplitTerminator<'a, 'p, P>
impl<'a, 'p, P> Send for RSplitTerminator<'a, 'p, P>
impl<'a, 'p, P> Sync for RSplitTerminator<'a, 'p, P>
impl<'a, 'p, P> Unpin for RSplitTerminator<'a, 'p, P>
impl<'a, 'p, P> UnwindSafe for RSplitTerminator<'a, 'p, P>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more