Struct lightning_invoice::ExpiryTime
source · pub struct ExpiryTime(_);
Expand description
Positive duration that defines when (relatively to the timestamp) in the future the invoice expires
Implementations§
source§impl ExpiryTime
impl ExpiryTime
sourcepub fn from_seconds(seconds: u64) -> ExpiryTime
pub fn from_seconds(seconds: u64) -> ExpiryTime
Construct an ExpiryTime
from seconds.
sourcepub fn from_duration(duration: Duration) -> ExpiryTime
pub fn from_duration(duration: Duration) -> ExpiryTime
Construct an ExpiryTime
from a Duration
, dropping the sub-second part.
sourcepub fn as_seconds(&self) -> u64
pub fn as_seconds(&self) -> u64
Returns the expiry time in seconds
sourcepub fn as_duration(&self) -> &Duration
pub fn as_duration(&self) -> &Duration
Returns a reference to the underlying Duration
(=expiry time)
Trait Implementations§
source§impl Base32Len for ExpiryTime
impl Base32Len for ExpiryTime
source§fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
Calculate the base32 serialized length
source§impl Clone for ExpiryTime
impl Clone for ExpiryTime
source§fn clone(&self) -> ExpiryTime
fn clone(&self) -> ExpiryTime
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 ExpiryTime
impl Debug for ExpiryTime
source§impl FromBase32 for ExpiryTime
impl FromBase32 for ExpiryTime
§type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing (e.g. because of bad padding).
source§fn from_base32(field_data: &[u5]) -> Result<ExpiryTime, ParseError>
fn from_base32(field_data: &[u5]) -> Result<ExpiryTime, ParseError>
Convert a base32 slice to
Self
.