Struct konst::string::SplitTerminator
source · pub struct SplitTerminator<'a, 'p, P: Pattern<'p>> { /* private fields */ }
Expand description
Const equivalent of core::str::SplitTerminator<'a, P>
This is constructed with split_terminator
like this:
konst::string::split_terminator(string, delim)
Implementations§
source§impl<'a, 'p, P: Pattern<'p>> SplitTerminator<'a, 'p, P>
impl<'a, 'p, P: Pattern<'p>> SplitTerminator<'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::split_terminator("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<'a, 'p, P: Pattern<'p>> ConstIntoIter for SplitTerminator<'a, 'p, P>
impl<'a, 'p, P: Pattern<'p>> ConstIntoIter for SplitTerminator<'a, 'p, P>
§type Kind = IsIteratorKind
type Kind = IsIteratorKind
What kind of type this is: Read more
§type IntoIter = SplitTerminator<'a, 'p, P>
type IntoIter = SplitTerminator<'a, 'p, P>
The iterator that this can be converted into.
Auto Trait Implementations§
impl<'a, 'p, P> Freeze for SplitTerminator<'a, 'p, P>
impl<'a, 'p, P> RefUnwindSafe for SplitTerminator<'a, 'p, P>
impl<'a, 'p, P> Send for SplitTerminator<'a, 'p, P>
impl<'a, 'p, P> Sync for SplitTerminator<'a, 'p, P>
impl<'a, 'p, P> Unpin for SplitTerminator<'a, 'p, P>
impl<'a, 'p, P> UnwindSafe for SplitTerminator<'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