Skip to main content

ChunkPut

Trait ChunkPut 

Source
pub trait ChunkPut<const BODY_SIZE: usize = DEFAULT_BODY_SIZE>: Send + Sync {
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn put(
        &self,
        chunk: AnyChunk<BODY_SIZE>,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;
}
Expand description

Async chunk storage (primary API, &self).

Implementors should use interior mutability (e.g. Mutex, RwLock). Types implementing SyncChunkPut + Send + Sync get this automatically.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Error type for put operations.

Required Methods§

Source

fn put( &self, chunk: AnyChunk<BODY_SIZE>, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Store a chunk.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T, const BS: usize> ChunkPut<BS> for T
where T: SyncChunkPut<BS> + Send + Sync,

Source§

type Error = <T as SyncChunkPut<BS>>::Error