pub struct Height { /* private fields */ }Expand description
The core IBC height type, which represents the height of a chain, which typically is the number of blocks since genesis (or more generally, since the last revision/hard upgrade).
Implementations§
source§impl Height
impl Height
pub fn new( revision_number: u64, revision_height: u64 ) -> Result<Self, ClientError>
pub fn min(revision_number: u64) -> Self
pub fn revision_number(&self) -> u64
pub fn revision_height(&self) -> u64
pub fn add(&self, delta: u64) -> Height
pub fn increment(&self) -> Height
pub fn sub(&self, delta: u64) -> Result<Height, ClientError>
pub fn decrement(&self) -> Result<Height, ClientError>
Trait Implementations§
source§impl BorshDeserialize for Heightwhere
u64: BorshDeserialize,
impl BorshDeserialize for Heightwhere u64: BorshDeserialize,
source§impl BorshSerialize for Heightwhere
u64: BorshSerialize,
impl BorshSerialize for Heightwhere u64: BorshSerialize,
source§impl Decode for Height
impl Decode for Height
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
Attempt to deserialise the value from input.
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self> ) -> Result<DecodeFinished, Error>where I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
source§impl<'de> Deserialize<'de> for Height
impl<'de> Deserialize<'de> for Height
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Encode for Height
impl Encode for Height
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
Convert self to a slice and append it to the destination.
source§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,
Convert self to a slice and then invoke the given closure with it.
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
source§impl From<Height> for TimeoutHeight
impl From<Height> for TimeoutHeight
source§impl JsonSchema for Height
impl JsonSchema for Height
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moresource§impl Ord for Height
impl Ord for Height
source§impl PartialEq for Height
impl PartialEq for Height
source§impl PartialOrd for Height
impl PartialOrd for Height
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Protobuf<Height> for Height
impl Protobuf<Height> for Height
source§fn encode(&self, buf: &mut Vec<u8>) -> Result<(), Error>
fn encode(&self, buf: &mut Vec<u8>) -> Result<(), Error>
Encode into a buffer in Protobuf format. Read more
source§fn encode_length_delimited(&self, buf: &mut Vec<u8>) -> Result<(), Error>
fn encode_length_delimited(&self, buf: &mut Vec<u8>) -> Result<(), Error>
Encode with a length-delimiter to a buffer in Protobuf format. Read more
source§fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Self: Sized,
fn decode<B>(buf: B) -> Result<Self, Error>where B: Buf, Self: Sized,
Constructor that attempts to decode an instance from a buffer. Read more
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Self: Sized,
fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where B: Buf, Self: Sized,
Constructor that attempts to decode a length-delimited instance from
the buffer. Read more
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter. Read more
source§fn decode_vec(v: &[u8]) -> Result<Self, Error>where
Self: Sized,
fn decode_vec(v: &[u8]) -> Result<Self, Error>where Self: Sized,
Constructor that attempts to decode a Protobuf-encoded instance from a
Vec<u8> (or equivalent).source§fn encode_length_delimited_vec(&self) -> Vec<u8> ⓘ
fn encode_length_delimited_vec(&self) -> Vec<u8> ⓘ
Encode with a length-delimiter to a
Vec<u8> Protobuf-encoded message.source§fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>where
Self: Sized,
fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>where Self: Sized,
Constructor that attempts to decode a Protobuf-encoded instance with a
length-delimiter from a
Vec<u8> or equivalent.fn encode_to_hex_string(&self) -> String
impl Copy for Height
impl EncodeLike for Height
impl Eq for Height
impl StructuralEq for Height
impl StructuralPartialEq for Height
Auto Trait Implementations§
impl RefUnwindSafe for Height
impl Send for Height
impl Sync for Height
impl Unpin for Height
impl UnwindSafe for Height
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