pub struct InMemoryFederationArtifactStore { /* private fields */ }Expand description
Reference in-memory implementation (test double and default backing when a deployment wants durable bilateral evidence without a database). Capped, idle-swept, gauged instead of an unbounded HashMap: even though this store has no install seam today, it must not become a footgun once a follow-on wires one up. A deployment requiring persistence installs a database-backed impl instead.
Implementations§
Source§impl InMemoryFederationArtifactStore
impl InMemoryFederationArtifactStore
Sourcepub fn with_capacity(capacity: usize, idle_ttl_secs: u64) -> Self
pub fn with_capacity(capacity: usize, idle_ttl_secs: u64) -> Self
Construct with an explicit per-map capacity and idle TTL. This is the seam
that lets a deployment wiring this reference store in from a CONFIGURED
process memory budget honor a lowered federation_cache_capacity instead of
the compiled-in 8192 default, so the store cannot exceed the operator’s
configured federation memory budget even though the kernel’s front caches
honor it. Same seam class as the velocity/journal from_memory_budget
constructors.
Sourcepub fn from_memory_budget(budget: &MemoryBudgetConfig) -> Self
pub fn from_memory_budget(budget: &MemoryBudgetConfig) -> Self
Construct from a CONFIGURED process memory budget so lowering
federation_cache_capacity / federation_cache_idle_ttl_secs actually
bounds each backing map, rather than every deployment retaining the
compiled-in 8192-entry default.
Sourcepub fn dual_signed_len(&self) -> usize
pub fn dual_signed_len(&self) -> usize
Live occupancy of the dual-signed-receipt backing map.
Trait Implementations§
Source§impl FederationArtifactStore for InMemoryFederationArtifactStore
impl FederationArtifactStore for InMemoryFederationArtifactStore
fn put_dual_signed( &self, id: &str, receipt: &DualSignedReceipt, ) -> Result<(), KernelError>
fn get_dual_signed( &self, id: &str, ) -> Result<Option<DualSignedReceipt>, KernelError>
fn put_dsse(&self, id: &str, envelope: &DsseEnvelope) -> Result<(), KernelError>
fn get_dsse(&self, id: &str) -> Result<Option<DsseEnvelope>, KernelError>
Source§fn is_durable(&self) -> bool
fn is_durable(&self) -> bool
id is still resolvable through this store. Only a
persistent backend (database, object store) whose writes outlive eviction
returns true; a bounded, drop-evicting in-memory store returns false
because it can evict the same id the front caches did. Read moreAuto Trait Implementations§
impl !Freeze for InMemoryFederationArtifactStore
impl RefUnwindSafe for InMemoryFederationArtifactStore
impl Send for InMemoryFederationArtifactStore
impl Sync for InMemoryFederationArtifactStore
impl Unpin for InMemoryFederationArtifactStore
impl UnsafeUnpin for InMemoryFederationArtifactStore
impl UnwindSafe for InMemoryFederationArtifactStore
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more