pub struct Height(/* private fields */);
Expand description
A relative lock time lock-by-blockheight value.
Implementations§
§impl Height
impl Height
pub const MIN: Height = Self::ZERO
pub const MIN: Height = Self::ZERO
The minimum relative block height (0), can be included in any block.
pub const fn from_height(blocks: u16) -> Height
pub const fn from_height(blocks: u16) -> Height
Create a Height
using a count of blocks.
pub fn to_consensus_u32(&self) -> u32
pub fn to_consensus_u32(&self) -> u32
Returns the u32
value used to encode this locktime in an nSequence field or
argument to OP_CHECKSEQUENCEVERIFY
.
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