pub struct PrunedTransactionWithPrunableHash { /* private fields */ }Expand description
A pruned transaction with the hash of its pruned data, if version != 1.
Implementations§
Source§impl PrunedTransactionWithPrunableHash
impl PrunedTransactionWithPrunableHash
Sourcepub fn new(
transaction: Transaction<Pruned>,
prunable_hash: Option<[u8; 32]>,
) -> Option<Self>
pub fn new( transaction: Transaction<Pruned>, prunable_hash: Option<[u8; 32]>, ) -> Option<Self>
Create a new PrunedTransactionWithPrunableHash.
This expects (version != 1) == (prunable_hash = Some(_)) and returns None otherwise.
Sourcepub fn verify_as_possible(
self,
hash: [u8; 32],
) -> Result<Transaction<Pruned>, [u8; 32]>
pub fn verify_as_possible( self, hash: [u8; 32], ) -> Result<Transaction<Pruned>, [u8; 32]>
Verify the transaction has the expected hash, if possible.
This only works for transaction where version != 1. Transactions where version = 1 will
be returned without any verification.
If verification fails, the actual hash of the transaction is returned as the error.
Trait Implementations§
Source§impl AsRef<Transaction<Pruned>> for PrunedTransactionWithPrunableHash
impl AsRef<Transaction<Pruned>> for PrunedTransactionWithPrunableHash
Source§fn as_ref(&self) -> &Transaction<Pruned>
fn as_ref(&self) -> &Transaction<Pruned>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for PrunedTransactionWithPrunableHash
impl Clone for PrunedTransactionWithPrunableHash
Source§fn clone(&self) -> PrunedTransactionWithPrunableHash
fn clone(&self) -> PrunedTransactionWithPrunableHash
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl PartialEq for PrunedTransactionWithPrunableHash
impl PartialEq for PrunedTransactionWithPrunableHash
Source§fn eq(&self, other: &PrunedTransactionWithPrunableHash) -> bool
fn eq(&self, other: &PrunedTransactionWithPrunableHash) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for PrunedTransactionWithPrunableHash
impl StructuralPartialEq for PrunedTransactionWithPrunableHash
Auto Trait Implementations§
impl Freeze for PrunedTransactionWithPrunableHash
impl RefUnwindSafe for PrunedTransactionWithPrunableHash
impl Send for PrunedTransactionWithPrunableHash
impl Sync for PrunedTransactionWithPrunableHash
impl Unpin for PrunedTransactionWithPrunableHash
impl UnsafeUnpin for PrunedTransactionWithPrunableHash
impl UnwindSafe for PrunedTransactionWithPrunableHash
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