Skip to main content

HasChainMetadata

Trait HasChainMetadata 

Source
pub trait HasChainMetadata {
    // Required method
    fn slot_time(&self) -> SlotTime;

    // Provided method
    fn block_time(&self) -> Timestamp { ... }
}
Expand description

Objects which can access chain metadata.

§Deprecation notice

This trait is deprecated along with crate::test_infrastructure.

Use ChainMetadata instead unless you intend to use the deprecated test infrastructure.

See the crate documentation for more details.

Required Methods§

Source

fn slot_time(&self) -> SlotTime

Get time in milliseconds at the beginning of this block.

Provided Methods§

Source

fn block_time(&self) -> Timestamp

Get time in milliseconds at the beginning of this block.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl HasChainMetadata for ExternChainMeta

§Trait implementations for the chain metadata.

Source§

impl HasChainMetadata for TestChainMeta