pub struct ChangeSet<A = ()> {
pub txs: BTreeSet<Arc<Transaction>>,
pub txouts: BTreeMap<OutPoint, TxOut>,
pub anchors: BTreeSet<(A, Txid)>,
pub last_seen: BTreeMap<Txid, u64>,
}
Expand description
The ChangeSet
represents changes to a TxGraph
.
Since TxGraph
is monotone, the “changeset” can only contain transactions to be added and
not removed.
Refer to module-level documentation for more.
Fields§
§txs: BTreeSet<Arc<Transaction>>
Added transactions.
txouts: BTreeMap<OutPoint, TxOut>
Added txouts.
anchors: BTreeSet<(A, Txid)>
Added anchors.
last_seen: BTreeMap<Txid, u64>
Added last-seen unix timestamps of transactions.
Implementations§
source§impl<A> ChangeSet<A>
impl<A> ChangeSet<A>
sourcepub fn txouts(&self) -> impl Iterator<Item = (OutPoint, &TxOut)>
pub fn txouts(&self) -> impl Iterator<Item = (OutPoint, &TxOut)>
Iterates over all outpoints contained within ChangeSet
.
sourcepub fn anchor_heights(&self) -> impl Iterator<Item = u32> + '_where
A: Anchor,
pub fn anchor_heights(&self) -> impl Iterator<Item = u32> + '_where
A: Anchor,
Iterates over the heights of that the new transaction anchors in this changeset.
This is useful if you want to find which heights you need to fetch data about in order to confirm or exclude these anchors.
Trait Implementations§
source§impl<A: PartialEq> PartialEq for ChangeSet<A>
impl<A: PartialEq> PartialEq for ChangeSet<A>
impl<A> StructuralPartialEq for ChangeSet<A>
Auto Trait Implementations§
impl<A> Freeze for ChangeSet<A>
impl<A> RefUnwindSafe for ChangeSet<A>where
A: RefUnwindSafe,
impl<A> Send for ChangeSet<A>where
A: Send,
impl<A> Sync for ChangeSet<A>where
A: Sync,
impl<A> Unpin for ChangeSet<A>
impl<A> UnwindSafe for ChangeSet<A>where
A: RefUnwindSafe,
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