Struct rust_persian_tools::time_diff::TimeDiff
source · pub struct TimeDiff {
pub years: u32,
pub months: u8,
pub days: u8,
pub hours: u8,
pub minutes: u8,
pub seconds: u8,
pub is_future: bool,
}
Expand description
The TimeDiff stuct has two main methods: short_form()
& long_form()
the short_form()
returns a short desciption about time diffrence
- 5 دقیقه قبل
- حدود 2 هفته بعد
the long_form()
returns a long and exact desciption about time diffrence
- 6 سال و 6 ماه و 10 روز و 12 دقیقه و 37 ثانیه بعد
also there are more methods to return long_from and short with arabic or persian digits
- short_form_fa_digits()
- short_form_ar_digits()
- long_form_fa_digits()
- long_form_ar_digits()
Fields§
§years: u32
§months: u8
§days: u8
§hours: u8
§minutes: u8
§seconds: u8
§is_future: bool
Implementations§
source§impl TimeDiff
impl TimeDiff
pub fn long_form(&self) -> String
pub fn short_form(&self) -> String
pub fn short_form_fa_digits(&self) -> String
pub fn long_form_fa_digits(&self) -> String
pub fn short_form_ar_digits(&self) -> String
pub fn long_form_ar_digits(&self) -> String
pub fn pre_or_next(&self) -> String
Trait Implementations§
source§impl PartialEq for TimeDiff
impl PartialEq for TimeDiff
impl Copy for TimeDiff
impl Eq for TimeDiff
impl StructuralPartialEq for TimeDiff
Auto Trait Implementations§
impl RefUnwindSafe for TimeDiff
impl Send for TimeDiff
impl Sync for TimeDiff
impl Unpin for TimeDiff
impl UnwindSafe for TimeDiff
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