pub struct LockTimestamp(/* private fields */);
Expand description
Value for a transaction nTimeLock
field which is guaranteed to represent a
UNIX timestamp which is always either 0 or a greater than or equal to
500000000.
Implementations§
Source§impl LockTimestamp
impl LockTimestamp
Sourcepub fn since_now() -> Self
Available on crate feature chrono
only.
pub fn since_now() -> Self
chrono
only.Creates absolute time lock valid since the current timestamp.
Sourcepub fn from_unix_timestamp(timestamp: u32) -> Option<Self>
pub fn from_unix_timestamp(timestamp: u32) -> Option<Self>
Creates absolute time lock with the given UNIX timestamp value.
Timestamp value must be greater or equal to 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 into_lock_time(self) -> LockTime
pub fn into_lock_time(self) -> LockTime
Converts into LockTime
representation.
Sourcepub fn to_lock_time(self) -> LockTime
pub fn to_lock_time(self) -> LockTime
Converts into LockTime
representation.
Trait Implementations§
Source§impl Clone for LockTimestamp
impl Clone for LockTimestamp
Source§fn clone(&self) -> LockTimestamp
fn clone(&self) -> LockTimestamp
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 LockTimestamp
impl Debug for LockTimestamp
Source§impl Default for LockTimestamp
impl Default for LockTimestamp
Source§fn default() -> LockTimestamp
fn default() -> LockTimestamp
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LockTimestamp
impl<'de> Deserialize<'de> for LockTimestamp
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 LockTimestamp
impl Display for LockTimestamp
Source§impl From<LockTimestamp> for LockTime
impl From<LockTimestamp> for LockTime
Source§fn from(lock: LockTimestamp) -> Self
fn from(lock: LockTimestamp) -> Self
Converts to this type from the input type.
Source§impl From<LockTimestamp> for u32
impl From<LockTimestamp> for u32
Source§fn from(lock_timestamp: LockTimestamp) -> Self
fn from(lock_timestamp: LockTimestamp) -> Self
Converts to this type from the input type.
Source§impl FromStr for LockTimestamp
impl FromStr for LockTimestamp
Source§impl Hash for LockTimestamp
impl Hash for LockTimestamp
Source§impl Ord for LockTimestamp
impl Ord for LockTimestamp
Source§fn cmp(&self, other: &LockTimestamp) -> Ordering
fn cmp(&self, other: &LockTimestamp) -> 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 LockTimestamp
impl PartialEq for LockTimestamp
Source§impl PartialOrd for LockTimestamp
impl PartialOrd for LockTimestamp
Source§impl Serialize for LockTimestamp
impl Serialize for LockTimestamp
Source§impl StrictDecode for LockTimestamp
impl StrictDecode for LockTimestamp
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictEncode for LockTimestamp
impl StrictEncode for LockTimestamp
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictTuple for LockTimestamp
impl StrictTuple for LockTimestamp
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for LockTimestamp
impl StrictType for LockTimestamp
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
Source§impl TryFrom<LockTime> for LockTimestamp
impl TryFrom<LockTime> for LockTimestamp
Source§impl TryFrom<u32> for LockTimestamp
impl TryFrom<u32> for LockTimestamp
impl Copy for LockTimestamp
impl Eq for LockTimestamp
impl StrictProduct for LockTimestamp
impl StructuralPartialEq for LockTimestamp
Auto Trait Implementations§
impl Freeze for LockTimestamp
impl RefUnwindSafe for LockTimestamp
impl Send for LockTimestamp
impl Sync for LockTimestamp
impl Unpin for LockTimestamp
impl UnwindSafe for LockTimestamp
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.