#[repr(transparent)]pub struct Date { /* private fields */ }
Implementations
sourceimpl Date
impl Date
pub fn from_dmy(
day: DateDay,
month: DateMonth,
year: DateYear
) -> Result<Date, BoolError>
pub fn from_julian(julian_day: u32) -> Result<Date, BoolError>
pub fn add_days(&mut self, n_days: u32) -> Result<(), BoolError>
pub fn add_months(&mut self, n_months: u32) -> Result<(), BoolError>
pub fn add_years(&mut self, n_years: u16) -> Result<(), BoolError>
pub fn clamp(
&mut self,
min_date: &Date,
max_date: &Date
) -> Result<(), BoolError>
pub fn days_between(&self, date2: &Date) -> i32
pub fn day(&self) -> DateDay
pub fn day_of_year(&self) -> u32
pub fn iso8601_week_of_year(&self) -> u32
pub fn julian(&self) -> u32
pub fn monday_week_of_year(&self) -> u32
pub fn month(&self) -> DateMonth
pub fn sunday_week_of_year(&self) -> u32
pub fn weekday(&self) -> DateWeekday
pub fn year(&self) -> DateYear
pub fn is_first_of_month(&self) -> bool
pub fn is_last_of_month(&self) -> bool
pub fn order(&mut self, date2: &mut Date)
pub fn set_day(&mut self, day: DateDay) -> Result<(), BoolError>
pub fn set_dmy(
&mut self,
day: DateDay,
month: DateMonth,
y: DateYear
) -> Result<(), BoolError>
pub fn set_julian(&mut self, julian_date: u32) -> Result<(), BoolError>
pub fn set_month(&mut self, month: DateMonth) -> Result<(), BoolError>
pub fn set_parse(&mut self, str: &str) -> Result<(), BoolError>
pub fn set_time(&mut self, time_: u32) -> Result<(), BoolError>
pub fn set_year(&mut self, year: DateYear) -> Result<(), BoolError>
pub fn subtract_days(&mut self, n_days: u32) -> Result<(), BoolError>
pub fn subtract_months(&mut self, n_months: u32) -> Result<(), BoolError>
pub fn subtract_years(&mut self, n_years: u16) -> Result<(), BoolError>
pub fn valid(&self) -> bool
pub fn days_in_month(month: DateMonth, year: DateYear) -> u8
pub fn monday_weeks_in_year(year: DateYear) -> u8
pub fn sunday_weeks_in_year(year: DateYear) -> u8
pub fn is_leap_year(year: DateYear) -> bool
pub fn strftime(s: &str, format: &str, date: &Date) -> usize
pub fn valid_day(day: DateDay) -> bool
pub fn valid_dmy(day: DateDay, month: DateMonth, year: DateYear) -> bool
pub fn valid_julian(julian_date: u32) -> bool
pub fn valid_month(month: DateMonth) -> bool
pub fn valid_weekday(weekday: DateWeekday) -> bool
pub fn valid_year(year: DateYear) -> bool
Trait Implementations
sourceimpl Ord for Date
impl Ord for Date
sourceimpl PartialOrd<Date> for Date
impl PartialOrd<Date> for Date
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl StaticType for Date
impl StaticType for Date
sourcefn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of Self
.
impl Copy for Date
impl Eq for Date
impl Send for Date
impl Sync for Date
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> StaticTypeExt for T where
T: StaticType,
impl<T> StaticTypeExt for T where
T: StaticType,
sourcefn ensure_type()
fn ensure_type()
Ensures that the type has been registered with the type system.
sourceimpl<T> ToClosureReturnValue for T where
T: ToValue,
impl<T> ToClosureReturnValue for T where
T: ToValue,
fn to_closure_return_value(&self) -> Option<Value>
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.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> ToSendValue for T where
T: Send + ToValue + ?Sized,
impl<T> ToSendValue for T where
T: Send + ToValue + ?Sized,
sourcefn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
Returns a SendValue
clone of self
.