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

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

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

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Feeds this value into the given Hasher. Read more

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

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Encode into a buffer in Protobuf format. Read more

Encode with a length-delimiter to a buffer in Protobuf format. Read more

Constructor that attempts to decode an instance from a buffer. Read more

Constructor that attempts to decode a length-delimited instance from the buffer. Read more

Returns the encoded length of the message without a length delimiter. Read more

Encodes into a Protobuf-encoded Vec<u8>.

Constructor that attempts to decode a Protobuf-encoded instance from a Vec<u8> (or equivalent). Read more

Encode with a length-delimiter to a Vec<u8> Protobuf-encoded message.

Constructor that attempts to decode a Protobuf-encoded instance with a length-delimiter from a Vec<u8> or equivalent. Read more

Serialize this value into the given Serde serializer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.