Skip to main content

MemorySource

Struct MemorySource 

Source
pub struct MemorySource { /* private fields */ }
Expand description

In-memory source — the test double, and the reference for how little a source is trusted to do.

Implementations§

Source§

impl MemorySource

Source

pub fn new() -> Self

Source

pub fn with_manifest(self, bytes: &[u8]) -> Self

Source

pub fn with_blob(self, digest: &str, bytes: &[u8]) -> Self

Source

pub fn with_line_index(self, envelope: &[u8]) -> Self

Attach a baseline line-status envelope the source carries beside the layer (REQ-STATUS-DIST-001). Carry a signed line index (REQ-INDEXAUTH-001).

Source

pub fn serving(self, layers: &[&str]) -> Self

What this source admits to serving. Setting it makes the source enumerable, which is what lets omission be detected — a source that never sets it cannot be accused of hiding.

Source

pub fn with_line_status(self, envelope: &[u8]) -> Self

Source

pub fn with_attestation(self, statement: &[u8], attested_bytes: &[u8]) -> Self

Carry an attestation beside the layer (REQ-ATTEST-002). The statement’s digest is derived from the bytes handed over, not declared: a source that could name its own content addresses would be trusted about something, and it is trusted about nothing.

Trait Implementations§

Source§

impl Debug for MemorySource

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MemorySource

Source§

fn default() -> MemorySource

Returns the “default value” for a type. Read more
Source§

impl LayerSource for MemorySource

Source§

fn fetch_manifest(&self, layer: &LayerRef) -> Result<Vec<u8>, SourceError>

Fetch the manifest bytes for a layer reference.
Source§

fn fetch_blob(&self, digest: &str) -> Result<Vec<u8>, SourceError>

Fetch a blob (a tool binary) by its digest (sha256:<hex>).
Source§

fn fetch_line_index(&self, _line: &str) -> Result<Option<Vec<u8>>, SourceError>

Fetch the realm’s signed line-index envelope for this line, if the source carries one (REQ-INDEXAUTH-001). Same contract as fetch_line_status: opaque bytes, re-verified by the caller against the trust root. The source is never trusted to have checked it — it is precisely the party this document exists to constrain.
Source§

fn served_layers(&self, _line: &str) -> Result<Option<Vec<String>>, SourceError>

The layer ids this source is willing to serve for a line. Used to detect OMISSION against the signed index. A source that cannot enumerate returns Ok(None) — distinct from Ok(Some(vec![])), which means “I enumerate, and I have nothing”, and would flag every indexed layer as hidden.
Source§

fn fetch_line_status( &self, _layer: &LayerRef, ) -> Result<Option<Vec<u8>>, SourceError>

Fetch the baseline line-status DSSE envelope this source carries beside the layer, if any (REQ-STATUS-DIST-001). Returns the opaque envelope bytes — the source is not trusted to have verified them; the caller re-verifies against the trust root before caching. A source that carries no baseline returns Ok(None), which is not an error: line-status is updatable evidence, absent on some layers.
Source§

fn fetch_attestations( &self, _layer: &LayerRef, ) -> Result<Vec<CarriedAttestation>, SourceError>

Fetch the attestations this source carries beside the layer as referrer artifacts (REQ-ATTEST-002). Same contract as fetch_line_status: OPAQUE, UNTRUSTED bytes. The source is never trusted to have verified a statement — it is the party that would benefit from a forged one — so the caller persists them verbatim and varve verify re-checks each against the trust root. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more