Skip to main content

BlockIdExt

Struct BlockIdExt 

Source
#[non_exhaustive]
pub struct BlockIdExt { pub workchain: i32, pub shard: u64, pub seqno: u32, pub root_hash: [u8; 32], pub file_hash: [u8; 32], }
Expand description

The read response types, defined in ton-net-lite and surfaced here. A full block identifier: the id and its shard coordinates plus hashes.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§workchain: i32

The workchain id, -1 for the masterchain.

§shard: u64

The shard prefix, 0x8000000000000000 for the masterchain.

§seqno: u32

The block sequence number, a height.

§root_hash: [u8; 32]

The block root hash.

§file_hash: [u8; 32]

The block file hash.

Implementations§

Source§

impl BlockIdExt

Source

pub fn new( workchain: i32, shard: u64, seqno: u32, root_hash: [u8; 32], file_hash: [u8; 32], ) -> BlockIdExt

Names a block by its five identifying parts.

Reads hand these back, so a caller rarely builds one. The case that needs this is the one a verified read is for: an anchor block the caller learned somewhere other than from the server about to be checked. Without a way to name that block there is no way to check anything against it, and asking the server for its own anchor proves only that the server agrees with itself.

For a masterchain block, workchain is -1 and shard is 0x8000_0000_0000_0000.

Trait Implementations§

Source§

impl Clone for BlockIdExt

Source§

fn clone(&self) -> BlockIdExt

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 BlockIdExt

Source§

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

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

impl Eq for BlockIdExt

Source§

impl From<BlockIdExt> for BlockIdExt

Source§

fn from(wire: BlockIdExt) -> BlockIdExt

The sequence number is a height, so it becomes unsigned crossing into the domain.

Source§

impl Hash for BlockIdExt

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for BlockIdExt

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BlockIdExt

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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, 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.