pub struct LoraDuration {
pub months: i64,
pub days: i64,
pub seconds: i64,
pub nanoseconds: i64,
}Fields§
§months: i64§days: i64§seconds: i64§nanoseconds: i64Implementations§
Source§impl LoraDuration
impl LoraDuration
pub fn zero() -> Self
pub fn parse(s: &str) -> Result<Self, String>
pub fn negate(&self) -> Self
pub fn add(&self, other: &Self) -> Self
pub fn mul_int(&self, n: i64) -> Self
pub fn div_int(&self, n: i64) -> Self
Sourcepub fn between_dates(from: &LoraDate, to: &LoraDate) -> Self
pub fn between_dates(from: &LoraDate, to: &LoraDate) -> Self
Duration from date1 to date2 expressed as months + days.
Sourcepub fn in_days(from: &LoraDate, to: &LoraDate) -> Self
pub fn in_days(from: &LoraDate, to: &LoraDate) -> Self
Duration from date1 to date2 expressed purely in days.
Sourcepub fn between_datetimes(from: &LoraDateTime, to: &LoraDateTime) -> Self
pub fn between_datetimes(from: &LoraDateTime, to: &LoraDateTime) -> Self
Duration between two datetimes, expressed in days + seconds.
Sourcepub fn total_seconds_approx(&self) -> f64
pub fn total_seconds_approx(&self) -> f64
Approximate total seconds for ordering purposes.
pub fn years_component(&self) -> i64
pub fn months_component(&self) -> i64
pub fn days_component(&self) -> i64
pub fn hours_component(&self) -> i64
pub fn minutes_component(&self) -> i64
pub fn seconds_component(&self) -> i64
Trait Implementations§
Source§impl Clone for LoraDuration
impl Clone for LoraDuration
Source§fn clone(&self) -> LoraDuration
fn clone(&self) -> LoraDuration
Returns a duplicate 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 LoraDuration
impl Debug for LoraDuration
Source§impl Display for LoraDuration
impl Display for LoraDuration
Source§impl Ord for LoraDuration
impl Ord for LoraDuration
Source§impl PartialEq for LoraDuration
impl PartialEq for LoraDuration
Source§impl PartialOrd for LoraDuration
impl PartialOrd for LoraDuration
impl Eq for LoraDuration
impl StructuralPartialEq for LoraDuration
Auto Trait Implementations§
impl Freeze for LoraDuration
impl RefUnwindSafe for LoraDuration
impl Send for LoraDuration
impl Sync for LoraDuration
impl Unpin for LoraDuration
impl UnsafeUnpin for LoraDuration
impl UnwindSafe for LoraDuration
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