Struct glib::object::WeakRefNotify
source · pub struct WeakRefNotify<T: ObjectType> {
object: WeakRef<T>,
data: ManuallyDrop<Pin<Box<Box<dyn FnOnce() + 'static>>>>,
}
Expand description
A handle to disconnect a weak ref notify closure.
Fields§
§object: WeakRef<T>
§data: ManuallyDrop<Pin<Box<Box<dyn FnOnce() + 'static>>>>
Implementations§
source§impl<T: ObjectType> WeakRefNotify<T>
impl<T: ObjectType> WeakRefNotify<T>
fn new<F: FnOnce() + 'static>(obj: &T, f: F) -> WeakRefNotify<T>
sourcepub fn upgrade(&self) -> Option<T>
pub fn upgrade(&self) -> Option<T>
Try to upgrade this weak reference to a strong reference.
If the stored object was already destroyed then None
is returned.
pub fn disconnect(self)
Auto Trait Implementations§
impl<T> Freeze for WeakRefNotify<T>
impl<T> !RefUnwindSafe for WeakRefNotify<T>
impl<T> !Send for WeakRefNotify<T>
impl<T> !Sync for WeakRefNotify<T>
impl<T> Unpin for WeakRefNotify<T>
impl<T> !UnwindSafe for WeakRefNotify<T>
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