Skip to main content

Transaction

Struct Transaction 

Source
pub struct Transaction(/* private fields */);
Expand description

A Zcash transaction, wrapping zcash_primitives::transaction::Transaction.

Implementations§

Source§

impl Transaction

Source

pub fn tx_version(&self) -> TxVersion

Returns the transaction version.

Source

pub fn version(&self) -> u32

Returns the numeric version of this transaction.

Source

pub fn is_overwintered(&self) -> bool

Returns true if this is an overwinter or later transaction.

Source

pub fn network_upgrade(&self) -> Option<NetworkUpgrade>

Get the network upgrade for this transaction, if any (V5+).

Source

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.

Source

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.

Source

pub fn lock_time(&self) -> Option<LockTime>

Get this transaction’s lock time.

Source

pub fn raw_lock_time(&self) -> u32

Get the raw lock time value as a u32.

Source

pub fn lock_time_is_time(&self) -> bool

Returns true if lock_time is a LockTime::Time and is not disabled by sequence numbers.

Source

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.

Source

pub fn version_group_id(&self) -> Option<u32>

Get the version group ID for this transaction, if any.

Source

pub fn inputs(&self) -> Vec<Input>

Get the transparent inputs, converted to Zebra types.

Source

pub fn outputs(&self) -> Vec<Output>

Get the transparent outputs, converted to Zebra types.

Source

pub fn has_transparent_inputs(&self) -> bool

Returns true if this transaction has transparent inputs.

Source

pub fn has_transparent_outputs(&self) -> bool

Returns true if this transaction has transparent outputs.

Source

pub fn has_transparent_inputs_or_outputs(&self) -> bool

Returns true if this transaction has transparent inputs or outputs.

Source

pub fn is_coinbase(&self) -> bool

Returns true if this is a coinbase transaction.

Source

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.

Source

pub fn spent_outpoints(&self) -> impl Iterator<Item = OutPoint> + '_

Returns the outpoints spent by this transaction’s transparent inputs.

Source

pub fn hash(&self) -> Hash

Compute the hash (txid) of this transaction.

Source

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).

Source

pub fn unmined_id(&self) -> UnminedTxId

Compute the unmined transaction ID for this transaction.

Source

pub fn joinsplit_count(&self) -> usize

Returns the number of JoinSplit descriptions in this transaction.

Source

pub fn has_sprout_joinsplit_data(&self) -> bool

Returns true if this transaction has Sprout JoinSplit data.

Source

pub fn sprout_joinsplit_descriptions( &self, ) -> impl Iterator<Item = &JsDescription> + '_

Iterate over the Sprout JoinSplit descriptions (librustzcash type).

Source

pub fn sprout_nullifiers(&self) -> impl Iterator<Item = Nullifier> + '_

Access the Sprout nullifiers in this transaction.

Source

pub fn sprout_note_commitments( &self, ) -> impl Iterator<Item = NoteCommitment> + '_

Access the Sprout note commitments in this transaction.

Source

pub fn output_values_to_sprout(&self) -> Vec<i64>

Returns vpub_old values (amounts entering the Sprout pool).

Source

pub fn input_values_from_sprout(&self) -> Vec<i64>

Returns vpub_new values (amounts leaving the Sprout pool).

Source

pub fn sprout_joinsplit_pub_key(&self) -> Option<VerificationKeyBytes>

Access the JoinSplit public validating key, if any.

Source

pub fn has_sapling_shielded_data(&self) -> bool

Returns true if this transaction has Sapling shielded data.

Source

pub fn sapling_nullifiers(&self) -> impl Iterator<Item = Nullifier> + '_

Access the Sapling nullifiers in this transaction.

Source

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.

Source

pub fn sapling_spends_count(&self) -> usize

Returns the number of Sapling spends.

Source

pub fn sapling_outputs( &self, ) -> impl Iterator<Item = &OutputDescription<GrothProofBytes>> + '_

Access the Sapling output descriptions (librustzcash type).

Source

pub fn sapling_note_commitments( &self, ) -> impl Iterator<Item = ExtractedNoteCommitment> + '_

Access the Sapling note commitments in this transaction.

Source

pub fn sapling_anchors(&self) -> Vec<Root>

Iterate over deduplicated Sapling anchors as zebra tree roots.

Source

pub fn sapling_value_balance(&self) -> ValueBalance<NegativeAllowed>

Get the Sapling value balance.

Source

pub fn has_orchard_shielded_data(&self) -> bool

Returns true if this transaction has Orchard shielded data.

Source

pub fn orchard_nullifiers(&self) -> impl Iterator<Item = Nullifier> + '_

Access the Orchard nullifiers in this transaction.

Source

pub fn orchard_actions( &self, ) -> impl Iterator<Item = &Action<<Authorized as Authorization>::SpendAuth>> + '_

Access the Orchard actions (librustzcash type).

Source

pub fn orchard_note_commitments( &self, ) -> impl Iterator<Item = ExtractedNoteCommitment> + '_

Access Orchard note commitments.

Source

pub fn orchard_flags(&self) -> Option<Flags>

Access the Orchard flags, if any.

Source

pub fn orchard_anchor(&self) -> Option<Root>

Access the Orchard anchor as a zebra tree root, if any.

Source

