pub trait BlockingStreamSink {
type Error;
// Required methods
fn write_chunk(&mut self, input: &[u8]) -> Result<usize, Self::Error>;
fn commit(&mut self) -> Result<(), Self::Error>;
fn abort(&mut self, partial: StreamPartialState);
}Expand description
Blocking sink with explicit commit and infallible abort cleanup.
Required Associated Types§
Required Methods§
Sourcefn write_chunk(&mut self, input: &[u8]) -> Result<usize, Self::Error>
fn write_chunk(&mut self, input: &[u8]) -> Result<usize, Self::Error>
Accepts some or all bytes. A zero result is a bounded no-progress event.
Sourcefn abort(&mut self, partial: StreamPartialState)
fn abort(&mut self, partial: StreamPartialState)
Aborts an incomplete stream according to its recorded partial state.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".