Struct Runtime

Source
pub struct Runtime<D = StdDescr, K = XpubDerivable, L2 = Option<ImpossibleLayer2>>
where D: Descriptor<K>, L2: Layer2,
{ /* private fields */ }

Implementations§

Source§

impl<D, K, L2> Runtime<D, K, L2>
where D: Descriptor<K>, L2: Layer2,

Source

pub fn path(&self) -> &Option<PathBuf>

Method borrowing Runtime::path field.

Source

pub fn wallet(&self) -> &Wallet<K, D, L2>

Method borrowing Runtime::wallet field.

Source

pub fn wallet_mut(&mut self) -> &mut Wallet<K, D, L2>

Method returning mutable borrow of Runtime::wallet field.

Source

pub fn warnings(&self) -> &Vec<Warning>

Method borrowing Runtime::warnings field.

Source§

impl<K, D> Runtime<D, K>
where D: Descriptor<K>,

Source

pub fn new_standard(descr: D, network: Network) -> Runtime<D, K>

Source§

impl<K, D, L2> Runtime<D, K, L2>
where D: Descriptor<K>, L2: Layer2,

Source

pub fn new_layer2( descr: D, l2_descr: <L2 as Layer2>::Descr, layer2: L2, network: Network, ) -> Runtime<D, K, L2>

Source

pub fn set_name(&mut self, name: String)

Source

pub fn sync<I>( &mut self, indexer: &I, ) -> Result<usize, Vec<<I as Indexer>::Error>>
where I: Indexer,

Source

pub fn attach(wallet: Wallet<K, D, L2>) -> Runtime<D, K, L2>

Source

pub fn detach(self) -> Wallet<K, D, L2>

Source

pub fn reset_warnings(&mut self)

Source§

impl<K, D> Runtime<D, K>
where D: Descriptor<K> + for<'de> Serialize + for<'de> Deserialize<'de>,

Source

pub fn load_standard(path: PathBuf) -> Result<Runtime<D, K>, LoadError>

Source

pub fn load_standard_or_init<E>( data_dir: PathBuf, network: Network, init: impl FnOnce(LoadError) -> Result<D, E>, ) -> Result<Runtime<D, K>, LoadError>
where LoadError: From<E>,

Source§

impl<K, D, L2> Runtime<D, K, L2>
where D: Descriptor<K> + for<'de> Serialize + for<'de> Deserialize<'de>, L2: Layer2 + for<'de> Serialize + for<'de> Deserialize<'de>, <L2 as Layer2>::Descr: for<'de> Serialize + for<'de> Deserialize<'de>, <L2 as Layer2>::Data: for<'de> Serialize + for<'de> Deserialize<'de>, <L2 as Layer2>::Cache: for<'de> Serialize + for<'de> Deserialize<'de>,

Source

pub fn load_layer2( path: PathBuf, ) -> Result<Runtime<D, K, L2>, LoadError<<L2 as Layer2>::LoadError>>

Source

pub fn load_layer2_or_init<E1, E2>( data_dir: PathBuf, network: Network, init: impl FnOnce(LoadError<<L2 as Layer2>::LoadError>) -> Result<D, E1>, init_l2: impl FnOnce() -> Result<(L2, <L2 as Layer2>::Descr), E2>, ) -> Result<Runtime<D, K, L2>, LoadError<<L2 as Layer2>::LoadError>>
where LoadError<<L2 as Layer2>::LoadError>: From<E1> + From<E2>,

Source

pub fn try_store(&self) -> Result<bool, StoreError<<L2 as Layer2>::StoreError>>

Source

pub fn store_as( &mut self, path: PathBuf, ) -> Result<(), StoreError<<L2 as Layer2>::StoreError>>

Source

pub fn store_default_path( &mut self, path: PathBuf, ) -> Result<(), StoreError<<L2 as Layer2>::StoreError>>

Methods from Deref<Target = Wallet<K, D, L2>>§

Source

pub fn set_name(&mut self, name: String)

Source

pub fn update<B>( &mut self, indexer: &B, ) -> MayError<usize, Vec<<B as Indexer>::Error>>
where B: Indexer,

Source

pub fn to_deriver(&self) -> D
where D: Clone, K: Clone,

Source

pub fn last_derivation_index( &self, keychain: impl Into<Keychain>, ) -> NormalIndex

Source

pub fn next_derivation_index( &mut self, keychain: impl Into<Keychain>, shift: bool, ) -> NormalIndex

