Skip to main content

SourceServer

Trait SourceServer 

Source
pub trait SourceServer {
    // Required methods
    fn serve_range(
        &self,
        offset: u64,
        len: u64,
        limits: Limits,
    ) -> Result<Vec<u8>>;
    fn serve_document(&self, limits: Limits) -> Result<Vec<u8>>;
}
Expand description

Supplies exact source byte ranges to a seed-DAG materialization.

The full implementation is a parsed descriptor ([impl SourceServer for ParsedDescriptor]); a partial loader that reads only the records a query needs is the other. Every materializer that resolves an exact Q_ref node goes through this one method, so the DAG logic cannot diverge between the complete and partial sources.

Required Methods§

Source

fn serve_range(&self, offset: u64, len: u64, limits: Limits) -> Result<Vec<u8>>

Bytes of the source range [offset, offset + len).

Source

fn serve_document(&self, limits: Limits) -> Result<Vec<u8>>

The whole reconstructed source (only a DocumentExact node needs this).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§