Skip to main content

PutHandle

Trait PutHandle 

Source
pub trait PutHandle:
    AsyncWrite
    + Send
    + Unpin
    + 'static {
    // Required method
    fn finalize(
        self,
        trailers: Option<Headers>,
    ) -> impl Future<Output = Result<()>> + Send;
}
Expand description

Streaming writer returned by CacheStorage::put.

Write body bytes via the AsyncWrite impl, then call finalize once the body is fully consumed. Dropping a PutHandle without finalizing aborts the write; partial data MUST NOT be exposed by a subsequent CacheStorage::get.

Required Methods§

Source

fn finalize( self, trailers: Option<Headers>, ) -> impl Future<Output = Result<()>> + Send

Commit the buffered bytes to storage with any trailers from the body source.

trailers is Some when the body source produced a trailers section (a BodySource whose trailers() returned Some after EOF), None otherwise — distinguishing “no trailers section” from “empty trailers section.”

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§