Trait WriteObjectHandle

Source
pub trait WriteObjectHandle: ObjectHandle {
    // Required methods
    fn write_or_append(
        &self,
        offset: Option<u64>,
        buf: BufferRef<'_>,
    ) -> impl Future<Output = Result<u64, Error>> + Send;
    fn truncate(
        &self,
        size: u64,
    ) -> impl Future<Output = Result<(), Error>> + Send;
    fn flush(&self) -> impl Future<Output = Result<(), Error>> + Send;
}

Required Methods§

Source

fn write_or_append( &self, offset: Option<u64>, buf: BufferRef<'_>, ) -> impl Future<Output = Result<u64, Error>> + Send

Writes |buf.len())| bytes at |offset| (or the end of the file), returning the object size after writing. The writes may be cached, in which case a later call to |flush| is necessary to persist the writes.

Source

fn truncate(&self, size: u64) -> impl Future<Output = Result<(), Error>> + Send

Truncates the object to |size| bytes. The truncate may be cached, in which case a later call to |flush| is necessary to persist the truncate.

Source

fn flush(&self) -> impl Future<Output = Result<(), Error>> + Send

Flushes all pending data and metadata updates for the object.

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.

Implementors§