Skip to main content

BlockSource

Trait BlockSource 

Source
pub trait BlockSource: Send + Sync {
    // Required method
    fn read_block(
        &self,
        descriptor: &ObjectDescriptor,
        index: usize,
        control: &TransferControl,
        sink: &mut dyn Write,
    ) -> TransferResult<()>;
}
Expand description

An explicitly selected provider. Implementations must honor cancellation and deadline and bound every blocking I/O operation; the executor never detaches a thread or pretends it can forcibly interrupt arbitrary provider code.

Required Methods§

Source

fn read_block( &self, descriptor: &ObjectDescriptor, index: usize, control: &TransferControl, sink: &mut dyn Write, ) -> TransferResult<()>

Writes exactly the requested opaque block to a bounded sink. Do not allocate a whole object or log payloads. The caller verifies the digest.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§