winnow::stream

Trait 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§

Source

type PartialState

Whether the stream is currently partial or complete

Required Methods§

Source

fn complete(&mut self) -> Self::PartialState

Mark the stream is complete

Source

fn restore_partial(&mut self, state: Self::PartialState)

Restore the stream back to its previous state

Source

fn is_partial_supported() -> bool

Report whether the Stream is can ever be incomplete

Provided Methods§

Source

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<'a> StreamIsPartial for &'a str

Source§

impl<'a, T> StreamIsPartial for &'a [T]

Source§

impl<I> StreamIsPartial for (I, usize)
where I: StreamIsPartial,

Implementors§