Struct libyobicash::models::block::Block [] [src]

pub struct Block {
    pub id: Digest,
    pub version: Version,
    pub network_type: NetworkType,
    pub timestamp: Timestamp,
    pub transactions_size: u32,
    pub transactions_length: u32,
    pub transactions_ids: Vec<Digest>,
}

A Block is a commitment of validated transactions.

Fields

The block id.

The version of the library.

The protocol network type.

The unix timestamp of the time the block.

The size of the block transactions.

The length of the block transactions.

The block transactions' ids.

Methods

impl Block
[src]

[src]

Creates a new Block.

[src]

Creates a new genesis Block.

[src]

Creates a new regtest genesis Block.

[src]

Creates a new testnet genesis Block.

[src]

Creates a new mainnet genesis Block.

[src]

Verifies if the Block is a genesis.

[src]

Returns the size of the Block.

Trait Implementations

impl Clone for Block
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for Block
[src]

[src]

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

[src]

This method tests for !=.

impl Debug for Block
[src]

[src]

Formats the value using the given formatter. Read more

impl Default for Block
[src]

[src]

Returns the "default value" for a type. Read more

impl<'a> Identify<'a> for Block
[src]

Type of the identifier.

[src]

Returns the ID of the implementor.

[src]

Converts a binary to an ID.

[src]

Converts an ID to bytes.

[src]

Returns the binary representation of the ID of the object.

[src]

Converts a string to an ID.

[src]

Converts an ID to string.

[src]

Returns the string representation of the ID of the object.

impl Validate for Block
[src]

[src]

Validate the object.

impl<'a> Serialize<'a> for Block
[src]

[src]

Serialize to a json string.

[src]

Deserialize from a json string.

[src]

Serialize to a binary.

[src]

Deserialize from a binary.

[src]

Serialize to a hex.

[src]

Deserialize from a hex.

Auto Trait Implementations

impl Send for Block

impl Sync for Block