Struct bdk_chain::tx_graph::TxUpdate

source ·
pub struct TxUpdate<A = ()> {
    pub txs: Vec<Arc<Transaction>>,
    pub txouts: BTreeMap<OutPoint, TxOut>,
    pub anchors: BTreeSet<(A, Txid)>,
    pub seen_ats: HashMap<Txid, u64>,
}
Expand description

Data object used to communicate updates about relevant transactions from some chain data source to the core model (usually a bdk_chain::TxGraph).

Fields§

§txs: Vec<Arc<Transaction>>

Full transactions. These are transactions that were determined to be relevant to the wallet given the request.

§txouts: BTreeMap<OutPoint, TxOut>

Floating txouts. These are TxOuts that exist but the whole transaction wasn’t included in txs since only knowing about the output is important. These are often used to help determine the fee of a wallet transaction.

§anchors: BTreeSet<(A, Txid)>

Transaction anchors. Anchors tells us a position in the chain where a transaction was confirmed.

§seen_ats: HashMap<Txid, u64>

Seen at times for transactions. This records when a transaction was most recently seen in the user’s mempool for the sake of tie-breaking other conflicting transactions.

Implementations§

source§

impl<A> TxUpdate<A>
where A: Ord,

source

pub fn map_anchors<A2, F>(self, map: F) -> TxUpdate<A2>
where A2: Ord, F: FnMut(A) -> A2,

Transforms the TxUpdate to have anchors (A) of another type (A2).

This takes in a closure with signature FnMut(A) -> A2 which is called for each anchor to transform it.

source

pub fn extend(&mut self, other: TxUpdate<A>)

Extend this update with other.

Trait Implementations§

source§

impl<A> Clone for TxUpdate<A>
where A: Clone,

source§

fn clone(&self) -> TxUpdate<A>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<A> Debug for TxUpdate<A>
where A: Debug,

source§

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

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

impl<A> Default for TxUpdate<A>

source§

fn default() -> TxUpdate<A>

Returns the “default value” for a type. Read more
source§

impl<A> From<TxGraph<A>> for TxUpdate<A>

source§

fn from(graph: TxGraph<A>) -> Self

Converts to this type from the input type.
source§

impl<A: Ord + Clone> From<TxUpdate<A>> for TxGraph<A>

source§

fn from(update: TxUpdate<A>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<A> Freeze for TxUpdate<A>

§

impl<A> RefUnwindSafe for TxUpdate<A>
where A: RefUnwindSafe,

§

impl<A> Send for TxUpdate<A>
where A: Send,

§

impl<A> Sync for TxUpdate<A>
where A: Sync,

§

impl<A> Unpin for TxUpdate<A>

§

impl<A> UnwindSafe for TxUpdate<A>
where A: RefUnwindSafe,

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

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

§

fn vzip(self) -> V