Skip to main content

SourceResolver

Trait SourceResolver 

Source
pub trait SourceResolver {
    // Required method
    fn resolve_unverified(&self, id: &RawContentId) -> Result<Vec<u8>, String>;
}
Expand description

Where source bytes come from.

Split verified/unverified in the same shape as NodeStore: an implementor supplies the raw fetch, and verification is the caller’s — here, verify_unit’s — job. An implementation that “helpfully” verified inside resolve would make the mismatch case untestable.

Required Methods§

Source

fn resolve_unverified(&self, id: &RawContentId) -> Result<Vec<u8>, String>

Fetch the bytes named by id, without checking that they hash to it.

§Errors

Implementation-defined; surfaced as VerifyError::SourceUnavailable.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§