AsyncBlockStoreRead

Trait AsyncBlockStoreRead 

Source
pub trait AsyncBlockStoreRead: Send {
    // Required method
    fn read_block_into(
        &mut self,
        cid: Cid,
        contents: &mut Vec<u8>,
    ) -> impl Future<Output = Result<(), Error>> + Send;

    // Provided method
    fn read_block(
        &mut self,
        cid: Cid,
    ) -> impl Future<Output = Result<Vec<u8>, Error>> + Send { ... }
}

Required Methods§

Source

fn read_block_into( &mut self, cid: Cid, contents: &mut Vec<u8>, ) -> impl Future<Output = Result<(), Error>> + Send

Read a single block from the block store into the provided buffer.

Provided Methods§

Source

fn read_block( &mut self, cid: Cid, ) -> impl Future<Output = Result<Vec<u8>, Error>> + Send

Read a single block from the block store.

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.

Implementations on Foreign Types§

Source§

impl<T: AsyncBlockStoreRead> AsyncBlockStoreRead for &mut T

Source§

fn read_block_into( &mut self, cid: Cid, contents: &mut Vec<u8>, ) -> impl Future<Output = Result<(), Error>> + Send

Implementors§