pub struct DelimiterSlice<St, D> { /* private fields */ }Implementations§
Source§impl<St, D> DelimiterSlice<St, D>
impl<St, D> DelimiterSlice<St, D>
Sourcepub fn new(stream: St, delimiter: D) -> Self
pub fn new(stream: St, delimiter: D) -> Self
Create a new DelimiterSlice based on the provided stream and delimiter.
This defaults instantiating the underlying buffer with a capacity of 8,192 bytes.
pub fn with_capacity(stream: St, delimiter: D, capacity: usize) -> Self
pub fn with_limit(stream: St, delimiter: D, limit: usize) -> Self
pub fn with_capacity_and_limit( stream: St, delimiter: D, capacity: usize, limit: usize, ) -> Self
Sourcepub fn into_inner(self) -> St
pub fn into_inner(self) -> St
Return the wrapped stream.
This is useful once the delimiter has been returned and the internal buffer has been cleared
by calling next() again.
§Panics
Panics if the internal buffer is not empty when this is called. The stated purpose of this library is to provide a simple and safe way to extract data from a delimited stream, but allow the stream to continue producing the data in the order it was received.
If you’ve called into_inner before a second call to next this is likely an error.
Trait Implementations§
Source§impl<St, D> Stream for DelimiterSlice<St, D>
impl<St, D> Stream for DelimiterSlice<St, D>
impl<'__pin, St, D> Unpin for DelimiterSlice<St, D>where
PinnedFieldsOf<__Origin<'__pin, St, D>>: Unpin,
Auto Trait Implementations§
impl<St, D> Freeze for DelimiterSlice<St, D>
impl<St, D> RefUnwindSafe for DelimiterSlice<St, D>where
St: RefUnwindSafe,
D: RefUnwindSafe,
impl<St, D> Send for DelimiterSlice<St, D>
impl<St, D> Sync for DelimiterSlice<St, D>
impl<St, D> UnwindSafe for DelimiterSlice<St, D>where
St: UnwindSafe,
D: UnwindSafe,
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