Skip to main content

L2BlockHeader

Struct L2BlockHeader 

Source
pub struct L2BlockHeader {
Show 33 fields pub version: u16, pub height: u64, pub epoch: u64, pub parent_hash: Bytes32, pub state_root: Bytes32, pub spends_root: Bytes32, pub additions_root: Bytes32, pub removals_root: Bytes32, pub receipts_root: Bytes32, pub l1_height: u32, pub l1_hash: Bytes32, pub timestamp: u64, pub proposer_index: u32, pub spend_bundle_count: u32, pub total_cost: Cost, pub total_fees: u64, pub additions_count: u32, pub removals_count: u32, pub block_size: u32, pub filter_hash: Bytes32, pub extension_data: Bytes32, pub l1_collateral_coin_id: Option<Bytes32>, pub l1_reserve_coin_id: Option<Bytes32>, pub l1_prev_epoch_finalizer_coin_id: Option<Bytes32>, pub l1_curr_epoch_finalizer_coin_id: Option<Bytes32>, pub l1_network_coin_id: Option<Bytes32>, pub slash_proposal_count: u32, pub slash_proposals_root: Bytes32, pub collateral_registry_root: Bytes32, pub cid_state_root: Bytes32, pub node_registry_root: Bytes32, pub namespace_update_root: Bytes32, pub dfsp_finalize_commitment_root: Bytes32,
}
Expand description

DIG L2 block header: identity, Merkle commitments, L1 anchor, metadata, optional L1 proofs, slash proposal commitments, and DFSP data-layer roots.

Field layout and semantics follow SPEC §2.2 table Field groups; keep this definition in sync with that section when the wire format evolves.

Fields§

§version: u16

Protocol version (VERSION_V1 / VERSION_V2; BLK-007 selects from height).

§height: u64

Block height (genesis = 0).

§epoch: u64

Epoch number.

§parent_hash: Bytes32

Hash of the parent block header.

§state_root: Bytes32

CoinSet / state Merkle root after this block.

§spends_root: Bytes32

Merkle root of spend-bundle hashes.

§additions_root: Bytes32

Merkle root of additions (Chia-style grouping by puzzle_hash).

§removals_root: Bytes32

Merkle root of removed coin IDs.

§receipts_root: Bytes32

Merkle root of execution receipts.

§l1_height: u32

Chia L1 block height this L2 block references.

§l1_hash: Bytes32

Chia L1 block hash.

§timestamp: u64

Unix timestamp (seconds).

§proposer_index: u32

Proposer validator index.

§spend_bundle_count: u32

Number of spend bundles in the block body.

§total_cost: Cost

Aggregate CLVM cost of all spends in the block.

§total_fees: u64

Total fees (value in − value out).

§additions_count: u32

Number of coin additions.

§removals_count: u32

Number of coin removals.

§block_size: u32

Serialized full block size in bytes (header + body).

§filter_hash: Bytes32

BIP158-style compact block filter hash.

§extension_data: Bytes32

Reserved extension field (SPEC: default ZERO_HASH in constructors).

§l1_collateral_coin_id: Option<Bytes32>

Proposer L1 collateral proof coin id.

§l1_reserve_coin_id: Option<Bytes32>

Network validator collateral set anchor.

§l1_prev_epoch_finalizer_coin_id: Option<Bytes32>

Previous epoch finalization proof.

§l1_curr_epoch_finalizer_coin_id: Option<Bytes32>

Current epoch finalizer state.

§l1_network_coin_id: Option<Bytes32>

Network singleton existence proof.

§slash_proposal_count: u32

Number of slash proposal payloads in the body.

§slash_proposals_root: Bytes32

Merkle root over per-proposal hashes.

§collateral_registry_root: Bytes32

Collateral registry sparse Merkle root.

§cid_state_root: Bytes32

CID lifecycle state machine root.

§node_registry_root: Bytes32

Node registry sparse Merkle root.

§namespace_update_root: Bytes32

Namespace update delta root for this block.

§dfsp_finalize_commitment_root: Bytes32

DFSP epoch-boundary commitment digest.

Implementations§

Source§

impl L2BlockHeader

Source

pub const HASH_PREIMAGE_LEN: usize = 710

Byte length of the fixed preimage fed to Self::hash (all 33 rows of SPEC §3.1).

Accounting: 20×Bytes32 fields + u16 + 6×u64 + 7×u32 = 640 + 70 = 710 bytes. The SPEC prose once said “626 bytes”; summing the §3.1 table yields 710 — this constant is authoritative for code.

Source

pub fn protocol_version_for_height_with_activation( height: u64, dfsp_activation_height: u64, ) -> u16

Protocol version for height given an explicit DFSP activation height (BLK-007).

