pub struct Height(/* private fields */);
Expand description
An absolute block height, guaranteed to always contain a valid height value.
Implementations§
§impl Height
impl Height
pub fn from_hex(s: &str) -> Result<Height, ParseHeightError>
pub fn from_hex(s: &str) -> Result<Height, ParseHeightError>
Creates a Height
from a hex string.
The input string is may or may not contain a typical hex prefix e.g., 0x
.
pub fn from_consensus(n: u32) -> Result<Height, ConversionError>
pub fn from_consensus(n: u32) -> Result<Height, ConversionError>
pub fn to_consensus_u32(self) -> u32
pub fn to_consensus_u32(self) -> u32
Converts this Height
to its inner u32
value.
Trait Implementations§
§impl<'de> Deserialize<'de> for Height
impl<'de> Deserialize<'de> for Height
§fn deserialize<D>(
deserializer: D
) -> Result<Height, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Height, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Ord for Height
impl Ord for Height
§impl PartialOrd for Height
impl PartialOrd for Height
§fn partial_cmp(&self, other: &Height) -> Option<Ordering>
fn partial_cmp(&self, other: &Height) -> Option<Ordering>
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 more§impl Serialize for Height
impl Serialize for Height
§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 Copy for Height
impl Eq for Height
impl StructuralPartialEq for Height
Auto Trait Implementations§
impl Freeze for Height
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more