Skip to main content

ConfigStore

Struct ConfigStore 

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

One instance per daemon, serialized by its gate lock. No method reads live configuration files. Diagnostic snapshots are validated and redacted; approved delivery bytes may contain vault reference names, never literal secret values.

Implementations§

Source§

impl ConfigStore

Source

pub fn open(root: StoreRoot) -> Self

Reads only; the first stamp creates the directory and file. Caller must hold its daemon single-writer/start lock until this instance is dropped.

Source

pub fn check(&mut self) -> Result<(), StoreError>

Re-check before every authority use, including after delivery writes.

Source

pub fn body(&mut self) -> Result<&StoreBody, StoreError>

Source

pub fn status(&mut self) -> StoreStatus

Source

pub fn take_activities(&mut self) -> Vec<StoreActivity>

Source

pub fn delivery_ready(&mut self) -> Result<(), StoreError>

No approval/delivery may rely on a pending revision before this succeeds.

Source

pub fn retry_anchor(&mut self) -> Result<(), StoreError>

Source§

impl ConfigStore

Source

pub fn commit_generation( &mut self, entry: HistoryEntry, approved: Snapshot, observed: Snapshot, now_ms: u64, ) -> Result<u64, StoreError>

Receives a fully approved generation. observed must be a fresh snapshot of all files, not only the plan’s read set, so unrelated edits survive proposal rebasing. The caller has checked plan freshness and approval.

Source

pub fn recovery_exit( &mut self, entry: HistoryEntry, snapshot: Snapshot, now_ms: u64, ) -> Result<u64, StoreError>

Approved recovery exits discard every record from the rejected store. Only a present readable keychain item’s high-water survives. The caller supplies a newly validated file snapshot and approval, just as for stamp.

Source

pub fn observe(&mut self, snapshot: Snapshot) -> Result<bool, StoreError>

Before stamp this is informational and never creates a store file.

Source

pub fn record_delivery( &mut self, tuple: &Tuple, generation: u64, ack: bool, ) -> Result<(), StoreError>

ACK/NACK for a superseded generation changes nothing. A failure restores the active pointer immediately, even if its durable mark must wait for an anchor retry. ACKs never change memory while an anchor is pending.

Nothing is delivered while an earlier anchor is pending. Once repaired, an unanchored NACKed generation may return at most once per daemon start, never within one run and never after its failure is anchored. The crash window and persistent-keychain-failure proof is config_delivery_anchor_pending_restart_before_failure_anchor_may_redeliver_once.

Source

pub fn rollback_configuration( &mut self, generation: u64, ) -> Result<Snapshot, StoreError>

Source§

impl ConfigStore

Source

pub fn resume_delivery( &mut self, tuple: &Tuple, generation: u64, ) -> Result<bool, StoreError>

Persist a resumed attempt before notifying a module after daemon restart. Never-redeliver and superseded targets cannot be resumed.

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<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 = !

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

fn try_from(value: U) -> Result<T, !>

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