#[repr(C)]pub struct InstantPtr {
pub ptr: ManuallyDrop<Box<Instant>>,
pub clone_fn: InstantPtrCloneCallback,
pub destructor: InstantPtrDestructorCallback,
pub run_destructor: bool,
}Expand description
FFI-safe wrapper around std::time::Instant with custom clone/drop callbacks.
Allows crossing FFI boundaries while maintaining proper memory management.
Fields§
§ptr: ManuallyDrop<Box<Instant>>ManuallyDrop so the owned Box is freed ONLY when run_destructor is
still set (see Drop). The codegen FFI wrappers (AzTimerCallbackInfo
etc.) embed this by value AND have their own Drop that drop_in_places
the real type first; Rust’s drop glue would then drop this ptr field a
SECOND time on the same bytes. Gating the Box free on run_destructor
(cleared by the first drop) makes that second drop a safe no-op. Layout is
unchanged: ManuallyDrop<Box<T>> is one pointer, like the old Box<T>.
clone_fn: InstantPtrCloneCallback§destructor: InstantPtrDestructorCallback§run_destructor: boolTrait Implementations§
Source§impl Clone for InstantPtr
impl Clone for InstantPtr
Source§impl Debug for InstantPtr
Available on crate feature std only.
impl Debug for InstantPtr
Available on crate feature
std only.Source§impl Drop for InstantPtr
impl Drop for InstantPtr
impl Eq for InstantPtr
Source§impl From<Instant> for InstantPtr
Available on crate feature std only.
impl From<Instant> for InstantPtr
Available on crate feature
std only.Source§fn from(s: StdInstant) -> Self
fn from(s: StdInstant) -> Self
Converts to this type from the input type.
Source§impl From<InstantPtr> for Instant
Available on crate feature std only.
impl From<InstantPtr> for Instant
Available on crate feature
std only.Source§fn from(s: InstantPtr) -> Self
fn from(s: InstantPtr) -> Self
Converts to this type from the input type.
Source§impl Hash for InstantPtr
Available on crate feature std only.
impl Hash for InstantPtr
Available on crate feature
std only.Source§impl Ord for InstantPtr
Available on crate feature std only.
impl Ord for InstantPtr
Available on crate feature
std only.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 InstantPtr
Available on crate feature std only.
impl PartialEq for InstantPtr
Available on crate feature
std only.Source§impl PartialOrd for InstantPtr
Available on crate feature std only.
impl PartialOrd for InstantPtr
Available on crate feature
std only.Auto Trait Implementations§
impl Freeze for InstantPtr
impl RefUnwindSafe for InstantPtr
impl Send for InstantPtr
impl Sync for InstantPtr
impl Unpin for InstantPtr
impl UnsafeUnpin for InstantPtr
impl UnwindSafe for InstantPtr
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