pub struct Split<'a, 'b> { /* private fields */ }
Expand description
Implementations§
Source§impl<'a, 'b> Split<'a, 'b>
impl<'a, 'b> Split<'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::split("foo-bar-baz", "-");
assert_eq!(iter.remainder(), "foo-bar-baz");
let (elem, iter) = iter.next().unwrap();
assert_eq!(elem, "foo");
assert_eq!(iter.remainder(), "bar-baz");
let (elem, iter) = iter.next().unwrap();
assert_eq!(elem, "bar");
assert_eq!(iter.remainder(), "baz");
let (elem, iter) = iter.next().unwrap();
assert_eq!(elem, "baz");
assert_eq!(iter.remainder(), "");
Trait Implementations§
Source§impl IntoIterKind for Split<'_, '_>
impl IntoIterKind for Split<'_, '_>
type Kind = IsIteratorKind
Auto Trait Implementations§
impl<'a, 'b> Freeze for Split<'a, 'b>
impl<'a, 'b> RefUnwindSafe for Split<'a, 'b>
impl<'a, 'b> Send for Split<'a, 'b>
impl<'a, 'b> Sync for Split<'a, 'b>
impl<'a, 'b> Unpin for Split<'a, 'b>
impl<'a, 'b> UnwindSafe for Split<'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