pub struct Transaction(pub(crate) Transaction);Expand description
A Zcash transaction, wrapping zcash_primitives::transaction::Transaction.
Tuple Fields§
§0: TransactionImplementations§
Source§impl Transaction
impl Transaction
Sourcepub fn v1_strategy(ledger_state: LedgerState) -> BoxedStrategy<Self>
pub fn v1_strategy(ledger_state: LedgerState) -> BoxedStrategy<Self>
Generate a proptest strategy for V1 Transactions
Sourcepub fn v2_strategy(ledger_state: LedgerState) -> BoxedStrategy<Self>
pub fn v2_strategy(ledger_state: LedgerState) -> BoxedStrategy<Self>
Generate a proptest strategy for V2 Transactions
Note: the new Transaction type doesn’t support arbitrary Sprout JoinSplit data in proptest strategies, so this generates transparent-only V2 transactions.
Sourcepub fn v3_strategy(ledger_state: LedgerState) -> BoxedStrategy<Self>
pub fn v3_strategy(ledger_state: LedgerState) -> BoxedStrategy<Self>
Generate a proptest strategy for V3 Transactions
Note: the new Transaction type doesn’t support arbitrary Sprout JoinSplit data in proptest strategies, so this generates transparent-only V3 transactions.
Sourcepub fn v4_strategy(ledger_state: LedgerState) -> BoxedStrategy<Self>
pub fn v4_strategy(ledger_state: LedgerState) -> BoxedStrategy<Self>
Generate a proptest strategy for V4 Transactions
Note: the new Transaction type doesn’t support arbitrary Sapling/Sprout shielded data in proptest strategies, so this generates transparent-only V4 transactions.
Sourcepub fn v5_strategy(ledger_state: LedgerState) -> BoxedStrategy<Self>
pub fn v5_strategy(ledger_state: LedgerState) -> BoxedStrategy<Self>
Generate a proptest strategy for V5 Transactions
Note: the new Transaction type doesn’t support arbitrary Sapling/Orchard shielded data in proptest strategies, so this generates transparent-only V5 transactions.
Sourcepub fn v6_strategy(ledger_state: LedgerState) -> BoxedStrategy<Self>
pub fn v6_strategy(ledger_state: LedgerState) -> BoxedStrategy<Self>
Generate a proptest strategy for V6 Transactions
Note: like Self::v5_strategy, the new Transaction type doesn’t support arbitrary
shielded data in proptest strategies, so this generates transparent-only V6 transactions.
Sourcepub fn vec_strategy(
ledger_state: LedgerState,
len: usize,
) -> BoxedStrategy<Vec<Arc<Self>>>
pub fn vec_strategy( ledger_state: LedgerState, len: usize, ) -> BoxedStrategy<Vec<Arc<Self>>>
Proptest Strategy for creating a Vector of transactions where the first transaction is always the only coinbase transaction
Sourcepub fn for_each_value_mut<F>(&mut self, f: F)
pub fn for_each_value_mut<F>(&mut self, f: F)
Apply f to the transparent output values in this transaction.
Note: Sprout/sapling/orchard value mutations are not supported with the new Transaction type (proptest strategies generate transparent-only txs).
Sourcepub fn for_each_value_balance_mut<F>(&mut self, _f: F)
pub fn for_each_value_balance_mut<F>(&mut self, _f: F)
Apply f to the sapling value balance and orchard value balance.
Note: Not implemented for the new Transaction type since proptest strategies generate transparent-only transactions. This is a no-op.
Sourcepub fn fix_overflow(&mut self)
pub fn fix_overflow(&mut self)
Fixup transparent values and shielded value balances, so that transaction and chain value pools won’t overflow MAX_MONEY.
These fixes are applied to coinbase and non-coinbase transactions.
Sourcepub fn fix_chain_value_pools(
&mut self,
chain_value_pools: ValueBalance<NonNegative>,
outputs: &HashMap<OutPoint, Output>,
) -> Result<(Amount<NonNegative>, ValueBalance<NonNegative>), ValueBalanceError>
pub fn fix_chain_value_pools( &mut self, chain_value_pools: ValueBalance<NonNegative>, outputs: &HashMap<OutPoint, Output>, ) -> Result<(Amount<NonNegative>, ValueBalance<NonNegative>), ValueBalanceError>
Fixup transparent values and shielded value balances, so that this transaction passes the “non-negative chain value pool” checks. (These checks use the sum of unspent outputs for each transparent and shielded pool.)
These fixes are applied to coinbase and non-coinbase transactions.
chain_value_pools contains the chain value pool balances,
as of the previous transaction in this block
(or the last transaction in the previous block).
outputs must contain all the transparent::Outputs spent in this transaction.
Currently, these fixes almost always leave some remaining value in each transparent and shielded chain value pool.
Before fixing the chain value balances, this method calls fix_overflow
to make sure that transaction and chain value pools don’t overflow MAX_MONEY.
After fixing the chain value balances, this method calls fix_remaining_value
to fix the remaining value in the transaction value pool.
Returns the remaining transaction value, and the updated chain value balances.
§Panics
If any spent transparent::Output is missing from
transparent::OutPoints.
Sourcefn input_value_pool(
&self,
outputs: &HashMap<OutPoint, Output>,
) -> Result<Amount<NonNegative>, ValueBalanceError>
fn input_value_pool( &self, outputs: &HashMap<OutPoint, Output>, ) -> Result<Amount<NonNegative>, ValueBalanceError>
Returns the total input value of this transaction’s value pool.
This is the sum of transparent inputs, sprout input values, and if positive, the sapling, orchard, and ironwood value balances.
outputs must contain all the transparent::Outputs spent in this transaction.
Sourcepub fn fix_remaining_value(
&mut self,
outputs: &HashMap<OutPoint, Output>,
) -> Result<Amount<NonNegative>, ValueBalanceError>
pub fn fix_remaining_value( &mut self, outputs: &HashMap<OutPoint, Output>, ) -> Result<Amount<NonNegative>, ValueBalanceError>
Fixup non-coinbase transparent values and shielded value balances, so that this transaction passes the “non-negative remaining transaction value” check. (This check uses the sum of inputs minus outputs.)
Returns the remaining transaction value.
outputs must contain all the transparent::Outputs spent in this transaction.
Currently, these fixes almost always leave some remaining value in the transaction value pool.
§Panics
If any spent transparent::Output is missing from
transparent::OutPoints.
Source§impl Transaction
impl Transaction
Sourcepub(crate) fn inner(&self) -> &Transaction
pub(crate) fn inner(&self) -> &Transaction
Access the inner zcash_primitives::transaction::Transaction.
Sourcepub fn tx_version(&self) -> TxVersion
pub fn tx_version(&self) -> TxVersion
Returns the transaction version.
Sourcepub fn is_overwintered(&self) -> bool
pub fn is_overwintered(&self) -> bool
Returns true if this is an overwinter or later transaction.
Sourcepub fn network_upgrade(&self) -> Option<NetworkUpgrade>
pub fn network_upgrade(&self) -> Option<NetworkUpgrade>
Get the network upgrade for this transaction, if any (V5+).
Sourcepub fn sighash(
&self,
network_upgrade: NetworkUpgrade,
hash_type: HashType,
all_previous_outputs: Arc<Vec<Output>>,
input_index_script_code: Option<(usize, Vec<u8>)>,
) -> Result<SigHash, Error>
pub fn sighash( &self, network_upgrade: NetworkUpgrade, hash_type: HashType, all_previous_outputs: Arc<Vec<Output>>, input_index_script_code: Option<(usize, Vec<u8>)>, ) -> Result<SigHash, Error>
Compute the sighash for this transaction.
Returns an error if network_upgrade doesn’t match the transaction’s consensus branch ID.
Sourcepub fn sighasher(
&self,
network_upgrade: NetworkUpgrade,
all_previous_outputs: Arc<Vec<Output>>,
) -> Result<SigHasher, Error>
pub fn sighasher( &self, network_upgrade: NetworkUpgrade, all_previous_outputs: Arc<Vec<Output>>, ) -> Result<SigHasher, Error>
Returns a SigHasher for this transaction.
Returns an error if network_upgrade doesn’t match the transaction’s consensus branch ID.
Sourcepub fn raw_lock_time(&self) -> u32
pub fn raw_lock_time(&self) -> u32
Get the raw lock time value as a u32.
Sourcepub fn lock_time_is_time(&self) -> bool
pub fn lock_time_is_time(&self) -> bool
Returns true if lock_time is a LockTime::Time and is not disabled by sequence numbers.
Sourcepub fn expiry_height(&self) -> Option<Height>
pub fn expiry_height(&self) -> Option<Height>
Get the expiry height for this transaction, if any (V3+).
Returns None if the transaction is Sprout, or if nExpiryHeight == 0
(which means “no expiry” per the Zcash protocol spec).
Returns the raw wire value, which can exceed block::Height::MAX: the ZIP-203
maximum of 499,999,999 is a verifier rule, not a limit of this accessor, so an
out-of-range value must reach the verifier to be rejected.
Sourcepub fn version_group_id(&self) -> Option<u32>
pub fn version_group_id(&self) -> Option<u32>
Get the version group ID for this transaction, if any.
Sourcepub fn has_transparent_inputs(&self) -> bool
pub fn has_transparent_inputs(&self) -> bool
Returns true if this transaction has transparent inputs.
Sourcepub fn has_transparent_outputs(&self) -> bool
pub fn has_transparent_outputs(&self) -> bool
Returns true if this transaction has transparent outputs.
Sourcepub fn has_transparent_inputs_or_outputs(&self) -> bool
pub fn has_transparent_inputs_or_outputs(&self) -> bool
Returns true if this transaction has transparent inputs or outputs.
Sourcepub fn is_coinbase(&self) -> bool
pub fn is_coinbase(&self) -> bool
Returns true if this is a coinbase transaction.
Sourcepub fn is_valid_non_coinbase(&self) -> bool
pub fn is_valid_non_coinbase(&self) -> bool
Returns true if this transaction has valid inputs for a non-coinbase
transaction, that is, none of its transparent inputs has a null prevout.
§Consensus
A transparent input in a non-coinbase transaction MUST NOT have a null prevout.
https://zips.z.cash/protocol/protocol.pdf#txnconsensus
Note that a transaction can return false from both Transaction::is_coinbase and
this method, for example a transaction with a null-prevout input alongside other
inputs. Such transactions are rejected by the verifier.
Sourcepub fn spent_outpoints(&self) -> impl Iterator<Item = OutPoint> + '_
pub fn spent_outpoints(&self) -> impl Iterator<Item = OutPoint> + '_
Returns the outpoints spent by this transaction’s transparent inputs.
Sourcepub fn auth_digest(&self) -> Option<AuthDigest>
pub fn auth_digest(&self) -> Option<AuthDigest>
Compute the authorizing data commitment for this transaction.
Returns None for pre-V5 transactions (which don’t have auth digests).
Sourcepub fn unmined_id(&self) -> UnminedTxId
pub fn unmined_id(&self) -> UnminedTxId
Compute the unmined transaction ID for this transaction.
Sourcepub fn joinsplit_count(&self) -> usize
pub fn joinsplit_count(&self) -> usize
Returns the number of JoinSplit descriptions in this transaction.
Sourcepub fn has_sprout_joinsplit_data(&self) -> bool
pub fn has_sprout_joinsplit_data(&self) -> bool
Returns true if this transaction has Sprout JoinSplit data.
Sourcepub fn sprout_joinsplit_descriptions(
&self,
) -> impl Iterator<Item = &JsDescription> + '_
pub fn sprout_joinsplit_descriptions( &self, ) -> impl Iterator<Item = &JsDescription> + '_
Iterate over the Sprout JoinSplit descriptions (librustzcash type).
Sourcepub fn sprout_nullifiers(&self) -> impl Iterator<Item = Nullifier> + '_
pub fn sprout_nullifiers(&self) -> impl Iterator<Item = Nullifier> + '_
Access the Sprout nullifiers in this transaction.
Sourcepub fn sprout_note_commitments(
&self,
) -> impl Iterator<Item = NoteCommitment> + '_
pub fn sprout_note_commitments( &self, ) -> impl Iterator<Item = NoteCommitment> + '_
Access the Sprout note commitments in this transaction.
Sourcepub fn output_values_to_sprout(&self) -> Vec<i64>
pub fn output_values_to_sprout(&self) -> Vec<i64>
Returns vpub_old values (amounts entering the Sprout pool).
Sourcepub fn input_values_from_sprout(&self) -> Vec<i64>
pub fn input_values_from_sprout(&self) -> Vec<i64>
Returns vpub_new values (amounts leaving the Sprout pool).
Sourcepub fn sprout_joinsplit_pub_key(&self) -> Option<VerificationKeyBytes>
pub fn sprout_joinsplit_pub_key(&self) -> Option<VerificationKeyBytes>
Access the JoinSplit public validating key, if any.
Sourcepub fn has_sapling_shielded_data(&self) -> bool
pub fn has_sapling_shielded_data(&self) -> bool
Returns true if this transaction has Sapling shielded data.
Sourcepub fn sapling_nullifiers(&self) -> impl Iterator<Item = Nullifier> + '_
pub fn sapling_nullifiers(&self) -> impl Iterator<Item = Nullifier> + '_
Access the Sapling nullifiers in this transaction.
Sourcepub fn sapling_spends(
&self,
) -> impl Iterator<Item = &SpendDescription<Authorized>> + '_
pub fn sapling_spends( &self, ) -> impl Iterator<Item = &SpendDescription<Authorized>> + '_
Access the Sapling spend descriptions (librustzcash type).
The spend description type uses GrothProofBytes for proofs and
redjubjub::Signature<SpendAuth> for auth sigs.
Sourcepub fn sapling_spends_count(&self) -> usize
pub fn sapling_spends_count(&self) -> usize
Returns the number of Sapling spends.
Sourcepub fn sapling_outputs(
&self,
) -> impl Iterator<Item = &OutputDescription<GrothProofBytes>> + '_
pub fn sapling_outputs( &self, ) -> impl Iterator<Item = &OutputDescription<GrothProofBytes>> + '_
Access the Sapling output descriptions (librustzcash type).
Sourcepub fn sapling_note_commitments(
&self,
) -> impl Iterator<Item = ExtractedNoteCommitment> + '_
pub fn sapling_note_commitments( &self, ) -> impl Iterator<Item = ExtractedNoteCommitment> + '_
Access the Sapling note commitments in this transaction.
Sourcepub fn sapling_anchors(&self) -> Vec<Root>
pub fn sapling_anchors(&self) -> Vec<Root>
Iterate over deduplicated Sapling anchors as zebra tree roots.
Sourcepub fn sapling_value_balance(&self) -> ValueBalance<NegativeAllowed>
pub fn sapling_value_balance(&self) -> ValueBalance<NegativeAllowed>
Get the Sapling value balance.
Sourcepub fn has_orchard_shielded_data(&self) -> bool
pub fn has_orchard_shielded_data(&self) -> bool
Returns true if this transaction has Orchard shielded data.
Sourcepub fn orchard_nullifiers(&self) -> impl Iterator<Item = Nullifier> + '_
pub fn orchard_nullifiers(&self) -> impl Iterator<Item = Nullifier> + '_
Access the Orchard nullifiers in this transaction.
Sourcepub fn orchard_actions(
&self,
) -> impl Iterator<Item = &Action<<Authorized as Authorization>::SpendAuth>> + '_
pub fn orchard_actions( &self, ) -> impl Iterator<Item = &Action<<Authorized as Authorization>::SpendAuth>> + '_
Access the Orchard actions (librustzcash type).
Sourcepub fn orchard_note_commitments(
&self,
) -> impl Iterator<Item = ExtractedNoteCommitment> + '_
pub fn orchard_note_commitments( &self, ) -> impl Iterator<Item = ExtractedNoteCommitment> + '_
Access Orchard note commitments.
Sourcepub fn orchard_flags(&self) -> Option<Flags>
pub fn orchard_flags(&self) -> Option<Flags>
Access the Orchard flags, if any.
Sourcepub fn orchard_anchor(&self) -> Option<Root>
pub fn orchard_anchor(&self) -> Option<Root>
Access the Orchard anchor as a zebra tree root, if any.
Sourcepub fn orchard_value_balance(&self) -> ValueBalance<NegativeAllowed>
pub fn orchard_value_balance(&self) -> ValueBalance<NegativeAllowed>
Get the Orchard value balance.
Sourcepub fn has_ironwood_shielded_data(&self) -> bool
pub fn has_ironwood_shielded_data(&self) -> bool
Returns true if this transaction has an Ironwood bundle.
Sourcepub fn ironwood_nullifiers(&self) -> impl Iterator<Item = Nullifier> + '_
pub fn ironwood_nullifiers(&self) -> impl Iterator<Item = Nullifier> + '_
Access the Ironwood nullifiers in this transaction.
Sourcepub fn ironwood_actions(
&self,
) -> impl Iterator<Item = &Action<<Authorized as Authorization>::SpendAuth>> + '_
pub fn ironwood_actions( &self, ) -> impl Iterator<Item = &Action<<Authorized as Authorization>::SpendAuth>> + '_
Access the Ironwood actions (librustzcash type).
Sourcepub fn ironwood_note_commitments(
&self,
) -> impl Iterator<Item = ExtractedNoteCommitment> + '_
pub fn ironwood_note_commitments( &self, ) -> impl Iterator<Item = ExtractedNoteCommitment> + '_
Access Ironwood note commitments.
Sourcepub fn ironwood_flags(&self) -> Option<Flags>
pub fn ironwood_flags(&self) -> Option<Flags>
Access the Ironwood flags, if any.
Sourcepub fn ironwood_anchor(&self) -> Option<Root>
pub fn ironwood_anchor(&self) -> Option<Root>
Access the Ironwood anchor as a zebra tree root, if any.
Sourcepub fn has_enough_ironwood_flags(&self) -> bool
pub fn has_enough_ironwood_flags(&self) -> bool
Returns true unless this transaction has an Ironwood bundle that enables neither
spends nor outputs.
Sourcepub fn ironwood_value_balance(&self) -> ValueBalance<NegativeAllowed>
pub fn ironwood_value_balance(&self) -> ValueBalance<NegativeAllowed>
Get the Ironwood value balance.
Positive values are added to this transaction’s value pool, and removed from the Ironwood chain value pool. Negative values are removed from this transaction, and added to the Ironwood pool. This is zero for transactions without an Ironwood bundle.
https://zebra.zfnd.org/dev/rfcs/0012-value-pools.html#definitions
Sourcepub fn orchard_proof_size_is_canonical(&self) -> bool
pub fn orchard_proof_size_is_canonical(&self) -> bool
Returns true if the Orchard bundle’s Halo2 proof has the canonical size for its
action count, or if there is no Orchard bundle.
A proof that is present but not canonically sized can be padded with arbitrary trailing data without affecting its validity (GHSA-jfw5-j458-pfv6). Bundles are deserialized leniently, so this is checked by the verifier rather than during parsing.
Sourcepub fn ironwood_proof_size_is_canonical(&self) -> bool
pub fn ironwood_proof_size_is_canonical(&self) -> bool
Returns true if the Ironwood bundle’s Halo2 proof has the canonical size for its
action count, or if there is no Ironwood bundle.
See Self::orchard_proof_size_is_canonical; Ironwood reuses the Orchard circuit, so it
has the same expected proof size.
Sourcepub fn has_shielded_inputs(&self) -> bool
pub fn has_shielded_inputs(&self) -> bool
Returns true if this transaction has shielded inputs.
Sourcepub fn has_shielded_outputs(&self) -> bool
pub fn has_shielded_outputs(&self) -> bool
Returns true if this transaction has shielded outputs.
Sourcepub fn has_shielded_data(&self) -> bool
pub fn has_shielded_data(&self) -> bool
Does this transaction have shielded inputs or outputs?
Sourcepub fn has_transparent_or_shielded_inputs(&self) -> bool
pub fn has_transparent_or_shielded_inputs(&self) -> bool
Returns true if this transaction has transparent or shielded inputs.
Sourcepub fn has_transparent_or_shielded_outputs(&self) -> bool
pub fn has_transparent_or_shielded_outputs(&self) -> bool
Returns true if this transaction has transparent or shielded outputs.
Sourcepub fn has_enough_orchard_flags(&self) -> bool
pub fn has_enough_orchard_flags(&self) -> bool
Returns true if the Orchard flags are consistent.
Sourcepub fn transparent_value_balance_from_outputs(
&self,
outputs: &HashMap<OutPoint, Output>,
) -> Result<ValueBalance<NegativeAllowed>, ValueBalanceError>
pub fn transparent_value_balance_from_outputs( &self, outputs: &HashMap<OutPoint, Output>, ) -> Result<ValueBalance<NegativeAllowed>, ValueBalanceError>
Return the transparent value balance, the change in the transaction value pool due to transparent inputs and outputs.
Sourcepub fn sprout_value_balance(
&self,
) -> Result<ValueBalance<NegativeAllowed>, ValueBalanceError>
pub fn sprout_value_balance( &self, ) -> Result<ValueBalance<NegativeAllowed>, ValueBalanceError>
Return the sprout value balance.
Errors when the aggregate JoinSplit value balance (or any prefix of it, matching the
pre-refactor fold) leaves the valid monetary range. Aggregated here because
zcash_primitives collapses that case to None, conflating it with “no Sprout
bundle”. The net-sum bound matches zcashd from Canopy onward, where vpub_old is
always zero; pre-Canopy heights are checkpointed.
Sourcepub fn value_balance(
&self,
utxos: &HashMap<OutPoint, Utxo>,
) -> Result<ValueBalance<NegativeAllowed>, ValueBalanceError>
pub fn value_balance( &self, utxos: &HashMap<OutPoint, Utxo>, ) -> Result<ValueBalance<NegativeAllowed>, ValueBalanceError>
Get the overall value balance for this transaction.
Sourcepub fn coinbase_spend_restriction(
&self,
network: &Network,
spend_height: Height,
) -> CoinbaseSpendRestriction
pub fn coinbase_spend_restriction( &self, network: &Network, spend_height: Height, ) -> CoinbaseSpendRestriction
Returns the transparent::CoinbaseSpendRestriction for this transaction,
assuming it is mined at spend_height.
Source§impl Transaction
impl Transaction
Sourcepub fn test_v1(
inputs: Vec<Input>,
outputs: Vec<Output>,
lock_time: LockTime,
) -> Self
pub fn test_v1( inputs: Vec<Input>, outputs: Vec<Output>, lock_time: LockTime, ) -> Self
Build a V1 transaction from transparent components. Used in tests.
Sourcepub fn test_v2(
inputs: Vec<Input>,
outputs: Vec<Output>,
lock_time: LockTime,
) -> Self
pub fn test_v2( inputs: Vec<Input>, outputs: Vec<Output>, lock_time: LockTime, ) -> Self
Build a V2 transaction from transparent components. Used in tests.
Sourcepub fn test_v3(
inputs: Vec<Input>,
outputs: Vec<Output>,
lock_time: LockTime,
expiry_height: Height,
) -> Self
pub fn test_v3( inputs: Vec<Input>, outputs: Vec<Output>, lock_time: LockTime, expiry_height: Height, ) -> Self
Build a V3 (Overwinter) transaction from transparent components. Used in tests.
Sourcepub fn test_v4(
inputs: Vec<Input>,
outputs: Vec<Output>,
lock_time: LockTime,
expiry_height: Height,
) -> Self
pub fn test_v4( inputs: Vec<Input>, outputs: Vec<Output>, lock_time: LockTime, expiry_height: Height, ) -> Self
Build a V4 (Sapling) transaction from transparent components. Used in tests.
Sourcepub fn test_v5(
network_upgrade: NetworkUpgrade,
inputs: Vec<Input>,
outputs: Vec<Output>,
lock_time: LockTime,
expiry_height: Height,
) -> Self
pub fn test_v5( network_upgrade: NetworkUpgrade, inputs: Vec<Input>, outputs: Vec<Output>, lock_time: LockTime, expiry_height: Height, ) -> Self
Build a V5 (NU5) transaction from transparent components. Used in tests.
Sourcepub fn test_v6(
network_upgrade: NetworkUpgrade,
inputs: Vec<Input>,
outputs: Vec<Output>,
lock_time: LockTime,
expiry_height: Height,
) -> Self
pub fn test_v6( network_upgrade: NetworkUpgrade, inputs: Vec<Input>, outputs: Vec<Output>, lock_time: LockTime, expiry_height: Height, ) -> Self
Build a transparent-only V6 transaction, for tests.
fn build_transparent( version: TxVersion, branch_id: BranchId, lock_time: u32, expiry_height: BlockHeight, inputs: Vec<Input>, outputs: Vec<Output>, ) -> Self
Sourcepub fn test_v5_with_orchard(
network_upgrade: NetworkUpgrade,
inputs: Vec<Input>,
outputs: Vec<Output>,
lock_time: LockTime,
expiry_height: Height,
orchard_bundle: Option<Bundle<Authorized, ZatBalance>>,
) -> Self
pub fn test_v5_with_orchard( network_upgrade: NetworkUpgrade, inputs: Vec<Input>, outputs: Vec<Output>, lock_time: LockTime, expiry_height: Height, orchard_bundle: Option<Bundle<Authorized, ZatBalance>>, ) -> Self
Build a V5 transaction with an Orchard bundle, for tests.
The bundle must have been constructed for [orchard::bundle::BundleVersion::orchard_v2]
or [orchard::bundle::BundleVersion::orchard_v3], matching network_upgrade.
Sourcepub fn test_v6_with_bundles(
network_upgrade: NetworkUpgrade,
inputs: Vec<Input>,
outputs: Vec<Output>,
lock_time: LockTime,
expiry_height: Height,
orchard_bundle: Option<Bundle<Authorized, ZatBalance>>,
ironwood_bundle: Option<Bundle<Authorized, ZatBalance>>,
) -> Self
pub fn test_v6_with_bundles( network_upgrade: NetworkUpgrade, inputs: Vec<Input>, outputs: Vec<Output>, lock_time: LockTime, expiry_height: Height, orchard_bundle: Option<Bundle<Authorized, ZatBalance>>, ironwood_bundle: Option<Bundle<Authorized, ZatBalance>>, ) -> Self
Build a V6 transaction with Orchard and Ironwood bundles, for tests.
orchard_bundle must have been constructed for
[orchard::bundle::BundleVersion::orchard_v3] and ironwood_bundle for
[orchard::bundle::BundleVersion::ironwood_v3]; the two slots are not interchangeable.
Sourcefn transparent_bundle_from(
inputs: Vec<Input>,
outputs: Vec<Output>,
) -> Option<Bundle<Authorized>>
fn transparent_bundle_from( inputs: Vec<Input>, outputs: Vec<Output>, ) -> Option<Bundle<Authorized>>
Converts Zebra transparent inputs and outputs into a librustzcash bundle,
returning None if both are empty.
Sourcepub fn with_transparent_inputs(self, inputs: Vec<Input>) -> Self
pub fn with_transparent_inputs(self, inputs: Vec<Input>) -> Self
Rebuild this transaction with new transparent inputs.
Sourcepub fn with_transparent_outputs(self, outputs: Vec<Output>) -> Self
pub fn with_transparent_outputs(self, outputs: Vec<Output>) -> Self
Rebuild this transaction with new transparent outputs.
fn rebuild_with_transparent( self, transparent_bundle: Option<Bundle<Authorized>>, ) -> Self
Sourcepub fn set_expiry_height(&mut self, height: Height)
pub fn set_expiry_height(&mut self, height: Height)
Rebuild this transaction with a different expiry height (recomputes txid).
Sourcepub fn set_network_upgrade(&mut self, nu: NetworkUpgrade)
pub fn set_network_upgrade(&mut self, nu: NetworkUpgrade)
Rebuild this transaction with a different network upgrade / branch ID (recomputes txid).
Sourcepub fn set_outputs(&mut self, outputs: Vec<Output>)
pub fn set_outputs(&mut self, outputs: Vec<Output>)
Replace all transparent outputs (recomputes txid).
Sourcepub fn with_orchard_bundle(
self,
bundle: Option<Bundle<Authorized, ZatBalance>>,
) -> Self
pub fn with_orchard_bundle( self, bundle: Option<Bundle<Authorized, ZatBalance>>, ) -> Self
Rebuild this transaction with a replaced Orchard bundle (recomputes txid).
Test helper for synthesizing transactions with malformed orchard data (e.g. duplicated actions) that would otherwise be unreachable through normal construction paths.
Sourcepub fn test_v4_with_joinsplit_data(
joinsplit_data: Option<&JoinSplitData<Groth16Proof>>,
) -> Self
pub fn test_v4_with_joinsplit_data( joinsplit_data: Option<&JoinSplitData<Groth16Proof>>, ) -> Self
Build a V4 transaction with optional JoinSplit data via byte-level serialization.
Transparent inputs/outputs and sapling shielded data are empty. Used by tests that need V4 transactions with sprout data.
Methods from Deref<Target = TransactionData<Authorized>>§
pub fn consensus_branch_id(&self) -> BranchId
pub fn consensus_branch_id(&self) -> BranchId
Returns the Zcash epoch that this transaction can be mined in.
pub fn lock_time(&self) -> u32
pub fn expiry_height(&self) -> BlockHeight
pub fn transparent_bundle( &self, ) -> Option<&Bundle<<A as Authorization>::TransparentAuth>>
pub fn sprout_bundle(&self) -> Option<&Bundle>
pub fn sapling_bundle( &self, ) -> Option<&Bundle<<A as Authorization>::SaplingAuth, ZatBalance>>
pub fn orchard_bundle( &self, ) -> Option<&Bundle<<A as Authorization>::OrchardAuth, ZatBalance>>
pub fn ironwood_bundle( &self, ) -> Option<&Bundle<<A as Authorization>::OrchardAuth, ZatBalance>>
pub fn fee_paid<E, F>(&self, get_prevout: F) -> Result<Option<Zatoshis>, E>
pub fn fee_paid<E, F>(&self, get_prevout: F) -> Result<Option<Zatoshis>, E>
Returns the total fees paid by the transaction, given a function that can be used to retrieve the value of previous transactions’ transparent outputs that are being spent in this transaction.
pub fn digest<D>(&self, digester: D) -> <D as TransactionDigest<A>>::Digestwhere
D: TransactionDigest<A>,
pub fn digest<D>(&self, digester: D) -> <D as TransactionDigest<A>>::Digestwhere
D: TransactionDigest<A>,
Computes this transaction’s digest using the provided digest strategy.
Version 6 transactions include the Ironwood bundle digest as a separate Orchard-shaped digest with Ironwood personalization. Earlier transaction versions do not include Ironwood in their digest.
pub fn sapling_value_balance(&self) -> ZatBalance
Trait Implementations§
Source§impl Arbitrary for Transaction
impl Arbitrary for Transaction
Source§type Parameters = LedgerState
type Parameters = LedgerState
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = BoxedStrategy<Transaction>
type Strategy = BoxedStrategy<Transaction>
Strategy used to generate values of type Self.Source§fn arbitrary_with(ledger_state: Self::Parameters) -> Self::Strategy
fn arbitrary_with(ledger_state: Self::Parameters) -> Self::Strategy
Source§impl Clone for Transaction
impl Clone for Transaction
Source§impl Debug for Transaction
impl Debug for Transaction
Source§impl Deref for Transaction
impl Deref for Transaction
Source§impl Display for Transaction
impl Display for Transaction
impl Eq for Transaction
Source§impl From<&Transaction> for WtxId
impl From<&Transaction> for WtxId
Source§fn from(transaction: &Transaction) -> Self
fn from(transaction: &Transaction) -> Self
Source§impl From<&Transaction> for Hash
impl From<&Transaction> for Hash
Source§fn from(transaction: &Transaction) -> Self
fn from(transaction: &Transaction) -> Self
Source§impl From<&Transaction> for UnminedTxId
impl From<&Transaction> for UnminedTxId
Source§fn from(transaction: &Transaction) -> Self
fn from(transaction: &Transaction) -> Self
Source§impl From<Transaction> for Hash
impl From<Transaction> for Hash
Source§fn from(transaction: Transaction) -> Self
fn from(transaction: Transaction) -> Self
Source§impl From<Transaction> for UnminedTxId
impl From<Transaction> for UnminedTxId
Source§fn from(transaction: Transaction) -> Self
fn from(transaction: Transaction) -> Self
Source§impl PartialEq for Transaction
impl PartialEq for Transaction
Source§impl Serialize for Transaction
Available on crate features elasticsearch or proptest-impl only.
impl Serialize for Transaction
elasticsearch or proptest-impl only.Source§impl TrustedPreallocate for Transaction
No valid Zcash message contains more transactions than can fit in a single block
impl TrustedPreallocate for Transaction
No valid Zcash message contains more transactions than can fit in a single block
tx messages contain a single transaction, and block messages are limited to the maximum
block size.
Source§fn max_allocation() -> u64
fn max_allocation() -> u64
Vec<T: TrustedPreallocate>
which can possibly be received from an honest peer.Source§impl TryFrom<&Transaction> for AuthDigest
impl TryFrom<&Transaction> for AuthDigest
Source§impl ZcashDeserialize for Transaction
impl ZcashDeserialize for Transaction
Source§fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
Deserialize a transaction without network context.
§Branch ID handling
- V5+ transactions: the consensus branch ID is read from the wire. Correct.
- V1-V4 transactions: the branch ID is NOT on the wire, so a default
(
BranchId::Canopy) is stored. This does not affect parsing or txid computation, but the storedconsensus_branch_idfield will be wrong for transactions mined before Canopy. UseZcashDeserializeWithContext<BranchId>when the correct branch ID is known.
§Callers
Prefer ZcashDeserializeWithContext<BranchId> when the correct branch ID is
known. This context-free impl exists for:
- Block deserialization (branch ID is corrected afterward)
- Network message parsing and RPC (transactions are re-validated with the correct branch ID before sighash computation)
Source§impl ZcashDeserializeWithContext<BranchId> for Transaction
impl ZcashDeserializeWithContext<BranchId> for Transaction
Source§fn zcash_deserialize_with_context<R: Read>(
reader: R,
branch_id: &BranchId,
) -> Result<Self, SerializationError>
fn zcash_deserialize_with_context<R: Read>( reader: R, branch_id: &BranchId, ) -> Result<Self, SerializationError>
Deserialize a transaction with a known consensus branch ID.
Runs the same parse-time consensus checks as
Transaction::zcash_deserialize.
Source§impl ZcashSerialize for Transaction
impl ZcashSerialize for Transaction
Source§fn zcash_serialize_to_vec(&self) -> Result<Vec<u8>, Error>
fn zcash_serialize_to_vec(&self) -> Result<Vec<u8>, Error>
Source§fn zcash_serialized_size(&self) -> usize
fn zcash_serialized_size(&self) -> usize
self by using a fake writer.Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
impl UnwindSafe for Transaction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreimpl<T> MaybeSendSync for T
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<Response, Error> ResponseResult<Response, Error> for Response
impl<Response, Error> ResponseResult<Response, Error> for Response
Source§fn into_result(self) -> Result<Response, Error>
fn into_result(self) -> Result<Response, Error>
Result that can be sent as a response.Source§impl<T> SectionExt for T
impl<T> SectionExt for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 2760 bytes