pub struct BlockInterval(pub u32);
alloc
only.Expand description
The block interval.
Block interval is an integer type denoting the number of blocks that has passed since some point i.e., this type is meant for usage as a relative block measure.
This type is not meant for constructing relative height based timelocks, this is a general
purpose block interval abstraction. For locktimes please see locktime::relative::Height
.
Tuple Fields§
§0: u32
Implementations§
source§impl BlockInterval
impl BlockInterval
Trait Implementations§
source§impl Add<BlockInterval> for BlockHeight
impl Add<BlockInterval> for BlockHeight
source§type Output = BlockHeight
type Output = BlockHeight
+
operator.source§impl Add for BlockInterval
impl Add for BlockInterval
source§type Output = BlockInterval
type Output = BlockInterval
+
operator.source§impl AddAssign for BlockInterval
impl AddAssign for BlockInterval
source§fn add_assign(&mut self, rhs: BlockInterval)
fn add_assign(&mut self, rhs: BlockInterval)
+=
operation. Read moresource§impl Clone for BlockInterval
impl Clone for BlockInterval
source§fn clone(&self) -> BlockInterval
fn clone(&self) -> BlockInterval
1.6.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for BlockInterval
impl Debug for BlockInterval
source§impl<'de> Deserialize<'de> for BlockInterval
impl<'de> Deserialize<'de> for BlockInterval
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 BlockInterval
impl Display for BlockInterval
source§impl From<BlockInterval> for u32
impl From<BlockInterval> for u32
source§fn from(height: BlockInterval) -> Self
fn from(height: BlockInterval) -> Self
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 From<u32> for BlockInterval
impl From<u32> for BlockInterval
source§impl FromStr for BlockInterval
impl FromStr for BlockInterval
source§impl Hash for BlockInterval
impl Hash for BlockInterval
source§impl Ord for BlockInterval
impl Ord for BlockInterval
source§fn cmp(&self, other: &BlockInterval) -> Ordering
fn cmp(&self, other: &BlockInterval) -> 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 BlockInterval
impl PartialEq for BlockInterval
source§impl PartialOrd for BlockInterval
impl PartialOrd for BlockInterval
source§impl Serialize for BlockInterval
impl Serialize for BlockInterval
source§impl Sub<BlockInterval> for BlockHeight
impl Sub<BlockInterval> for BlockHeight
source§type Output = BlockHeight
type Output = BlockHeight
-
operator.source§impl Sub for BlockInterval
impl Sub for BlockInterval
source§type Output = BlockInterval
type Output = BlockInterval
-
operator.source§impl SubAssign for BlockInterval
impl SubAssign for BlockInterval
source§fn sub_assign(&mut self, rhs: BlockInterval)
fn sub_assign(&mut self, rhs: BlockInterval)
-=
operation. Read moresource§impl TryFrom<&str> for BlockInterval
impl TryFrom<&str> for BlockInterval
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
source§impl TryFrom<String> for BlockInterval
impl TryFrom<String> for BlockInterval
impl Copy for BlockInterval
impl Eq for BlockInterval
impl StructuralPartialEq for BlockInterval
Auto Trait Implementations§
impl Freeze for BlockInterval
impl RefUnwindSafe for BlockInterval
impl Send for BlockInterval
impl Sync for BlockInterval
impl Unpin for BlockInterval
impl UnwindSafe for BlockInterval
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
)