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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl StreamIsPartial for &str
impl StreamIsPartial for &str
type PartialState = ()
fn complete(&mut self) -> Self::PartialState
fn restore_partial(&mut self, _state: Self::PartialState)
fn is_partial_supported() -> bool
Source§impl<T> StreamIsPartial for &[T]
impl<T> StreamIsPartial for &[T]
type PartialState = ()
fn complete(&mut self) -> Self::PartialState
fn restore_partial(&mut self, _state: Self::PartialState)
fn is_partial_supported() -> bool
Implementors§
Source§impl StreamIsPartial for &BStr
impl StreamIsPartial for &BStr
type PartialState = ()
Source§impl StreamIsPartial for &Bytes
impl StreamIsPartial for &Bytes
type PartialState = ()
Source§impl<'t, T> StreamIsPartial for TokenSlice<'t, T>
impl<'t, T> StreamIsPartial for TokenSlice<'t, T>
type PartialState = <&'t [T] as StreamIsPartial>::PartialState
Source§impl<I> StreamIsPartial for Bits<I>where
I: StreamIsPartial,
Available on crate feature binary only.
impl<I> StreamIsPartial for Bits<I>where
I: StreamIsPartial,
Available on crate feature
binary only.type PartialState = <I as StreamIsPartial>::PartialState
Source§impl<I> StreamIsPartial for LocatingSlice<I>where
I: StreamIsPartial,
impl<I> StreamIsPartial for LocatingSlice<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.