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>
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