Skip to main content

DeliveryHandler

Trait DeliveryHandler 

Source
pub trait DeliveryHandler:
    Send
    + Sync
    + 'static {
    type Request: PageRequest;

    // Required method
    fn get_page_request(
        self: &Arc<Self>,
        key: u64,
        range: Range<u64>,
    ) -> Self::Request;

    // Provided methods
    fn get_child_page_request(
        self: &Arc<Self>,
        _child_key: u64,
        _child_target_offset: u64,
        _parent_byte_range: Range<u64>,
    ) -> Self::Request { ... }
    fn deliver_child_inline_tail(
        self: &Arc<Self>,
        _parent_byte_offset: u64,
        _child_key: u64,
        _child_target_offset: u64,
        _tail_length: u32,
    ) { ... }
    fn deliver_child_sparse(
        &self,
        _child_key: u64,
        _child_target_offset: u64,
        _child_length: u64,
    ) -> Result<(), Error> { ... }
    fn register_blob(
        &self,
        _key: u64,
        _merkle_leaves: &[[u8; 32]],
        _read_alignment: usize,
    ) -> Result<(), Error> { ... }
    fn unregister_file(&self, _key: u64) { ... }
}
Expand description

Trait for handling deliveries (page request buffers and blob registrations) from Files.

Required Associated Types§

Required Methods§

Source

fn get_page_request( self: &Arc<Self>, key: u64, range: Range<u64>, ) -> Self::Request

Produces a PageRequest to receive decompressed or uncompressed page data.

Provided Methods§

Source

fn get_child_page_request( self: &Arc<Self>, _child_key: u64, _child_target_offset: u64, _parent_byte_range: Range<u64>, ) -> Self::Request

Produces a PageRequest to receive parent file data for a child file mapping.

parent_byte_range is the unaligned slice within the parent file that backs the child extent starting at page-aligned child_target_offset in child_key. The returned PageRequest will be prepared and committed with chunks aligned to the parent file’s verification alignment.

Source

fn deliver_child_inline_tail( self: &Arc<Self>, _parent_byte_offset: u64, _child_key: u64, _child_target_offset: u64, _tail_length: u32, )

Enqueues a header-only ChildInlineTail command instructing the downstream verifier to supply a single inline-tail page at child_target_offset in child_key by copying tail_length bytes directly from parent_byte_offset in the verified parent VMO.

Source

fn deliver_child_sparse( &self, _child_key: u64, _child_target_offset: u64, _child_length: u64, ) -> Result<(), Error>

Delivers a sparse (zero-filled) range of child_length bytes at child_target_offset in child_key.

Source

fn register_blob( &self, _key: u64, _merkle_leaves: &[[u8; 32]], _read_alignment: usize, ) -> Result<(), Error>

Registers a blob’s Merkle tree leaf hashes and delivery read alignment with the downstream verifier.

Source

fn unregister_file(&self, _key: u64)

Unregisters a file when it is closed.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§