pub struct BlockHeight(pub u32);
alloc
only.Expand description
The block height, zero denotes the genesis block.
This type is not meant for constructing height based timelocks, this is a general purpose block
height abstraction. For locktimes please see locktime::absolute::Height
.
This is a thin wrapper around a u32
that may take on all values of a u32
.
Tuple Fields§
§0: u32
Implementations§
source§impl BlockHeight
impl BlockHeight
Trait Implementations§
source§impl Add<BlockInterval> for BlockHeight
impl Add<BlockInterval> for BlockHeight
source§type Output = BlockHeight
type Output = BlockHeight
+
operator.source§impl Clone for BlockHeight
impl Clone for BlockHeight
source§fn clone(&self) -> BlockHeight
fn clone(&self) -> BlockHeight
1.6.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for BlockHeight
impl Debug for BlockHeight
source§impl<'de> Deserialize<'de> for BlockHeight
impl<'de> Deserialize<'de> for BlockHeight
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>,
source§impl Display for BlockHeight
impl Display for BlockHeight
source§impl From<BlockHeight> for u32
impl From<BlockHeight> for u32
source§fn from(height: BlockHeight) -> Self
fn from(height: BlockHeight) -> Self
source§impl From<Height> for BlockHeight
impl From<Height> for BlockHeight
source§fn from(h: Height) -> Self
fn from(h: Height) -> Self
Converts a locktime::absolute::Height
to a BlockHeight
.
An absolute locktime block height has a maximum value of absolute::LOCK_TIME_THRESHOLD
(500,000,000) where as a BlockHeight
is a thin wrapper around a u32
, the two types are
not interchangeable.
source§impl From<u32> for BlockHeight
impl From<u32> for BlockHeight
source§impl FromStr for BlockHeight
impl FromStr for BlockHeight
source§impl Hash for BlockHeight
impl Hash for BlockHeight
source§impl Ord for BlockHeight
impl Ord for BlockHeight
source§fn cmp(&self, other: &BlockHeight) -> Ordering
fn cmp(&self, other: &BlockHeight) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for BlockHeight
impl PartialEq for BlockHeight
source§impl PartialOrd for BlockHeight
impl PartialOrd for BlockHeight
source§impl Serialize for BlockHeight
impl Serialize for BlockHeight
source§impl Sub<BlockInterval> for BlockHeight
impl Sub<BlockInterval> for BlockHeight
source§type Output = BlockHeight
type Output = BlockHeight
-
operator.source§impl Sub for BlockHeight
impl Sub for BlockHeight
source§type Output = BlockInterval
type Output = BlockInterval
-
operator.source§impl TryFrom<&str> for BlockHeight
impl TryFrom<&str> for BlockHeight
source§impl TryFrom<BlockHeight> for Height
impl TryFrom<BlockHeight> for Height
source§fn try_from(h: BlockHeight) -> Result<Self, Self::Error>
fn try_from(h: BlockHeight) -> Result<Self, Self::Error>
Converts a BlockHeight
to a locktime::absolute::Height
.
An absolute locktime block height has a maximum value of absolute::LOCK_TIME_THRESHOLD
(500,000,000) where as a BlockHeight
is a thin wrapper around a u32
, the two types are
not interchangeable.
source§type Error = ConversionError
type Error = ConversionError
source§impl TryFrom<String> for BlockHeight
impl TryFrom<String> for BlockHeight
impl Copy for BlockHeight
impl Eq for BlockHeight
impl StructuralPartialEq for BlockHeight
Auto Trait Implementations§
impl Freeze for BlockHeight
impl RefUnwindSafe for BlockHeight
impl Send for BlockHeight
impl Sync for BlockHeight
impl Unpin for BlockHeight
impl UnwindSafe for BlockHeight
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
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)
clone_to_uninit
)