pub struct ObjectImplRef<T>(/* private fields */)
where
T: ObjectSubclass;Expand description
Reference-counted wrapper around an ObjectSubclass reference.
This can be used for passing into closures as strong or weak reference without manually going from the implementation type to the instance type and back.
Implementations§
Source§impl<T> ObjectImplRef<T>where
T: ObjectSubclass,
impl<T> ObjectImplRef<T>where
T: ObjectSubclass,
Sourcepub fn new(imp: &T) -> ObjectImplRef<T>
pub fn new(imp: &T) -> ObjectImplRef<T>
Create a new reference-counting wrapper around imp.
Sourcepub fn downgrade(&self) -> ObjectImplWeakRef<T>
pub fn downgrade(&self) -> ObjectImplWeakRef<T>
Downgrade to a weak reference.
This can be upgraded to a strong reference again via ObjectImplWeakRef::upgrade.
Trait Implementations§
Source§impl<T> Clone for ObjectImplRef<T>where
T: ObjectSubclass,
impl<T> Clone for ObjectImplRef<T>where
T: ObjectSubclass,
Source§fn clone(&self) -> ObjectImplRef<T>
fn clone(&self) -> ObjectImplRef<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for ObjectImplRef<T>where
T: ObjectSubclass,
impl<T> Debug for ObjectImplRef<T>where
T: ObjectSubclass,
Source§impl<T> Deref for ObjectImplRef<T>where
T: ObjectSubclass,
impl<T> Deref for ObjectImplRef<T>where
T: ObjectSubclass,
Source§impl<T> Downgrade for ObjectImplRef<T>where
T: ObjectSubclass,
impl<T> Downgrade for ObjectImplRef<T>where
T: ObjectSubclass,
Source§type Weak = ObjectImplWeakRef<T>
type Weak = ObjectImplWeakRef<T>
Weak reference type.
Source§impl<T> Hash for ObjectImplRef<T>where
T: ObjectSubclass,
impl<T> Hash for ObjectImplRef<T>where
T: ObjectSubclass,
Source§impl<T> Ord for ObjectImplRef<T>where
T: ObjectSubclass,
impl<T> Ord for ObjectImplRef<T>where
T: ObjectSubclass,
Source§fn cmp(&self, other: &ObjectImplRef<T>) -> Ordering
fn cmp(&self, other: &ObjectImplRef<T>) -> Ordering
1.21.0 · 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<T, OT> PartialEq<OT> for ObjectImplRef<T>
impl<T, OT> PartialEq<OT> for ObjectImplRef<T>
Source§impl<T> PartialEq for ObjectImplRef<T>where
T: ObjectSubclass,
impl<T> PartialEq for ObjectImplRef<T>where
T: ObjectSubclass,
Source§impl<T, OT> PartialOrd<OT> for ObjectImplRef<T>
impl<T, OT> PartialOrd<OT> for ObjectImplRef<T>
Source§impl<T> PartialOrd for ObjectImplRef<T>where
T: ObjectSubclass,
impl<T> PartialOrd for ObjectImplRef<T>where
T: ObjectSubclass,
impl<T> Eq for ObjectImplRef<T>where
T: ObjectSubclass,
impl<T> Send for ObjectImplRef<T>
impl<T> Sync for ObjectImplRef<T>
Auto Trait Implementations§
impl<T> Freeze for ObjectImplRef<T>
impl<T> RefUnwindSafe for ObjectImplRef<T>
impl<T> Unpin for ObjectImplRef<T>
impl<T> UnwindSafe for ObjectImplRef<T>
Blanket Implementations§
Source§impl<C> AsyncPosition<()> for C
impl<C> AsyncPosition<()> for C
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