Skip to main content

DataRefFetcher

Trait DataRefFetcher 

Source
pub trait DataRefFetcher: Send + Sync {
    // Required method
    fn fetch(
        &self,
        location: &Location,
    ) -> impl Future<Output = Result<Vec<u8>, AcdpError>> + Send;
}
Expand description

Pluggable fetch strategy for a DataRef. Implementations are responsible for SSRF defenses and response-size caps on URI fetches; structured locators are protocol-specific and likely need their own trait impl per scheme (kafka.offset, ipfs.cid, …).

Required Methods§

Source

fn fetch( &self, location: &Location, ) -> impl Future<Output = Result<Vec<u8>, AcdpError>> + Send

Fetch raw bytes referenced by location. Implementations MAY reject Location::Structured with a clear error rather than implementing every scheme.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§