pub struct BeekeeperOptions {
pub storage_root: String,
pub unlock_timeout: u32,
pub in_memory: bool,
}Expand description
Configuration consumed by BeekeeperApi::new.
Built with BeekeeperOptions::new and a chain of setters. All fields
are public so that callers can also construct the struct directly when
that reads more clearly than the builder.
Fields§
§storage_root: StringParent directory of the .beekeeper wallet directory used by the
filesystem-backed storage. Ignored when Self::in_memory is true.
unlock_timeout: u32Inactivity timeout in seconds after which unlocked wallets are
auto-locked. A value of 0 disables the timeout. Defaults to 900
(15 minutes).
in_memory: boolWhen true, no filesystem storage is created and wallets live only
in process memory. Useful for one-shot operations (e.g. import key
- sign + drop). Defaults to
false.
Implementations§
Source§impl BeekeeperOptions
impl BeekeeperOptions
Sourcepub fn new(storage_root: impl Into<String>) -> Self
pub fn new(storage_root: impl Into<String>) -> Self
Start a new options builder pinned to the given wallet storage root.
The directory is created lazily by
new_rust_storage_protocol when
the BeekeeperApi is constructed in
persistent mode.
Sourcepub fn unlock_timeout(self, seconds: u32) -> Self
pub fn unlock_timeout(self, seconds: u32) -> Self
Override the inactivity timeout (seconds). Pass 0 to disable.
Trait Implementations§
Source§impl Default for BeekeeperOptions
impl Default for BeekeeperOptions
Source§fn default() -> Self
fn default() -> Self
DEFAULT_STORAGE_ROOT, a 900-second unlock timeout, persistent
mode.