Struct lightning_invoice::ExpiryTime [−][src]
pub struct ExpiryTime(_);
Expand description
Positive duration that defines when (relatively to the timestamp) in the future the invoice expires
Invariants
The number of seconds this expiry time represents has to be in the range
0...(SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME)
to avoid overflows when adding it to a
timestamp
Implementations
Construct an ExpiryTime
from seconds. If there exists a PositiveTimestamp
which would
overflow on adding the EpiryTime
to it then this function will return a
CreationError::ExpiryTimeOutOfBounds
.
Construct an ExpiryTime
from a Duration
. If there exists a PositiveTimestamp
which
would overflow on adding the EpiryTime
to it then this function will return a
CreationError::ExpiryTimeOutOfBounds
.
Returns the expiry time in seconds
Returns a reference to the underlying Duration
(=expiry time)
Trait Implementations
Calculate the base32 serialized length
type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing (e.g. because of bad padding).
Convert a base32 slice to Self
.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Encode as base32 and write it to the supplied writer Implementations shouldn’t allocate. Read more
Auto Trait Implementations
impl RefUnwindSafe for ExpiryTime
impl Send for ExpiryTime
impl Sync for ExpiryTime
impl Unpin for ExpiryTime
impl UnwindSafe for ExpiryTime
Blanket Implementations
Mutably borrows from an owned value. Read more