pub struct DateTime { /* private fields */ }Expand description
Represents a date and time (pointer-backed wxDateTime).
Implementations§
Source§impl DateTime
impl DateTime
Sourcepub fn new(
year: i32,
month: u16,
day: i16,
hour: i16,
minute: i16,
second: i16,
) -> Self
pub fn new( year: i32, month: u16, day: i16, hour: i16, minute: i16, second: i16, ) -> Self
Creates a new DateTime from individual components.
Note: month is 1-12 (January = 1).
Sourcepub fn as_const_ptr(&self) -> *const wxd_DateTime_t
pub fn as_const_ptr(&self) -> *const wxd_DateTime_t
Returns a const raw pointer to the underlying wxd_DateTime_t.
Ownership notes:
- This does not transfer ownership; the pointer is only valid while this
DateTime(or another owner) keeps it alive. - Do not destroy this pointer yourself; the owner handles destruction or transfer via
into_raw_mut.
Sourcepub fn as_mut_ptr(&mut self) -> *mut wxd_DateTime_t
pub fn as_mut_ptr(&mut self) -> *mut wxd_DateTime_t
Returns a mutable raw pointer to the underlying wxd_DateTime_t.
Use with care; prefer safe methods when possible.
Ownership notes:
- This does not transfer ownership. If you mutate through this pointer, ensure exclusive access and maintain invariants.
- Do not destroy the returned pointer; use
into_raw_mutto transfer ownership when needed.
Sourcepub fn into_raw_mut(self) -> *mut wxd_DateTime_t
pub fn into_raw_mut(self) -> *mut wxd_DateTime_t
Consumes self and returns a raw mutable pointer, transferring ownership to the caller.
After calling this, you must NOT use the original DateTime again.
Caller responsibilities:
- You now own the pointer and must destroy it exactly once with
wxd_DateTime_Destroy. - Ensure no use-after-free.
Sourcepub fn into_raw_const(self) -> *const wxd_DateTime_t
pub fn into_raw_const(self) -> *const wxd_DateTime_t
Consumes a borrowed (non-owning) wrapper and returns a raw const pointer without taking ownership.
Panics if called on an owning wrapper to avoid leaking the owned resource.
Caller responsibilities:
- This does NOT transfer ownership; do not destroy the returned pointer.
- The pointer remains valid only while the original owner keeps it alive.
pub fn year(&self) -> i32
pub fn day(&self) -> i16
pub fn hour(&self) -> i16
pub fn minute(&self) -> i16
pub fn second(&self) -> i16
Trait Implementations§
Source§impl From<*const wxd_DateTime_t> for DateTime
impl From<*const wxd_DateTime_t> for DateTime
Source§fn from(ptr: *const wxd_DateTime_t) -> Self
fn from(ptr: *const wxd_DateTime_t) -> Self
Converts to this type from the input type.
Source§impl From<*mut wxd_DateTime_t> for DateTime
impl From<*mut wxd_DateTime_t> for DateTime
Source§fn from(ptr: *mut wxd_DateTime_t) -> Self
fn from(ptr: *mut wxd_DateTime_t) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Send for DateTime
impl !Sync for DateTime
impl Freeze for DateTime
impl RefUnwindSafe for DateTime
impl Unpin for DateTime
impl UnsafeUnpin for DateTime
impl UnwindSafe for DateTime
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