[−][src]Struct lightning_invoice::ExpiryTime
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
impl ExpiryTime
[src]
pub fn from_seconds(seconds: u64) -> Result<ExpiryTime, CreationError>
[src]
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
.
pub fn from_duration(duration: Duration) -> Result<ExpiryTime, CreationError>
[src]
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
.
pub fn as_seconds(&self) -> u64
[src]
Returns the expiry time in seconds
pub fn as_duration(&self) -> &Duration
[src]
Returns a reference to the underlying Duration
(=expiry time)
Trait Implementations
impl Base32Len for ExpiryTime
[src]
pub fn base32_len(&self) -> usize
[src]
impl Clone for ExpiryTime
[src]
pub fn clone(&self) -> ExpiryTime
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ExpiryTime
[src]
impl Eq for ExpiryTime
[src]
impl FromBase32 for ExpiryTime
[src]
type Err = ParseError
The associated error which can be returned from parsing (e.g. because of bad padding).
pub fn from_base32(field_data: &[u5]) -> Result<ExpiryTime, ParseError>
[src]
impl PartialEq<ExpiryTime> for ExpiryTime
[src]
pub fn eq(&self, other: &ExpiryTime) -> bool
[src]
pub fn ne(&self, other: &ExpiryTime) -> bool
[src]
impl StructuralEq for ExpiryTime
[src]
impl StructuralPartialEq for ExpiryTime
[src]
impl ToBase32 for ExpiryTime
[src]
Auto Trait Implementations
impl RefUnwindSafe for ExpiryTime
[src]
impl Send for ExpiryTime
[src]
impl Sync for ExpiryTime
[src]
impl Unpin for ExpiryTime
[src]
impl UnwindSafe for ExpiryTime
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,