Skip to main content

BeekeeperOptions

Struct BeekeeperOptions 

Source
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: String

Parent directory of the .beekeeper wallet directory used by the filesystem-backed storage. Ignored when Self::in_memory is true.

§unlock_timeout: u32

Inactivity timeout in seconds after which unlocked wallets are auto-locked. A value of 0 disables the timeout. Defaults to 900 (15 minutes).

§in_memory: bool

When 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

Source

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.

Source

pub fn unlock_timeout(self, seconds: u32) -> Self

Override the inactivity timeout (seconds). Pass 0 to disable.

Source

pub fn in_memory(self, in_memory: bool) -> Self

Toggle in-memory mode. When true the storage_root value is retained for symmetry but is never used.

Trait Implementations§

Source§

impl Default for BeekeeperOptions

Source§

fn default() -> Self

DEFAULT_STORAGE_ROOT, a 900-second unlock timeout, persistent mode.

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, 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, 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.