Rules: If dfsp_activation_height == u64::MAX (DFSP disabled sentinel), returns VERSION_V1. Otherwise returns VERSION_V2 when height >= dfsp_activation_height, else VERSION_V1.

Rationale: Parameterizing activation height lets tests cover pre/post-fork behavior without recompiling DFSP_ACTIVATION_HEIGHT. Production code should call Self::protocol_version_for_height instead.

Source

pub fn protocol_version_for_height(height: u64) -> u16

Protocol version for height using the crate’s DFSP_ACTIVATION_HEIGHT constant.

Source

pub fn validate_with_dfsp_activation_at_unix( &self, dfsp_activation_height: u64, now_secs: u64, ) -> Result<(), BlockError>

Tier-1 header checks SVL-001 through SVL-004 with an explicit DFSP activation height and a fixed now_secs reference for the timestamp bound (SVL-004).

SVL-001 / SPEC §5.1 Step 1: L2BlockHeader::version must match Self::protocol_version_for_height_with_activation for L2BlockHeader::height and dfsp_activation_height; else BlockError::InvalidVersion.

SVL-002 / SPEC §5.1 Step 2: when height < dfsp_activation_height, all five DFSP roots must equal EMPTY_ROOT; else BlockError::InvalidData (fixed message per SVL-002 spec).

SVL-003 / SPEC §5.1 Steps 3–4: total_cost > MAX_COST_PER_BLOCKBlockError::CostExceeded; then block_size > MAX_BLOCK_SIZEBlockError::TooLarge (SVL-003 spec).

SVL-004 / SPEC §5.1 Step 5: let max_allowed = now_secs + MAX_FUTURE_TIMESTAMP_SECONDS. If timestamp > max_allowed, reject with BlockError::TimestampTooFarInFuture (Chia block_header_validation.py Check 26a analogue). Strict >: timestamp == max_allowed is accepted.

Usage: Production should call Self::validate or Self::validate_with_dfsp_activation (wall-clock now). Integration tests call this method with a synthetic now_secs so boundary arithmetic is deterministic (SVL-004 spec — Implementation Notes).

Source

pub fn validate_with_dfsp_activation( &self, dfsp_activation_height: u64, ) -> Result<(), BlockError>

Same as Self::validate_with_dfsp_activation_at_unix after sampling the host wall clock (Self::unix_secs_wall_clock).

Rationale: Parameterizing dfsp_activation_height mirrors SVL-001 so integration tests can inject a finite fork height; production uses Self::validateDFSP_ACTIVATION_HEIGHT. With the BLK-005 sentinel u64::MAX, every finite height satisfies height < u64::MAX, so DFSP payloads cannot appear on-chain until governance lowers the constant.

SVL-004: Uses real SystemTime for now_secs. For deterministic timestamp tests, call Self::validate_with_dfsp_activation_at_unix directly.

Source

pub fn validate(&self) -> Result<(), BlockError>

Tier 1 header structural validation using crate-wide constants (SVL-*).

Current steps: SVL-001 (version), SVL-002 (DFSP roots before activation), SVL-003 (cost/size caps on declared header fields), SVL-004 (timestamp vs wall clock + MAX_FUTURE_TIMESTAMP_SECONDS).

Source

pub fn hash_preimage_bytes(&self) -> [u8; 710]

Serialize the exact 710-byte preimage for HSH-001 / SPEC §3.1 (same order as Self::hash).

Usage: Tests and debug tooling can diff preimages without re-deriving field order; Self::hash is SHA-256(self.hash_preimage_bytes()).

Optionals: Each Option<Bytes32> occupies 32 bytes: ZERO_HASH when None, raw bytes when Some.

Source

pub fn hash(&self) -> Bytes32

Canonical block identity: SHA-256 over Self::hash_preimage_bytes (HSH-001).

Requirement: SPEC §3.1. Numeric fields are little-endian; each optional L1 anchor contributes 32 bytes of raw Bytes32 or ZERO_HASH when None (malleability-safe encoding).

Primitive: chia_sha2::Sha256 only (crate::primitives / project crypto rules).

Source

pub fn to_bytes(&self) -> Vec<u8>

Serialize this header to bincode bytes for wire / storage (SER-002, NORMATIVE § SER-002, SPEC §8.2).

Infallible: Uses Result::expect because an in-memory, well-formed L2BlockHeader should always serialize with the crate’s serde schema; a panic indicates programmer error or schema drift, not recoverable I/O.

Source

pub fn from_bytes(bytes: &[u8]) -> Result<Self, BlockError>

Deserialize a header from bincode bytes (SER-002).

Errors: Any bincode failure maps to BlockError::InvalidData (message includes the decoder error) — covers empty input, truncated payloads, corrupted bytes, and schema mismatches.

