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) -> Option<Vec<&Transaction>>
pub fn exit_branch(&self, leaf_idx: usize) -> Option<Vec<&Transaction>>
Construct the exit branch starting from the root ending in the leaf.
pub fn nb_leaves(&self) -> usize
Sourcepub fn all_signed_txs(&self) -> &[Transaction]
pub fn all_signed_txs(&self) -> &[Transaction]
Get all signed txs in this tree, starting with the leaves, towards the root.
Sourcepub fn build_vtxo(&self, leaf_idx: usize) -> Option<Vtxo>
pub fn build_vtxo(&self, leaf_idx: usize) -> Option<Vtxo>
Construct the VTXO at the given leaf index.
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.
This call is pretty wasteful.
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