pub struct IniSessionDate { /* private fields */ }Expand description
A Gregorian date that Dear ImGui can round-trip through ImGuiPackedDate.
Dear ImGui stores the year in seven bits as an offset from 2000, with zero reserved for an invalid date. The safe range is therefore 2001 through 2127 inclusive.
Implementations§
Source§impl IniSessionDate
impl IniSessionDate
Sourcepub fn new(year: u16, month: u8, day: u8) -> Result<Self, IniSessionDateError>
pub fn new(year: u16, month: u8, day: u8) -> Result<Self, IniSessionDateError>
Creates a date that is representable by Dear ImGui’s packed .ini format.
Sourcepub const fn as_yyyymmdd(self) -> u32
pub const fn as_yyyymmdd(self) -> u32
Returns the YYYYMMDD representation consumed by Dear ImGui.
Sourcepub const fn max_auto_discard_months(self) -> u16
pub const fn max_auto_discard_months(self) -> u16
Returns the largest safe automatic-discard period for this date.
Dear ImGui subtracts whole months without guarding the packed year against underflow.
Trait Implementations§
Source§impl Clone for IniSessionDate
impl Clone for IniSessionDate
Source§fn clone(&self) -> IniSessionDate
fn clone(&self) -> IniSessionDate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for IniSessionDate
Source§impl Debug for IniSessionDate
impl Debug for IniSessionDate
Source§impl Display for IniSessionDate
impl Display for IniSessionDate
impl Eq for IniSessionDate
Source§impl From<IniSessionDate> for u32
impl From<IniSessionDate> for u32
Source§fn from(value: IniSessionDate) -> Self
fn from(value: IniSessionDate) -> Self
Converts to this type from the input type.
Source§impl Hash for IniSessionDate
impl Hash for IniSessionDate
Source§impl Ord for IniSessionDate
impl Ord for IniSessionDate
Source§fn cmp(&self, other: &IniSessionDate) -> Ordering
fn cmp(&self, other: &IniSessionDate) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for IniSessionDate
impl PartialEq for IniSessionDate
Source§impl PartialOrd for IniSessionDate
impl PartialOrd for IniSessionDate
impl StructuralPartialEq for IniSessionDate
Auto Trait Implementations§
impl Freeze for IniSessionDate
impl RefUnwindSafe for IniSessionDate
impl Send for IniSessionDate
impl Sync for IniSessionDate
impl Unpin for IniSessionDate
impl UnsafeUnpin for IniSessionDate
impl UnwindSafe for IniSessionDate
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