Silk

silk/memory_trust_source

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc.

Explicit replaceable in-memory trust for deterministic applications and tests.

When to use

Use MemoryTrustSource when the application already owns its trust snapshot and wants later loads to observe explicit replacement. Supply it lexically as silk.trust_source.TrustSource.

Details

Each load copies the current snapshot. Replacement exchanges complete owners without allocation and affects only later loads. Earlier loaded snapshots remain independent.

Gotchas

This provider performs no I/O, refresh, deduplication, path validation, or OS-policy discovery.

Import as MemoryTrustSource with import silk.memory_trust_source { MemoryTrustSource }.

Public declarations: 1.

MemoryTrustSource

pub struct MemoryTrustSource

A mutable provider that owns one complete current trust snapshot.

Associated function MemoryTrustSource.make

pub fn make(snapshot: TrustSnapshot) -> MemoryTrustSource

Consumes a snapshot and creates a provider without allocation or validation.

Method MemoryTrustSource.replace

pub fn replace<'life0>(self: &'life0 mut MemoryTrustSource, next: TrustSnapshot) -> TrustSnapshot

Atomically replaces current trust and returns the complete old snapshot.

Details

This operation allocates nothing and cannot fail. The new snapshot affects only later loads. Existing loaded snapshots remain independent owners.

Implementation TrustSource for MemoryTrustSource

impl TrustSource for MemoryTrustSource

Operation load

load = MemoryTrustSource.loadCurrent

On this page