pub struct LockHeight(/* private fields */);
Expand description
Value for a transaction nTimeLock
field which is guaranteed to represent a
block height number which is always less than 500000000.
Implementations§
Source§impl LockHeight
impl LockHeight
Sourcepub fn from_height(height: u32) -> Option<Self>
pub fn from_height(height: u32) -> Option<Self>
Creates absolute time lock with the given block height.
Block height must be strictly less than 0x1DCD6500
, otherwise
None
is returned.
pub const fn try_from_lock_time( lock_time: LockTime, ) -> Result<Self, InvalidTimelock>
pub const fn try_from_consensus_u32( lock_time: u32, ) -> Result<Self, InvalidTimelock>
Sourcepub const fn to_consensus_u32(&self) -> u32
pub const fn to_consensus_u32(&self) -> u32
Converts into full u32 representation of nLockTime
value as it is
serialized in bitcoin transaction.
Sourcepub const fn into_consensus_u32(self) -> u32
pub const fn into_consensus_u32(self) -> u32
Converts into full u32 representation of nLockTime
value as it is
serialized in bitcoin transaction.
Sourcepub fn to_lock_time(&self) -> LockTime
pub fn to_lock_time(&self) -> LockTime
Converts into LockTime
representation.
Sourcepub fn into_lock_time(self) -> LockTime
pub fn into_lock_time(self) -> LockTime
Converts into LockTime
representation.
Trait Implementations§
Source§impl Clone for LockHeight
impl Clone for LockHeight
Source§fn clone(&self) -> LockHeight
fn clone(&self) -> LockHeight
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LockHeight
impl Debug for LockHeight
Source§impl Default for LockHeight
impl Default for LockHeight
Source§fn default() -> LockHeight
fn default() -> LockHeight
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LockHeight
impl<'de> Deserialize<'de> for LockHeight
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 Display for LockHeight
impl Display for LockHeight
Source§impl From<LockHeight> for LockTime
impl From<LockHeight> for LockTime
Source§fn from(lock: LockHeight) -> Self
fn from(lock: LockHeight) -> Self
Converts to this type from the input type.
Source§impl From<LockHeight> for u32
impl From<LockHeight> for u32
Source§fn from(lock_height: LockHeight) -> Self
fn from(lock_height: LockHeight) -> Self
Converts to this type from the input type.
Source§impl FromStr for LockHeight
impl FromStr for LockHeight
Source§impl Hash for LockHeight
impl Hash for LockHeight
Source§impl Ord for LockHeight
impl Ord for LockHeight
Source§fn cmp(&self, other: &LockHeight) -> Ordering
fn cmp(&self, other: &LockHeight) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for LockHeight
impl PartialEq for LockHeight
Source§impl PartialOrd for LockHeight
impl PartialOrd for LockHeight
Source§impl Serialize for LockHeight
impl Serialize for LockHeight
Source§impl StrictDecode for LockHeight
impl StrictDecode for LockHeight
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictEncode for LockHeight
impl StrictEncode for LockHeight
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictTuple for LockHeight
impl StrictTuple for LockHeight
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for LockHeight
impl StrictType for LockHeight
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
Source§impl TryFrom<LockTime> for LockHeight
impl TryFrom<LockTime> for LockHeight
Source§impl TryFrom<u32> for LockHeight
impl TryFrom<u32> for LockHeight
impl Copy for LockHeight
impl Eq for LockHeight
impl StrictProduct for LockHeight
impl StructuralPartialEq for LockHeight
Auto Trait Implementations§
impl Freeze for LockHeight
impl RefUnwindSafe for LockHeight
impl Send for LockHeight
impl Sync for LockHeight
impl Unpin for LockHeight
impl UnwindSafe for LockHeight
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.