pub struct MutableTransaction<T: AsRef<Transaction> = Arc<Transaction>> {
pub tx: T,
pub entries: Vec<Option<UtxoEntry>>,
pub calculated_fee: Option<u64>,
pub calculated_compute_mass: Option<u64>,
}Expand description
Represents a generic mutable/readonly/pointer transaction type along with partially filled UTXO entry data and optional fee and mass
Fields§
§tx: TThe inner transaction
entries: Vec<Option<UtxoEntry>>Partially filled UTXO entry data
calculated_fee: Option<u64>Populated fee
calculated_compute_mass: Option<u64>Populated compute mass (does not include the storage mass)
Implementations§
Source§impl<T: AsRef<Transaction>> MutableTransaction<T>
impl<T: AsRef<Transaction>> MutableTransaction<T>
pub fn new(tx: T) -> Self
pub fn id(&self) -> TransactionId
pub fn with_entries(tx: T, entries: Vec<UtxoEntry>) -> Self
Sourcepub fn as_verifiable(&self) -> impl VerifiableTransaction + '_
pub fn as_verifiable(&self) -> impl VerifiableTransaction + '_
Returns the tx wrapped as a VerifiableTransaction. Note that this function
must be called only once all UTXO entries are populated, otherwise it panics.
pub fn is_verifiable(&self) -> bool
pub fn is_fully_populated(&self) -> bool
pub fn missing_outpoints( &self, ) -> impl Iterator<Item = TransactionOutpoint> + '_
pub fn clear_entries(&mut self)
Sourcepub fn calculated_feerate(&self) -> Option<f64>
pub fn calculated_feerate(&self) -> Option<f64>
Returns the calculated feerate. The feerate is calculated as the amount of fee
this transactions pays per gram of the full contextual (compute & storage) mass. The
function returns a value when calculated fee exists and the contextual mass is greater
than zero, otherwise None is returned.
Sourcepub fn mempool_estimated_bytes(&self) -> usize
pub fn mempool_estimated_bytes(&self) -> usize
A function for estimating the amount of memory bytes used by this transaction (dedicated to mempool usage).
We need consistency between estimation calls so only this function should be used for this purpose since
estimate_mem_bytes is sensitive to pointer wrappers such as Arc
pub fn has_parent(&self, possible_parent: TransactionId) -> bool
pub fn has_parent_in_set( &self, possible_parents: &HashSet<TransactionId>, ) -> bool
Source§impl MutableTransaction
Specialized impl for T=Arc<Transaction>
impl MutableTransaction
Specialized impl for T=Arc<Transaction>
pub fn from_tx(tx: Transaction) -> Self
Trait Implementations§
Source§impl<T: AsRef<Transaction>> AsRef<Transaction> for MutableTransaction<T>
impl<T: AsRef<Transaction>> AsRef<Transaction> for MutableTransaction<T>
Source§fn as_ref(&self) -> &Transaction
fn as_ref(&self) -> &Transaction
Source§impl<T: Clone + AsRef<Transaction>> Clone for MutableTransaction<T>
impl<T: Clone + AsRef<Transaction>> Clone for MutableTransaction<T>
Source§fn clone(&self) -> MutableTransaction<T>
fn clone(&self) -> MutableTransaction<T>
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug + AsRef<Transaction>> Debug for MutableTransaction<T>
impl<T: Debug + AsRef<Transaction>> Debug for MutableTransaction<T>
Source§impl<T: AsRef<Transaction>> MemSizeEstimator for MutableTransaction<T>
impl<T: AsRef<Transaction>> MemSizeEstimator for MutableTransaction<T>
Source§fn estimate_mem_bytes(&self) -> usize
fn estimate_mem_bytes(&self) -> usize
Source§fn estimate_size(&self, mem_mode: MemMode) -> usize
fn estimate_size(&self, mem_mode: MemMode) -> usize
Source§fn estimate_mem_units(&self) -> usize
fn estimate_mem_units(&self) -> usize
Source§impl<T: PartialEq + AsRef<Transaction>> PartialEq for MutableTransaction<T>
impl<T: PartialEq + AsRef<Transaction>> PartialEq for MutableTransaction<T>
impl<T: Eq + AsRef<Transaction>> Eq for MutableTransaction<T>
impl<T: AsRef<Transaction>> StructuralPartialEq for MutableTransaction<T>
Auto Trait Implementations§
impl<T> Freeze for MutableTransaction<T>where
T: Freeze,
impl<T> RefUnwindSafe for MutableTransaction<T>where
T: RefUnwindSafe,
impl<T> Send for MutableTransaction<T>where
T: Send,
impl<T> Sync for MutableTransaction<T>where
T: Sync,
impl<T> Unpin for MutableTransaction<T>where
T: Unpin,
impl<T> UnwindSafe for MutableTransaction<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more