pub struct SeqNo(/* private fields */);Expand description
Value for nSeq field of a transaction output
Implementations§
Source§impl SeqNo
impl SeqNo
Sourcepub fn unencumbered(max: bool) -> SeqNo
pub fn unencumbered(max: bool) -> SeqNo
Creates nSeq value which is not encumbered by either RBF not relative
time locks.
§Arguments
maxdefines whethernSeqshould be set to the0xFFFFFFFF(true) or0xFFFFFFFe.
Sourcepub fn from_rbf(order: u16) -> SeqNo
pub fn from_rbf(order: u16) -> SeqNo
Creates nSeq in replace-by-fee mode with the specified order number.
Sourcepub fn rbf() -> SeqNo
pub fn rbf() -> SeqNo
Creates nSeq in replace-by-fee mode with value 0xFFFFFFFD.
This value is the value supported by the BitBox software.
Sourcepub fn from_height(blocks: u16) -> SeqNo
pub fn from_height(blocks: u16) -> SeqNo
Creates relative time lock measured in number of blocks (implies RBF).
Sourcepub fn from_intervals(intervals: u16) -> SeqNo
pub fn from_intervals(intervals: u16) -> SeqNo
Creates relative time lock measured in number of 512-second intervals (implies RBF).
Sourcepub fn from_consensus(consensus: u32) -> SeqNo
pub fn from_consensus(consensus: u32) -> SeqNo
Creates time lock basing on bitcoin consensus 32-bit value.
Sourcepub fn classify(self) -> SeqNoClass
pub fn classify(self) -> SeqNoClass
Classifies type of nSeq value (see SeqNoClass).
Sourcepub fn is_rbf(self) -> bool
pub fn is_rbf(self) -> bool
Checks if nSeq value opts-in for replace-by-fee (also always true for
relative time locks).
Sourcepub fn is_timelock(self) -> bool
pub fn is_timelock(self) -> bool
Checks if nSeq value opts-in for relative time locks (also always
imply RBG opt-in).
Sourcepub fn into_consensus(self) -> u32
pub fn into_consensus(self) -> u32
Gets full u32 representation of nSeq value as it is serialized in
bitcoin transaction.
Sourcepub fn time_lock_interval(self) -> Option<TimeLockInterval>
pub fn time_lock_interval(self) -> Option<TimeLockInterval>
Gets structured relative time lock information from the nSeq value.
See TimeLockInterval.
Trait Implementations§
Source§impl PartialOrd for SeqNo
impl PartialOrd for SeqNo
Source§impl StrictDecode for SeqNo
impl StrictDecode for SeqNo
Source§fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
std::io::Read instance; must either
construct an instance or return implementation-specific error type.Source§fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
StrictDecode::strict_decode. If there are some data remains in the
buffer once deserialization is completed, fails with
Error::DataNotEntirelyConsumed. Use io::Cursor over the buffer and
StrictDecode::strict_decode to avoid such failures.Source§fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
path and reconstructs object from it. Fails
with Error::DataNotEntirelyConsumed if file contains remaining
data after the object reconstruction.Source§impl StrictEncode for SeqNo
impl StrictEncode for SeqNo
Source§fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
std::io::Write instance; must return result
with either amount of bytes encoded – or implementation-specific
error type.Source§fn strict_serialize(&self) -> Result<Vec<u8>, Error>
fn strict_serialize(&self) -> Result<Vec<u8>, Error>
StrictEncode::strict_encode
function