Struct tendermint::block::Id[][src]

pub struct Id {
    pub hash: Hash,
    pub part_set_header: PartSetHeader,
}

Block identifiers which contain two distinct Merkle roots of the block, as well as the number of parts in the block.

https://github.com/tendermint/spec/blob/d46cd7f573a2c6a2399fcab2cde981330aa63f37/spec/core/data_structures.md#blockid

Default implementation is an empty Id as defined by the Go implementation in https://github.com/tendermint/tendermint/blob/1635d1339c73ae6a82e062cd2dc7191b029efa14/types/block.go#L1204.

If the Hash is empty in BlockId, the BlockId should be empty (encoded to None). This is implemented outside of this struct. Use the Default trait to check for an empty BlockId. See: https://github.com/informalsystems/tendermint-rs/issues/663

Fields

hash: Hash

The block’s main hash is the Merkle root of all the fields in the block header.

part_set_header: PartSetHeader

Parts header (if available) is used for secure gossipping of the block during consensus. It is the Merkle root of the complete serialized block cut into parts.

PartSet is used to split a byteslice of data into parts (pieces) for transmission. By splitting data into smaller parts and computing a Merkle root hash on the list, you can verify that a part is legitimately part of the complete data, and the part can be forwarded to other peers before all the parts are known. In short, it’s a fast way to propagate a large file over a gossip network.

https://github.com/tendermint/tendermint/wiki/Block-Structure#partset

PartSetHeader in protobuf is defined as never nil using the gogoproto annotations. This does not translate to Rust, but we can indicate this in the domain type.

Implementations

impl Id[src]

pub fn prefix(&self) -> String[src]

Get a shortened 12-character prefix of a block ID (ala git)

Trait Implementations

impl Clone for Id[src]

impl Copy for Id[src]

impl Debug for Id[src]

impl Default for Id[src]

impl<'de> Deserialize<'de> for Id[src]

impl Display for Id[src]

impl Eq for Id[src]

impl FromStr for Id[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for Id[src]

impl Ord for Id[src]

impl PartialEq<Id> for Id[src]

impl PartialOrd<Id> for Id[src]

impl Protobuf<BlockId> for Id[src]

impl Serialize for Id[src]

impl StructuralEq for Id[src]

impl StructuralPartialEq for Id[src]

impl TryFrom<BlockId> for Id[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<CanonicalBlockId> for Id[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Id

impl Send for Id

impl Sync for Id

impl Unpin for Id

impl UnwindSafe for Id

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

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

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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