Struct miniscript::AbsLockTime
source · pub struct AbsLockTime(/* private fields */);
Expand description
An absolute locktime that implements Ord
.
Implementations§
source§impl AbsLockTime
impl AbsLockTime
sourcepub fn from_consensus(n: u32) -> Result<Self, AbsLockTimeError>
pub fn from_consensus(n: u32) -> Result<Self, AbsLockTimeError>
Constructs an AbsLockTime
from an nLockTime value or the argument to CHEKCLOCKTIMEVERIFY
.
sourcepub fn to_consensus_u32(self) -> u32
pub fn to_consensus_u32(self) -> u32
Returns the inner u32
value. This is the value used when creating this LockTime
i.e., n OP_CHECKLOCKTIMEVERIFY
or nLockTime.
This calls through to absolute::LockTime::to_consensus_u32()
and the same usage warnings
apply.
sourcepub fn is_block_height(&self) -> bool
pub fn is_block_height(&self) -> bool
Whether this is a height-based locktime.
sourcepub fn is_block_time(&self) -> bool
pub fn is_block_time(&self) -> bool
Whether this is a time-based locktime.
Trait Implementations§
source§impl Clone for AbsLockTime
impl Clone for AbsLockTime
source§fn clone(&self) -> AbsLockTime
fn clone(&self) -> AbsLockTime
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 AbsLockTime
impl Debug for AbsLockTime
source§impl Display for AbsLockTime
impl Display for AbsLockTime
source§impl From<AbsLockTime> for LockTime
impl From<AbsLockTime> for LockTime
source§fn from(lock_time: AbsLockTime) -> LockTime
fn from(lock_time: AbsLockTime) -> LockTime
Converts to this type from the input type.
source§impl Hash for AbsLockTime
impl Hash for AbsLockTime
source§impl Ord for AbsLockTime
impl Ord for AbsLockTime
source§impl PartialEq<AbsLockTime> for AbsLockTime
impl PartialEq<AbsLockTime> for AbsLockTime
source§fn eq(&self, other: &AbsLockTime) -> bool
fn eq(&self, other: &AbsLockTime) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<AbsLockTime> for AbsLockTime
impl PartialOrd<AbsLockTime> for AbsLockTime
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for AbsLockTime
impl Eq for AbsLockTime
impl StructuralEq for AbsLockTime
impl StructuralPartialEq for AbsLockTime
Auto Trait Implementations§
impl RefUnwindSafe for AbsLockTime
impl Send for AbsLockTime
impl Sync for AbsLockTime
impl Unpin for AbsLockTime
impl UnwindSafe for AbsLockTime
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