pub struct ProviderStore { /* private fields */ }Expand description
Secure provider-store handle rooted at one private directory.
Implementations§
Source§impl ProviderStore
impl ProviderStore
Sourcepub fn standard() -> Result<Self, ProviderStoreError>
pub fn standard() -> Result<Self, ProviderStoreError>
Opens the approved fixed per-user path.
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self, ProviderStoreError>
pub fn open(path: impl AsRef<Path>) -> Result<Self, ProviderStoreError>
Opens or creates an absolute private provider-store directory.
Sourcepub fn open_in(
anchor: impl AsRef<Path>,
relative: impl AsRef<Path>,
) -> Result<Self, ProviderStoreError>
pub fn open_in( anchor: impl AsRef<Path>, relative: impl AsRef<Path>, ) -> Result<Self, ProviderStoreError>
Opens a private provider-store directory below a trusted anchor.
pub fn path(&self) -> &Path
Sourcepub fn load(&self) -> Result<ProviderStoreSnapshot, ProviderStoreError>
pub fn load(&self) -> Result<ProviderStoreSnapshot, ProviderStoreError>
Locks and rereads the complete store.
Sourcepub fn reload_if_changed(
&self,
known: ProviderStoreGeneration,
) -> Result<Option<ProviderStoreSnapshot>, ProviderStoreError>
pub fn reload_if_changed( &self, known: ProviderStoreGeneration, ) -> Result<Option<ProviderStoreSnapshot>, ProviderStoreError>
Locks and rereads, returning state only when another process changed generation.
A matching cached content stamp proves the file is byte-identical to the last fully validated read, so the per-run-start reconcile skips the lock+decode entirely. The stamp is refreshed under the lock after every real read; a cross-process commit between the stat and the comparison is picked up by the next reconcile.
Sourcepub fn begin_transaction(
&self,
) -> Result<ProviderStoreTransaction<'_>, ProviderStoreError>
pub fn begin_transaction( &self, ) -> Result<ProviderStoreTransaction<'_>, ProviderStoreError>
Starts a bounded lock+reread transaction.
The lock is held only for the reread and released before returning, so
proposal compilation, runtime compilation, and the publication callback
all run lock-free. commit re-acquires the lock and compare-and-swaps
the base stamp captured here against the live on-disk state.