Skip to main content

ChunkGet

Trait ChunkGet 

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

    // Required method
    fn get(
        &self,
        address: &ChunkAddress,
    ) -> impl Future<Output = Result<AnyChunk<BODY_SIZE>, Self::Error>> + MaybeSend;
}
Expand description

Async chunk retrieval (primary API).

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Error type for get operations.

Required Methods§

Source

fn get( &self, address: &ChunkAddress, ) -> impl Future<Output = Result<AnyChunk<BODY_SIZE>, Self::Error>> + MaybeSend

Get a chunk by address.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: ChunkGet<BS> + ?Sized, const BS: usize> ChunkGet<BS> for &T

Source§

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

Source§

fn get( &self, address: &ChunkAddress, ) -> impl Future<Output = Result<AnyChunk<BS>, Self::Error>> + MaybeSend

Source§

impl<const BODY_SIZE: usize> ChunkGet<BODY_SIZE> for HashMap<ChunkAddress, AnyChunk<BODY_SIZE>>

Source§

type Error = ChunkStoreError

Source§

async fn get( &self, address: &ChunkAddress, ) -> Result<AnyChunk<BODY_SIZE>, Self::Error>

Implementors§

Source§

impl<const BODY_SIZE: usize> ChunkGet<BODY_SIZE> for MemoryStore<BODY_SIZE>

Source§

impl<const BODY_SIZE: usize> ChunkGet<BODY_SIZE> for NullLoader<BODY_SIZE>