pub trait AsyncSink {
type Error;
// Required method
async fn write(&mut self, bytes: &[u8]) -> Result<(), Self::Error>;
// Provided method
async fn begin(&mut self, _file_size: u32) -> Result<(), Self::Error> { ... }
}Available on crate feature
async only.Expand description
Where an async file’s bytes go: Sink, awaited.
Required Associated Types§
Required Methods§
Provided Methods§
Sourceasync fn begin(&mut self, _file_size: u32) -> Result<(), Self::Error>
async fn begin(&mut self, _file_size: u32) -> Result<(), Self::Error>
The whole file’s length, as Sink::begin has it: only
write_async calls this.
§Errors
Whatever stops the sink taking a file of that length.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".