Skip to content

store

Structs


firma_connection_store::store::ConnectionStore

Section titled “firma_connection_store::store::ConnectionStore”

Struct

The private directory that holds the connection.

Methods:

  • fn open<impl Into<PathBuf>>(dir: impl Trait) -> Result<Self, StoreError> - Opens dir, creating it with mode 0700 (and missing parents with
  • fn open_existing<impl Into<PathBuf>>(dir: impl Trait) -> Result<Option<Self>, StoreError> - Opens an existing private directory without creating anything.
  • fn open_with_native_store<impl Into<PathBuf>>(dir: impl Trait, native: Arc<CredentialStore>) -> Result<Self, StoreError> - Opens dir with the supplied credential backend. The backend is used
  • fn dir(self: &Self) -> &Path - The connection directory.
  • fn shared(self: &Self) -> Result<ReadGuard, StoreError> - Waits for a shared lock: other readers may hold it at the same time,
  • fn exclusive(self: &Self) -> Result<WriteGuard, StoreError> - Waits for the exclusive lock. Every change goes through it. Like

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Clone
    • fn clone(self: &Self) -> Self

Struct

A shared lock on the connection.

Methods:

  • fn load(self: &Self) -> Result<Option<SavedConnection>, StoreError> - Reads the saved connection and its secret, or None when there is

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result

Struct

The exclusive lock on the connection.

Methods:

  • fn load(self: &Self) -> Result<Option<SavedConnection>, StoreError> - Reads the saved connection, as [ReadGuard::load].
  • fn replace(self: &Self, connection: &Connection, secret: Option<&ConnectionSecret>, policy: SecretPolicy) -> Result<Replaced, StoreError> - Replaces the saved connection with connection and secret.
  • fn remove(self: &Self) -> Result<Removed, StoreError> - Removes the saved connection and, after that, its native credential

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result