Skip to main content

MemorySource

Trait MemorySource 

Source
pub trait MemorySource: Send + Sync {
    // Required method
    fn fetch(&self, addr: &MemAddr) -> Result<MemPayload>;
}
Expand description

Read-only pull of an ADDRESSED memory item behind the memory_fetch tool.

Object-safe and shareable (the loop holds &dyn MemorySource; Sync because the borrow crosses .await points) — the exact bounds and seam as super::recall::RecallSource. Implementations MUST be scoped to the active workspace: a turn:/compaction: address from another workspace resolves to MemPayload::NotFound, never a cross-workspace leak (§7).

Required Methods§

Source

fn fetch(&self, addr: &MemAddr) -> Result<MemPayload>

Resolve addr to its verbatim body or labelled absence. A genuine backend failure (e.g. a corrupt store row) is an Err; an unknown but well-formed address is Ok(MemPayload::NotFound) — the executor distinguishes the two (a backend error surfaces as error: verbatim; absence surfaces as coaching).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§