Skip to main content

SyncChunkGet

Trait SyncChunkGet 

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

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

Retrieves chunks by address (synchronous).

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Error type for get operations.

Required Methods§

Source

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

Get a chunk by address.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: SyncChunkGet<BS>, const BS: usize> SyncChunkGet<BS> for &T

Source§

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

Source§

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

Source§

impl<T: SyncChunkGet<BS>, const BS: usize> SyncChunkGet<BS> for &mut T

Source§

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

Source§

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

Source§

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

Source§

type Error = ChunkStoreError

Source§

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

Implementors§

Source§

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

Source§

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