pub fn orchard_value_balance(&self) -> ValueBalance<NegativeAllowed>

Get the Orchard value balance.

Source

pub fn has_ironwood_shielded_data(&self) -> bool

Returns true if this transaction has an Ironwood bundle.

Source

pub fn ironwood_nullifiers(&self) -> impl Iterator<Item = Nullifier> + '_

Access the Ironwood nullifiers in this transaction.

Source

pub fn ironwood_actions( &self, ) -> impl Iterator<Item = &Action<<Authorized as Authorization>::SpendAuth>> + '_

Access the Ironwood actions (librustzcash type).

Source

pub fn ironwood_note_commitments( &self, ) -> impl Iterator<Item = ExtractedNoteCommitment> + '_

Access Ironwood note commitments.

Source

pub fn ironwood_flags(&self) -> Option<Flags>

Access the Ironwood flags, if any.

Source

pub fn ironwood_anchor(&self) -> Option<Root>

Access the Ironwood anchor as a zebra tree root, if any.

Source

pub fn has_enough_ironwood_flags(&self) -> bool

Returns true unless this transaction has an Ironwood bundle that enables neither spends nor outputs.

Source

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

Source

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.

Source

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.

Source

pub fn has_shielded_inputs(&self) -> bool

Returns true if this transaction has shielded inputs.

Source

pub fn has_shielded_outputs(&self) -> bool

Returns true if this transaction has shielded outputs.

Source

pub fn has_shielded_data(&self) -> bool

Does this transaction have shielded inputs or outputs?

Source

pub fn has_transparent_or_shielded_inputs(&self) -> bool

Returns true if this transaction has transparent or shielded inputs.

Source

pub fn has_transparent_or_shielded_outputs(&self) -> bool

Returns true if this transaction has transparent or shielded outputs.

Source

pub fn has_enough_orchard_flags(&self) -> bool

Returns true if the Orchard flags are consistent.

Source

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.

Source

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.

Source

pub fn value_balance( &self, utxos: &HashMap<OutPoint, Utxo>, ) -> Result<ValueBalance<NegativeAllowed>, ValueBalanceError>

Get the overall value balance for this transaction.

Source

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.

Methods from Deref<Target = TransactionData<Authorized>>§

Source

pub fn version(&self) -> TxVersion

Returns the transaction version.

Source

pub fn consensus_branch_id(&self) -> BranchId

Returns the Zcash epoch that this transaction can be mined in.

Source

pub fn lock_time(&self) -> u32

Source

pub fn expiry_height(&self) -> BlockHeight

Source

pub fn transparent_bundle( &self, ) -> Option<&Bundle<<A as Authorization>::TransparentAuth>>

Source

pub fn sprout_bundle(&self) -> Option<&Bundle>

Source

pub fn sapling_bundle( &self, ) -> Option<&Bundle<<A as Authorization>::SaplingAuth, ZatBalance>>

Source

pub fn orchard_bundle( &self, ) -> Option<&Bundle<<A as Authorization>::OrchardAuth, ZatBalance>>

Source

pub fn ironwood_bundle( &self, ) -> Option<&Bundle<<A as Authorization>::OrchardAuth, ZatBalance>>

Source

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.

Source

pub fn digest<D>(&self, digester: D) -> <D as TransactionDigest<A>>::Digest
where 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.

Source

pub fn sapling_value_balance(&self) -> ZatBalance

Trait Implementations§

Source§

impl Clone for Transaction

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Transaction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for Transaction

Source§

type Target = TransactionData<Authorized>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Display for Transaction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Transaction

Source§

impl From<&Transaction> for WtxId

Source§

fn from(transaction: &Transaction) -> Self

Computes the witnessed transaction ID for a transaction.

§Panics

If passed a pre-v5 transaction.

Source§

impl From<&Transaction> for Hash

Source§

fn from(transaction: &Transaction) -> Self

Converts to this type from the input type.
Source§

impl From<&Transaction> for UnminedTxId

Source§

fn from(transaction: &Transaction) -> Self

Converts to this type from the input type.
Source§

impl From<Transaction> for Hash

Source§

fn from(transaction: Transaction) -> Self

Converts to this type from the input type.
Source§

impl From<Transaction> for UnminedTxId

Source§

fn from(transaction: Transaction) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Transaction

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

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

Provides a loose upper bound on the size of the Vec<T: TrustedPreallocate> which can possibly be received from an honest peer.
Source§

impl TryFrom<&Transaction> for AuthDigest

Source§

fn try_from(transaction: &Transaction) -> Result<Self, Self::Error>

Computes the authorizing data commitment for a transaction.

Returns an error if passed a pre-V5 transaction (which has no auth digest).

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

impl ZcashDeserialize for Transaction

Source§

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 stored consensus_branch_id field will be wrong for transactions mined before Canopy. Use ZcashDeserializeWithContext<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

Source§

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

Source§

fn zcash_serialize<W: Write>(&self, writer: W) -> Result<(), Error>

Write self to the given writer using the canonical format. Read more
Source§

fn zcash_serialize_to_vec(&self) -> Result<Vec<u8>, Error>

Helper function to construct a vec to serialize the current struct into
Source§

fn zcash_serialized_size(&self) -> usize

Get the size of self by using a fake writer.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more