Source

pub fn new( height: u64, epoch: u64, parent_hash: Bytes32, state_root: Bytes32, spends_root: Bytes32, additions_root: Bytes32, removals_root: Bytes32, receipts_root: Bytes32, l1_height: u32, l1_hash: Bytes32, proposer_index: u32, spend_bundle_count: u32, total_cost: Cost, total_fees: u64, additions_count: u32, removals_count: u32, block_size: u32, filter_hash: Bytes32, ) -> Self

Standard header constructor (SPEC §2.2 Derived methods / new()).

Sets version via Self::protocol_version_for_height; timestamp to 0 (SPEC omits it from the new parameter list—set explicitly or use Self::genesis / block builder for wall clock); L1 proof anchors to None; slash summary to empty; DFSP roots to EMPTY_ROOT; extension_data to ZERO_HASH.

Source

pub fn new_with_collateral( height: u64, epoch: u64, parent_hash: Bytes32, state_root: Bytes32, spends_root: Bytes32, additions_root: Bytes32, removals_root: Bytes32, receipts_root: Bytes32, l1_height: u32, l1_hash: Bytes32, proposer_index: u32, spend_bundle_count: u32, total_cost: Cost, total_fees: u64, additions_count: u32, removals_count: u32, block_size: u32, filter_hash: Bytes32, l1_collateral_coin_id: Bytes32, ) -> Self

Like Self::new but sets L2BlockHeader::l1_collateral_coin_id to the given proof coin id.

Source

pub fn new_with_l1_proofs( height: u64, epoch: u64, parent_hash: Bytes32, state_root: Bytes32, spends_root: Bytes32, additions_root: Bytes32, removals_root: Bytes32, receipts_root: Bytes32, l1_height: u32, l1_hash: Bytes32, proposer_index: u32, spend_bundle_count: u32, total_cost: Cost, total_fees: u64, additions_count: u32, removals_count: u32, block_size: u32, filter_hash: Bytes32, l1_collateral_coin_id: Bytes32, l1_reserve_coin_id: Bytes32, l1_prev_epoch_finalizer_coin_id: Bytes32, l1_curr_epoch_finalizer_coin_id: Bytes32, l1_network_coin_id: Bytes32, ) -> Self

Full L1 proof anchor set (SPEC field order: collateral, reserve, prev/curr finalizer, network coin).

Source

pub fn genesis(network_id: Bytes32, l1_height: u32, l1_hash: Bytes32) -> Self

Genesis header (SER-003, NORMATIVE § SER-003, SPEC §8.3).

§Field obligations
  • height / epoch: 0 — chain bootstrap position.
  • parent_hash: network_id — there is no prior L2 block; binding the parent slot to the network identity blocks cross-network replay of height-0 material (SER-003 summary).
  • Merkle / commitment roots: EMPTY_ROOT for state, spends, additions, removals, receipts, filter, slash proposals, and all DFSP layer roots; ZERO_HASH for extension_data (opaque extension slot starts empty).
  • Counts / costs / size: all zero; L1 anchor options: all None; slash count: 0.
  • l1_height / l1_hash: caller-supplied L1 observation the genesis L2 header is anchored to.
  • version: Self::protocol_version_for_height(0) — same BLK-007 auto-detection as every other constructor (not CARGO_PKG_VERSION; see SER-003 spec errata vs older pseudocode).

timestamp: wall-clock Unix seconds from SystemTime::now. Host clocks before 1970 cannot be represented; we panic with a clear message (same contract as “real” wall time for genesis in SPEC §8.3).

Trait Implementations§

Source§

impl Clone for L2BlockHeader

Source§

fn clone(&self) -> L2BlockHeader

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for L2BlockHeader

Source§

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

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

impl<'de> Deserialize<'de> for L2BlockHeader

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for L2BlockHeader

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for L2BlockHeader

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Streamable for L2BlockHeader

Source§

fn update_digest(&self, digest: &mut Sha256)

Source§

fn stream(&self, out: &mut Vec<u8>) -> Result<()>

Source§

fn parse<const TRUSTED: bool>(input: &mut Cursor<&[u8]>) -> Result<Self>

Source§

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

Source§

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
where Self: Sized,

Source§

fn from_bytes_unchecked(bytes: &[u8]) -> Result<Self, Error>
where Self: Sized,

Source§

fn hash(&self) -> [u8; 32]

Source§

impl Eq for L2BlockHeader

Source§

impl StructuralPartialEq for L2BlockHeader

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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

Checks if this value is equivalent to the given key. Read more
Source§

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

Source§

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

Checks if this value is equivalent to the given key. Read more
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> 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,