pub struct RSplit<'a, 'b> { /* private fields */ }
Expand description
Implementations§
Source§impl<'a, 'b> RSplit<'a, 'b>
impl<'a, 'b> RSplit<'a, 'b>
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 next_back(self) -> Option<(&'a str, Self)>
pub const fn next_back(self) -> Option<(&'a str, Self)>
Removes and returns an element from the end of the iterator.
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("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 IntoIterKind for RSplit<'_, '_>
impl IntoIterKind for RSplit<'_, '_>
type Kind = IsIteratorKind
Auto Trait Implementations§
impl<'a, 'b> Freeze for RSplit<'a, 'b>
impl<'a, 'b> RefUnwindSafe for RSplit<'a, 'b>
impl<'a, 'b> Send for RSplit<'a, 'b>
impl<'a, 'b> Sync for RSplit<'a, 'b>
impl<'a, 'b> Unpin for RSplit<'a, 'b>
impl<'a, 'b> UnwindSafe for RSplit<'a, 'b>
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes