pub struct CachedSignedVtxoTree {
pub spec: SignedVtxoTreeSpec,
pub txs: Vec<Transaction>,
}Expand description
A fully signed VTXO tree, with all the transaction cached.
This is useful for cheap extraction of VTXO branches.
Fields§
§spec: SignedVtxoTreeSpec§txs: Vec<Transaction>All signed txs in this tree, starting with the leaves, towards the root.
Implementations§
Source§impl CachedSignedVtxoTree
impl CachedSignedVtxoTree
Sourcepub fn exit_branch(&self, leaf_idx: usize) -> Vec<&Transaction>
pub fn exit_branch(&self, leaf_idx: usize) -> Vec<&Transaction>
Construct the exit branch starting from the root ending in the leaf.
Panics if leaf_idx is out of range.
pub fn nb_leaves(&self) -> usize
Sourcepub fn all_final_txs(&self) -> &[Transaction]
pub fn all_final_txs(&self) -> &[Transaction]
Get all final txs in this tree, starting with the leaves, towards the root.
Sourcepub fn build_vtxo(&self, leaf_idx: usize) -> Vtxo
pub fn build_vtxo(&self, leaf_idx: usize) -> Vtxo
Construct the VTXO at the given leaf index.
Panics if leaf_idx is out of range.
Sourcepub fn all_vtxos(&self) -> impl Iterator<Item = Vtxo> + ExactSizeIterator + '_
pub fn all_vtxos(&self) -> impl Iterator<Item = Vtxo> + ExactSizeIterator + '_
Construct all individual vtxos from this round.
Auto Trait Implementations§
impl Freeze for CachedSignedVtxoTree
impl RefUnwindSafe for CachedSignedVtxoTree
impl Send for CachedSignedVtxoTree
impl Sync for CachedSignedVtxoTree
impl Unpin for CachedSignedVtxoTree
impl UnwindSafe for CachedSignedVtxoTree
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