Struct bdk_wallet::LoadParams
source · pub struct LoadParams { /* private fields */ }
Expand description
Parameters for Wallet::load
or PersistedWallet::load
.
Implementations§
source§impl LoadParams
impl LoadParams
sourcepub fn new() -> Self
pub fn new() -> Self
Construct parameters with default values.
Default values: lookahead
= [DEFAULT_LOOKAHEAD
]
sourcepub fn keymap(self, keychain: KeychainKind, keymap: KeyMap) -> Self
pub fn keymap(self, keychain: KeychainKind, keymap: KeyMap) -> Self
Extend the given keychain
’s keymap
.
sourcepub fn descriptor<D>(
self,
keychain: KeychainKind,
expected_descriptor: Option<D>
) -> Selfwhere
D: IntoWalletDescriptor + Send + 'static,
pub fn descriptor<D>(
self,
keychain: KeychainKind,
expected_descriptor: Option<D>
) -> Selfwhere
D: IntoWalletDescriptor + Send + 'static,
Checks the expected_descriptor
matches exactly what is loaded for keychain
.
§Note
You must also specify extract_keys
if you wish to add a signer
for an expected descriptor containing secrets.
sourcepub fn check_network(self, network: Network) -> Self
pub fn check_network(self, network: Network) -> Self
Checks that the given network matches the one loaded from persistence.
sourcepub fn check_genesis_hash(self, genesis_hash: BlockHash) -> Self
pub fn check_genesis_hash(self, genesis_hash: BlockHash) -> Self
Checks that the given genesis_hash
matches the one loaded from persistence.
sourcepub fn extract_keys(self) -> Self
pub fn extract_keys(self) -> Self
Whether to try extracting private keys from the provided descriptors upon loading.
See also LoadParams::descriptor
.
sourcepub fn load_wallet<P>(
self,
persister: &mut P
) -> Result<Option<PersistedWallet<P>>, LoadWithPersistError<P::Error>>where
P: WalletPersister,
pub fn load_wallet<P>(
self,
persister: &mut P
) -> Result<Option<PersistedWallet<P>>, LoadWithPersistError<P::Error>>where
P: WalletPersister,
Load PersistedWallet
with the given WalletPersister
.
sourcepub async fn load_wallet_async<P>(
self,
persister: &mut P
) -> Result<Option<PersistedWallet<P>>, LoadWithPersistError<P::Error>>where
P: AsyncWalletPersister,
pub async fn load_wallet_async<P>(
self,
persister: &mut P
) -> Result<Option<PersistedWallet<P>>, LoadWithPersistError<P::Error>>where
P: AsyncWalletPersister,
Load PersistedWallet
with the given AsyncWalletPersister
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LoadParams
impl !RefUnwindSafe for LoadParams
impl Send for LoadParams
impl !Sync for LoadParams
impl Unpin for LoadParams
impl !UnwindSafe for LoadParams
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more