Skip to content

ConnectionStore

Functions

  • exclusive - Waits for the exclusive lock. Every change goes through it. Like
  • open - Opens dir, creating it with mode 0700 (and missing parents with
  • shared - Waits for a shared lock: other readers may hold it at the same time,

firma_connection_store::store::ConnectionStore::exclusive

Section titled “firma_connection_store::store::ConnectionStore::exclusive”

Function

Waits for the exclusive lock. Every change goes through it. Like [Self::shared], this is not reentrant.

As [Self::shared].

fn exclusive(self: &Self) -> Result<WriteGuard, StoreError>

firma_connection_store::store::ConnectionStore::open

Section titled “firma_connection_store::store::ConnectionStore::open”

Function

Opens dir, creating it with mode 0700 (and missing parents with default permissions) when it does not exist.

Returns [StoreError::RelativeDirectory] for a relative dir, [StoreError::UnprotectedPath] when dir is a symlink, belongs to another user or is accessible to group or others (Unix), and [StoreError::Io] when it cannot be created or inspected.

fn open<impl Into<PathBuf>>(dir: impl Trait) -> Result<Self, StoreError>

firma_connection_store::store::ConnectionStore::shared

Section titled “firma_connection_store::store::ConnectionStore::shared”

Function

Waits for a shared lock: other readers may hold it at the same time, writers wait. The guard owns its lock handle and a copy of the store, so it can move to another thread. Locks are not reentrant: taking a second guard for the same directory while holding one can deadlock.

Returns an error when the directory or the lock file is not private, or the lock cannot be taken.

fn shared(self: &Self) -> Result<ReadGuard, StoreError>