pub struct Height(/* private fields */);
Available on crate feature
alloc
only.Expand description
A relative lock time lock-by-blockheight value.
Implementations§
source§impl Height
impl Height
sourcepub const MIN: Self = Self::ZERO
pub const MIN: Self = Self::ZERO
The minimum relative block height (0), can be included in any block.
sourcepub const fn from_height(blocks: u16) -> Self
pub const fn from_height(blocks: u16) -> Self
Create a Height
using a count of blocks.
sourcepub const fn to_consensus_u32(&self) -> u32
pub const 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§
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 From<Height> for BlockInterval
impl From<Height> for BlockInterval
source§fn from(h: Height) -> Self
fn from(h: Height) -> Self
Converts a locktime::relative::Height
to a BlockInterval
.
A relative locktime block height has a maximum value of u16::MAX
where as a
BlockInterval
is a thin wrapper around a u32
, the two types are not interchangeable.
source§impl Ord for Height
impl Ord for Height
source§impl PartialOrd for Height
impl PartialOrd for Height
source§impl TryFrom<BlockInterval> for Height
impl TryFrom<BlockInterval> for Height
source§fn try_from(h: BlockInterval) -> Result<Self, Self::Error>
fn try_from(h: BlockInterval) -> Result<Self, Self::Error>
Converts a BlockInterval
to a locktime::relative::Height
.
A relative locktime block height has a maximum value of u16::MAX
where as a
BlockInterval
is a thin wrapper around a u32
, the two types are not interchangeable.
source§type Error = TooBigForRelativeBlockHeightError
type Error = TooBigForRelativeBlockHeightError
The type returned in the event of a conversion error.
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)