Skip to main content

SidecarStore

Trait SidecarStore 

Source
pub trait SidecarStore: Send + Sync {
    // Provided methods
    fn has_redactions_for_blob(&self, _blob: &ContentHash) -> Result<bool> { ... }
    fn get_redactions_bytes_for_blob(
        &self,
        _blob: &ContentHash,
    ) -> Result<Option<Vec<u8>>> { ... }
    fn put_redactions_bytes_for_blob(
        &self,
        _blob: &ContentHash,
        _bytes: &[u8],
    ) -> Result<()> { ... }
    fn list_blobs_with_redactions(&self) -> Result<Vec<ContentHash>> { ... }
    fn has_state_visibility_for_state(&self, _state: &StateId) -> Result<bool> { ... }
    fn get_state_visibility_bytes_for_state(
        &self,
        _state: &StateId,
    ) -> Result<Option<Vec<u8>>> { ... }
    fn put_state_visibility_bytes_for_state(
        &self,
        _state: &StateId,
        _bytes: &[u8],
    ) -> Result<()> { ... }
    fn list_states_with_visibility(&self) -> Result<Vec<StateId>> { ... }
}
Expand description

Sidecar records that live outside the content-addressed object graph — signed redactions and state-visibility tiers. They never ride native packs and are transferred out-of-band. Backends that do not model them can use the default methods, while native stores override the relevant operations.

Provided Methods§

Source

fn has_redactions_for_blob(&self, _blob: &ContentHash) -> Result<bool>

Whether the store holds any redaction record for the given blob.

Redactions live in a sidecar (<heddle_dir>/redactions/) that is structurally outside the content-addressed object graph so GC can’t reach them. The wire layer needs a cheap probe to decide whether to ship a redaction for a blob in the closure, so this is a separate method rather than a get_* + null check.

Default impl returns Ok(false) — stores that don’t model redactions silently report “no redactions,” which is the correct behaviour for purely in-memory or remote-shim stores.

Source

fn get_redactions_bytes_for_blob( &self, _blob: &ContentHash, ) -> Result<Option<Vec<u8>>>

Return the raw rmp-encoded RedactionsBlob bytes for the given blob, or Ok(None) if no redaction record exists. The bytes are byte-identical to what was written by put_redactions_bytes_for_blob (or by Repository::put_redaction); this is the wire-transfer payload, not a re-serialized view.

Default impl returns Ok(None).

Source

fn put_redactions_bytes_for_blob( &self, _blob: &ContentHash, _bytes: &[u8], ) -> Result<()>

Persist the rmp-encoded RedactionsBlob bytes for the given blob. Receiver-side replay calls this after signature verification so the bytes land in the same sidecar that the sender’s Repository::put_redaction writes to.

Default impl returns an “unsupported” error — stores that don’t model redactions (e.g. read-only shims) refuse rather than silently dropping the record.

Source

fn list_blobs_with_redactions(&self) -> Result<Vec<ContentHash>>

List every blob that has at least one redaction record. Used by the GC pin guard and by sync to enumerate redactions for the state closure. Order is unspecified; callers that need stable ordering should sort.

Default impl returns Ok(vec![]).

Source

fn has_state_visibility_for_state(&self, _state: &StateId) -> Result<bool>

Whether the store holds any state-visibility record for state.

Like redactions, state-visibility records live in a sidecar outside the content-addressed object graph and cannot ride native packs. Sync uses this probe while enumerating a state closure so a non-public state can advertise the sidecar that must travel out-of-pack.

Default impl returns Ok(false) for stores that do not model this sidecar.

Source

fn get_state_visibility_bytes_for_state( &self, _state: &StateId, ) -> Result<Option<Vec<u8>>>

Return the raw rmp-encoded StateVisibilityBlob bytes for state, or Ok(None) if no sidecar exists. The bytes are the wire-transfer payload for state visibility.

Default impl returns Ok(None).

Source

fn put_state_visibility_bytes_for_state( &self, _state: &StateId, _bytes: &[u8], ) -> Result<()>

Persist raw StateVisibilityBlob bytes for state.

Default impl returns an “unsupported” error so stores that do not model the sidecar refuse instead of dropping it.

Source

fn list_states_with_visibility(&self) -> Result<Vec<StateId>>

List every state with at least one state-visibility record.

Default impl returns Ok(vec![]).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§