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
sourceimpl 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
.
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
sourceimpl Base32Len for ExpiryTime
impl Base32Len for ExpiryTime
sourcefn base32_len(&self) -> usize
fn base32_len(&self) -> usize
Calculate the base32 serialized length
sourceimpl Clone for ExpiryTime
impl Clone for ExpiryTime
sourcefn clone(&self) -> ExpiryTime
fn clone(&self) -> ExpiryTime
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ExpiryTime
impl Debug for ExpiryTime
sourceimpl 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).
sourcefn from_base32(field_data: &[u5]) -> Result<ExpiryTime, ParseError>
fn from_base32(field_data: &[u5]) -> Result<ExpiryTime, ParseError>
Convert a base32 slice to Self
.
sourceimpl Hash for ExpiryTime
impl Hash for ExpiryTime
sourceimpl PartialEq<ExpiryTime> for ExpiryTime
impl PartialEq<ExpiryTime> for ExpiryTime
sourcefn eq(&self, other: &ExpiryTime) -> bool
fn eq(&self, other: &ExpiryTime) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ExpiryTime) -> bool
fn ne(&self, other: &ExpiryTime) -> bool
This method tests for !=
.
sourceimpl ToBase32 for ExpiryTime
impl ToBase32 for ExpiryTime
sourcefn write_base32<W: WriteBase32>(
&self,
writer: &mut W
) -> Result<(), <W as WriteBase32>::Err>
fn write_base32<W: WriteBase32>(
&self,
writer: &mut W
) -> Result<(), <W as WriteBase32>::Err>
Encode as base32 and write it to the supplied writer Implementations shouldn’t allocate. Read more
impl Eq for ExpiryTime
impl StructuralEq for ExpiryTime
impl StructuralPartialEq for ExpiryTime
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more