Source

pub fn next_address( &mut self, keychain: impl Into<Keychain>, shift: bool, ) -> Address

Source

pub fn balance(&self) -> Sats

Source

pub fn transactions(&self) -> &BTreeMap<Txid, WalletTx>

Source

pub fn coins( &self, ) -> impl Iterator<Item = CoinRow<<<L2 as Layer2>::Cache as Layer2Cache>::Coin>>

Source

pub fn address_coins( &self, ) -> HashMap<DerivedAddr, Vec<CoinRow<<<L2 as Layer2>::Cache as Layer2Cache>::Coin>>>

Source

pub fn address_balance(&self) -> impl Iterator<Item = WalletAddr>

Source

pub fn history( &self, ) -> impl Iterator<Item = TxRow<<<L2 as Layer2>::Cache as Layer2Cache>::Tx>>

Source

pub fn utxo(&self, outpoint: Outpoint) -> Result<WalletUtxo, NonWalletItem>

Source

pub fn all_utxos(&self) -> impl Iterator<Item = WalletUtxo>

Source

pub fn coinselect<'a>( &'a self, up_to: Sats, selector: impl Fn(&WalletUtxo) -> bool + 'a, ) -> impl Iterator<Item = Outpoint> + 'a

Source

pub fn store( &self, path: &Path, ) -> Result<(), StoreError<<L2 as Layer2>::StoreError>>

Source

pub fn construct_psbt<'a, 'b>( &mut self, coins: impl IntoIterator<Item = Outpoint>, beneficiaries: impl IntoIterator<Item = &'b Beneficiary>, params: TxParams, ) -> Result<(Psbt, PsbtMeta), ConstructionError>

Methods from Deref<Target = WalletDescr<K, D, <L2 as Layer2>::Descr>>§

Source

pub fn generator(&self) -> &D

Method borrowing WalletDescr::generator field.

Source

pub fn network(&self) -> Network

Method returning copy of WalletDescr::network field.

Source

pub fn layer2(&self) -> &L2

Method borrowing WalletDescr::layer2 field.

Source

pub fn _phantom(&self) -> &PhantomData<K>

Method borrowing WalletDescr::_phantom field.

Source

pub fn addresses(&self, keychain: impl Into<Keychain>) -> AddrIter<'_, K, D>

Trait Implementations§

Source§

impl<D, K, L2> Debug for Runtime<D, K, L2>
where D: Debug + Descriptor<K>, K: Debug, L2: Debug + Layer2,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<K, D, L2> Deref for Runtime<D, K, L2>
where D: Descriptor<K>, L2: Layer2,

Source§

type Target = Wallet<K, D, L2>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<Runtime<D, K, L2> as Deref>::Target

Dereferences the value.
Source§

impl<K, D, L2> DerefMut for Runtime<D, K, L2>
where D: Descriptor<K>, L2: Layer2,

Source§

fn deref_mut(&mut self) -> &mut <Runtime<D, K, L2> as Deref>::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<D, K, L2> Freeze for Runtime<D, K, L2>
where L2: Freeze, D: Freeze, <L2 as Layer2>::Descr: Freeze, <L2 as Layer2>::Data: Freeze, <L2 as Layer2>::Cache: Freeze,

§

impl<D = StdDescr, K = XpubDerivable, L2 = Option<ImpossibleLayer2>> !RefUnwindSafe for Runtime<D, K, L2>

§

impl<D, K, L2> Send for Runtime<D, K, L2>
where L2: Send, D: Send, <L2 as Layer2>::Descr: Send, <L2 as Layer2>::Data: Send, <L2 as Layer2>::Cache: Send, K: Send,

§

impl<D, K, L2> Sync for Runtime<D, K, L2>
where L2: Sync, D: Sync, <L2 as Layer2>::Descr: Sync, <L2 as Layer2>::Data: Sync, <L2 as Layer2>::Cache: Sync, K: Sync,

§

impl<D, K, L2> Unpin for Runtime<D, K, L2>
where L2: Unpin, D: Unpin, <L2 as Layer2>::Descr: Unpin, <L2 as Layer2>::Data: Unpin, <L2 as Layer2>::Cache: Unpin, K: Unpin,

§

impl<D = StdDescr, K = XpubDerivable, L2 = Option<ImpossibleLayer2>> !UnwindSafe for Runtime<D, K, L2>

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, 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

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