bdk_chain::tx_graph

Struct TxUpdate

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§

§

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

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.

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

Extend this update with other.

Trait Implementations§

§

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

§

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
§

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

§

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

Formats the value using the given formatter. Read more
§

impl<A> Default for TxUpdate<A>

§

fn default() -> TxUpdate<A>

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

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

Source§

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

Converts to this type from the input type.
Source§

impl<A: Anchor> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

Source§

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

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

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

§

fn vzip(self) -> V