pub struct Beef {
pub version: u32,
pub bumps: Vec<MerklePath>,
pub transactions: HashMap<Hash, BeefTx>,
}Expand description
A set of Transactions and their MerklePaths (BUMPs).
Fields§
§version: u32BEEF version number (e.g. BEEF_V1 or BEEF_V2).
bumps: Vec<MerklePath>Merkle paths (BUMPs) proving transaction inclusion in blocks.
transactions: HashMap<Hash, BeefTx>Transactions keyed by their txid hash.
Implementations§
Source§impl Beef
impl Beef
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, SpvError>
pub fn from_bytes(data: &[u8]) -> Result<Self, SpvError>
Parse a BEEF from bytes.
Sourcepub fn find_transaction(&self, txid: &str) -> Option<&Transaction>
pub fn find_transaction(&self, txid: &str) -> Option<&Transaction>
Find a transaction by txid hex string.
Sourcepub fn find_bump(&self, txid: &str) -> Option<&MerklePath>
pub fn find_bump(&self, txid: &str) -> Option<&MerklePath>
Find a BUMP by txid.
Sourcepub fn find_bump_by_hash(&self, txid: &Hash) -> Option<&MerklePath>
pub fn find_bump_by_hash(&self, txid: &Hash) -> Option<&MerklePath>
Find a BUMP by txid hash.
Sourcepub fn merge_bump(&mut self, bump: &MerklePath) -> Result<usize, SpvError>
pub fn merge_bump(&mut self, bump: &MerklePath) -> Result<usize, SpvError>
Merge a BUMP, returning its index in the bumps array.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Beef
impl RefUnwindSafe for Beef
impl Send for Beef
impl Sync for Beef
impl Unpin for Beef
impl UnsafeUnpin for Beef
impl UnwindSafe for Beef
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