Trait winnow::stream::StreamIsPartial
source · pub trait StreamIsPartial: Sized {
type PartialState;
// Required methods
fn complete(&mut self) -> Self::PartialState;
fn restore_partial(&mut self, state: Self::PartialState);
fn is_partial_supported() -> bool;
// Provided method
fn is_partial(&self) -> bool { ... }
}
Expand description
Marks the input as being the complete buffer or a partial buffer for streaming input
See Partial
for marking a presumed complete buffer type as a streaming buffer.
Required Associated Types§
sourcetype PartialState
type PartialState
Whether the stream is currently partial or complete
Required Methods§
sourcefn complete(&mut self) -> Self::PartialState
fn complete(&mut self) -> Self::PartialState
Mark the stream is complete
sourcefn restore_partial(&mut self, state: Self::PartialState)
fn restore_partial(&mut self, state: Self::PartialState)
Restore the stream back to its previous state
sourcefn is_partial_supported() -> bool
fn is_partial_supported() -> bool
Report whether the Stream
is can ever be incomplete
Provided Methods§
sourcefn is_partial(&self) -> bool
fn is_partial(&self) -> bool
Report whether the Stream
is currently incomplete
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<'a> StreamIsPartial for &'a str
impl<'a> StreamIsPartial for &'a str
type PartialState = ()
fn complete(&mut self) -> Self::PartialState
fn restore_partial(&mut self, _state: Self::PartialState)
fn is_partial_supported() -> bool
source§impl<'a, T> StreamIsPartial for &'a [T]
impl<'a, T> StreamIsPartial for &'a [T]
type PartialState = ()
fn complete(&mut self) -> Self::PartialState
fn restore_partial(&mut self, _state: Self::PartialState)
fn is_partial_supported() -> bool
source§impl<I> StreamIsPartial for (I, usize)where
I: StreamIsPartial,
impl<I> StreamIsPartial for (I, usize)where
I: StreamIsPartial,
type PartialState = <I as StreamIsPartial>::PartialState
fn complete(&mut self) -> Self::PartialState
fn restore_partial(&mut self, state: Self::PartialState)
fn is_partial_supported() -> bool
fn is_partial(&self) -> bool
Implementors§
source§impl<'a> StreamIsPartial for &'a BStr
impl<'a> StreamIsPartial for &'a BStr
type PartialState = ()
source§impl<'a> StreamIsPartial for &'a Bytes
impl<'a> StreamIsPartial for &'a Bytes
type PartialState = ()
source§impl<I> StreamIsPartial for Located<I>where
I: StreamIsPartial,
impl<I> StreamIsPartial for Located<I>where
I: StreamIsPartial,
type PartialState = <I as StreamIsPartial>::PartialState
source§impl<I> StreamIsPartial for Partial<I>where
I: StreamIsPartial,
impl<I> StreamIsPartial for Partial<I>where
I: StreamIsPartial,
type PartialState = bool
source§impl<I, E> StreamIsPartial for Recoverable<I, E>where
I: StreamIsPartial + Stream,
Available on crate features unstable-recover
and std
only.
impl<I, E> StreamIsPartial for Recoverable<I, E>where
I: StreamIsPartial + Stream,
Available on crate features
unstable-recover
and std
only.