pub struct SplitTerminator<'a, 'p, P: Pattern<'p>> { /* private fields */ }Available on crate feature
iter only.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(&mut self) -> Option<&'a str>
pub const fn next(&mut self) -> Option<&'a str>
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 mut iter = konst::string::split_terminator("foo,bar,baz,", ",");
assert_eq!(iter.remainder(), "foo,bar,baz,");
assert_eq!(iter.next().unwrap(), "foo");
assert_eq!(iter.remainder(), "bar,baz,");
assert_eq!(iter.next().unwrap(), "bar");
assert_eq!(iter.remainder(), "baz,");
assert_eq!(iter.next().unwrap(), "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>
Source§const ITEMS_NEED_DROP: bool = false
const ITEMS_NEED_DROP: bool = false
Available on crate feature
iter only.Whether the iterator items need to be dropped. Read more
Source§type Kind = IsIteratorKind
type Kind = IsIteratorKind
Available on crate feature
iter only.What kind of type this is: Read more
Source§type IntoIter = SplitTerminator<'a, 'p, P>
type IntoIter = SplitTerminator<'a, 'p, P>
Available on crate feature
iter only.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