Struct grin_wallet_impls::LMDBBackend

source ·
pub struct LMDBBackend<'ck, C, K>
where C: NodeClient + 'ck, K: Keychain + 'ck,
{ pub keychain: Option<K>, pub master_checksum: Box<Option<Blake2bResult>>, /* private fields */ }

Fields§

§keychain: Option<K>

Keychain

§master_checksum: Box<Option<Blake2bResult>>

Check value for XORed keychain seed

Implementations§

source§

impl<'ck, C, K> LMDBBackend<'ck, C, K>
where C: NodeClient + 'ck, K: Keychain + 'ck,

source

pub fn new(data_file_dir: &str, n_client: C) -> Result<Self, Error>

source

pub fn exists(data_file_dir: &str) -> bool

Just test to see if database files exist in the current directory. If so, use a DB backend for all operations

Trait Implementations§

source§

impl<'ck, C, K> WalletBackend<'ck, C, K> for LMDBBackend<'ck, C, K>
where C: NodeClient + 'ck, K: Keychain + 'ck,

source§

fn set_keychain( &mut self, k: Box<K>, mask: bool, use_test_rng: bool ) -> Result<Option<SecretKey>, Error>

Set the keychain, which should already have been opened

source§

fn close(&mut self) -> Result<(), Error>

Close wallet

source§

fn keychain(&self, mask: Option<&SecretKey>) -> Result<K, Error>

Return the keychain being used, cloned with XORed token value for temporary use

source§

fn w2n_client(&mut self) -> &mut C

Return the node client being used

source§

fn calc_commit_for_cache( &mut self, keychain_mask: Option<&SecretKey>, amount: u64, id: &Identifier ) -> Result<Option<String>, Error>

return the version of the commit for caching

source§

fn set_parent_key_id_by_name(&mut self, label: &str) -> Result<(), Error>

Set parent path by account name

source§

fn set_parent_key_id(&mut self, id: Identifier)

set parent path

source§

fn parent_key_id(&mut self) -> Identifier

return the parent path
source§

fn get( &self, id: &Identifier, mmr_index: &Option<u64> ) -> Result<OutputData, Error>

Get output data by id
source§

fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = OutputData> + 'a>

Iterate over all output data stored by the backend
source§

fn get_tx_log_entry(&self, u: &Uuid) -> Result<Option<TxLogEntry>, Error>

Get an (Optional) tx log entry by uuid
source§

fn tx_log_iter<'a>(&'a self) -> Box<dyn Iterator<Item = TxLogEntry> + 'a>

Iterate over all output data stored by the backend
source§

fn get_private_context( &mut self, keychain_mask: Option<&SecretKey>, slate_id: &[u8] ) -> Result<Context, Error>

Retrieves the private context associated with a given slate id
source§

fn acct_path_iter<'a>( &'a self ) -> Box<dyn Iterator<Item = AcctPathMapping> + 'a>

Iterate over all stored account paths
source§

fn get_acct_path(&self, label: String) -> Result<Option<AcctPathMapping>, Error>

Gets an account path for a given label
source§

fn store_tx(&self, uuid: &str, tx: &Transaction) -> Result<(), Error>

Stores a transaction
source§

fn get_stored_tx(&self, uuid: &str) -> Result<Option<Transaction>, Error>

Retrieves a stored transaction from a TxLogEntry
source§

fn batch<'a>( &'a mut self, keychain_mask: Option<&SecretKey> ) -> Result<Box<dyn WalletOutputBatch<K> + 'a>, Error>

Create a new write batch to update or remove output data
source§

fn batch_no_mask<'a>( &'a mut self ) -> Result<Box<dyn WalletOutputBatch<K> + 'a>, Error>

Batch for use when keychain isn’t available or required
source§

fn current_child_index<'a>( &mut self, parent_key_id: &Identifier ) -> Result<u32, Error>

Return the current child Index
source§

fn next_child<'a>( &mut self, keychain_mask: Option<&SecretKey> ) -> Result<Identifier, Error>

Next child ID when we want to create a new output, based on current parent
source§

fn last_confirmed_height<'a>(&mut self) -> Result<u64, Error>

last verified height of outputs directly descending from the given parent key
source§

fn last_scanned_block<'a>(&mut self) -> Result<ScannedBlockInfo, Error>

last block scanned during scan or restore
source§

fn init_status<'a>(&mut self) -> Result<WalletInitStatus, Error>

Flag whether the wallet needs a full UTXO scan on next update attempt

Auto Trait Implementations§

§

impl<'ck, C, K> Freeze for LMDBBackend<'ck, C, K>
where C: Freeze, K: Freeze,

§

impl<'ck, C, K> !RefUnwindSafe for LMDBBackend<'ck, C, K>

§

impl<'ck, C, K> Send for LMDBBackend<'ck, C, K>

§

impl<'ck, C, K> Sync for LMDBBackend<'ck, C, K>

§

impl<'ck, C, K> Unpin for LMDBBackend<'ck, C, K>
where C: Unpin, K: Unpin,

§

impl<'ck, C, K> !UnwindSafe for LMDBBackend<'ck, C, K>

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> SafeBorrow<T> for T
where T: ?Sized,

source§

fn borrow_replacement(ptr: &T) -> &T

Given ptr, which was obtained from a prior call to Self::borrow(), return a value with the same nominal lifetime which is guaranteed to survive mutations to Self. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> UnsafeAny for T
where T: Any,