pub struct SuspendCompleter { /* private fields */ }Expand description
A suspend completer for fdf_env_driver_suspend that can call any kind of callback.
§Safety
This object relies on a specific layout to allow it to be cast between a
*mut fdf_env_suspend_completer_t and a *mut SuspendCompleter. To that end,
it is important that this struct stay both #[repr(C)] and that completer be its first member.
Implementations§
Source§impl SuspendCompleter
impl SuspendCompleter
Sourcepub fn new<F: SuspendCompleterFn>(f: F) -> Self
pub fn new<F: SuspendCompleterFn>(f: F) -> Self
Creates a new SuspendCompleter with f as the callback to run when the runtime finishes suspending.
Sourcepub fn into_ptr(self) -> *mut fdf_env_suspend_completer_t
pub fn into_ptr(self) -> *mut fdf_env_suspend_completer_t
Turns this object into a stable pointer suitable for passing to
fdf_env_driver_suspend by wrapping it in a Box and leaking it to be reconstituded
by Self::handler when the runtime finishes suspending.
Auto Trait Implementations§
impl Freeze for SuspendCompleter
impl !RefUnwindSafe for SuspendCompleter
impl Send for SuspendCompleter
impl Sync for SuspendCompleter
impl Unpin for SuspendCompleter
impl UnsafeUnpin for SuspendCompleter
impl !UnwindSafe for SuspendCompleter
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