pub struct ExpiryTime(/* private fields */);
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 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 Hash for ExpiryTime
impl Hash for ExpiryTime
Source§impl Ord for ExpiryTime
impl Ord for ExpiryTime
Source§fn cmp(&self, other: &ExpiryTime) -> Ordering
fn cmp(&self, other: &ExpiryTime) -> 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 ExpiryTime
impl PartialEq for ExpiryTime
Source§impl PartialOrd for ExpiryTime
impl PartialOrd for ExpiryTime
impl Eq for ExpiryTime
impl StructuralPartialEq for ExpiryTime
Auto Trait Implementations§
impl Freeze for ExpiryTime
impl RefUnwindSafe for ExpiryTime
impl Send for ExpiryTime
impl Sync for ExpiryTime
impl Unpin for ExpiryTime
impl UnwindSafe for ExpiryTime
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