pub enum DropResource {
Fun(Option<Box<dyn FnOnce()>>),
Struct(Box<dyn Any>),
}Expand description
A struct used by driver to tidy things up on javascript side after a rust object goes out of scope.
Variants§
Implementations§
Source§impl DropResource
impl DropResource
pub fn new<F: FnOnce() + 'static>(drop_fun: F) -> DropResource
pub fn from_struct(inst: impl Any) -> DropResource
pub fn off(self)
Trait Implementations§
Source§impl Drop for DropResource
impl Drop for DropResource
Source§impl PartialEq for DropResource
impl PartialEq for DropResource
Auto Trait Implementations§
impl Freeze for DropResource
impl !RefUnwindSafe for DropResource
impl !Send for DropResource
impl !Sync for DropResource
impl Unpin for DropResource
impl UnsafeUnpin for DropResource
impl !UnwindSafe for DropResource
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