Struct tendermint_light_client::types::LightBlock
source · pub struct LightBlock {
pub signed_header: SignedHeader,
pub validators: Set,
pub next_validators: Set,
pub provider: Id,
}
Expand description
A light block is the core data structure used by the light client. It records everything the light client needs to know about a block.
Fields§
§signed_header: SignedHeader
Header and commit of this block
validators: Set
Validator set at the block height
next_validators: Set
Validator set at the next block height
provider: Id
The peer ID of the node that provided this block
Implementations§
source§impl LightBlock
impl LightBlock
sourcepub fn new(
signed_header: SignedHeader,
validators: Set,
next_validators: Set,
provider: Id
) -> LightBlock
pub fn new( signed_header: SignedHeader, validators: Set, next_validators: Set, provider: Id ) -> LightBlock
Constructs a new light block
sourcepub fn time(&self) -> Time
pub fn time(&self) -> Time
Returns the time at which this block was created.
§Note
This is a shorthand for block.signed_header.header.time
.
sourcepub fn as_trusted_state(&self) -> TrustedBlockState<'_>
pub fn as_trusted_state(&self) -> TrustedBlockState<'_>
Obtain the verification parameters for the light block when using it as trusted state.
sourcepub fn as_untrusted_state(&self) -> UntrustedBlockState<'_>
pub fn as_untrusted_state(&self) -> UntrustedBlockState<'_>
Obtain the verification parameters for the light block when using it as untrusted state.
Trait Implementations§
source§impl Clone for LightBlock
impl Clone for LightBlock
source§fn clone(&self) -> LightBlock
fn clone(&self) -> LightBlock
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LightBlock
impl Debug for LightBlock
source§impl<'de> Deserialize<'de> for LightBlock
impl<'de> Deserialize<'de> for LightBlock
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<LightBlock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<LightBlock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for LightBlock
impl Display for LightBlock
source§impl PartialEq for LightBlock
impl PartialEq for LightBlock
source§fn eq(&self, other: &LightBlock) -> bool
fn eq(&self, other: &LightBlock) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for LightBlock
impl Serialize for LightBlock
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for LightBlock
impl StructuralPartialEq for LightBlock
Auto Trait Implementations§
impl Freeze for LightBlock
impl RefUnwindSafe for LightBlock
impl Send for LightBlock
impl Sync for LightBlock
impl Unpin for LightBlock
impl UnwindSafe for LightBlock
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.