pub struct JsonFileStore { /* private fields */ }Expand description
File-backed stage store. Persists to JSON on every mutation. Loads stdlib on first creation, then reads from disk on subsequent runs.
Implementations§
Source§impl JsonFileStore
impl JsonFileStore
Trait Implementations§
Source§impl StageStore for JsonFileStore
impl StageStore for JsonFileStore
fn put(&mut self, stage: Stage) -> Result<StageId, StoreError>
Source§fn upsert(&mut self, stage: Stage) -> Result<StageId, StoreError>
fn upsert(&mut self, stage: Stage) -> Result<StageId, StoreError>
Insert a stage, replacing any existing stage with the same ID.
Used to upgrade unsigned stdlib stages after signing is added.
Source§fn remove(&mut self, id: &StageId) -> Result<(), StoreError>
fn remove(&mut self, id: &StageId) -> Result<(), StoreError>
Remove a stage entirely. Returns
Ok(()) whether or not the stage existed.fn get(&self, id: &StageId) -> Result<Option<&Stage>, StoreError>
fn contains(&self, id: &StageId) -> bool
fn list(&self, lifecycle: Option<&StageLifecycle>) -> Vec<&Stage>
fn update_lifecycle( &mut self, id: &StageId, lifecycle: StageLifecycle, ) -> Result<(), StoreError>
fn stats(&self) -> StoreStats
Source§fn get_owned(&self, id: &StageId) -> Result<Option<Stage>, StoreError>
fn get_owned(&self, id: &StageId) -> Result<Option<Stage>, StoreError>
Return an owned clone of the stage. Useful for async contexts where
holding a borrow across lock boundaries is not permitted.
Source§fn list_owned(&self, lifecycle: Option<&StageLifecycle>) -> Vec<Stage>
fn list_owned(&self, lifecycle: Option<&StageLifecycle>) -> Vec<Stage>
Return owned clones of all matching stages.
Source§fn find_by_name(&self, name: &str) -> Vec<&Stage>
fn find_by_name(&self, name: &str) -> Vec<&Stage>
Find all stages whose metadata
name field matches exactly.
Used by graph loaders so composition files can reference stages
by their human-authored name instead of their 8-char content-hash
prefix. Returns every match across all lifecycles; callers
typically filter for Active.Source§fn get_by_signature(&self, signature_id: &SignatureId) -> Option<&Stage>
fn get_by_signature(&self, signature_id: &SignatureId) -> Option<&Stage>
Look up the Active stage for a given
SignatureId. This is
the M2 “resolve signature to latest implementation” pathway: a
graph that pins a stage by signature_id gets whichever
implementation is Active today. Read moreSource§fn active_stages_with_signature(
&self,
signature_id: &SignatureId,
) -> Vec<&Stage>
fn active_stages_with_signature( &self, signature_id: &SignatureId, ) -> Vec<&Stage>
Return every Active stage whose
signature_id matches.
Ordered lexicographically by implementation ID so iteration is
stable across HashMap-backed stores. Read moreAuto Trait Implementations§
impl Freeze for JsonFileStore
impl RefUnwindSafe for JsonFileStore
impl Send for JsonFileStore
impl Sync for JsonFileStore
impl Unpin for JsonFileStore
impl UnsafeUnpin for JsonFileStore
impl UnwindSafe for JsonFileStore
Blanket Implementations§
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
Mutably borrows from an owned value. Read more