Ref
struct · ferroui-base · v0.5.0
struct Ref<T: ObjectType>
A strong reference to an object of class T or a class derived from it.
Cloning the handle shares the object. Equality and hashing are by object identity.
Members
upcast
fn upcast<U: ObjectType>(self: Self) -> Ref<U>
where T: Upcast<U>
Converts the handle to a handle of a base class.
upcast_ref
fn upcast_ref<U: ObjectType>(self: &Self) -> &Ref<U>
where T: Upcast<U>
Borrows the handle as a handle of a base class, without a copy of the
handle (the borrowing form of upcast).
cast
fn cast<U: ObjectType>(self: &Self) -> Option<Ref<U>>
Returns a handle of class U if the object is a U.
downcast
fn downcast<U: ObjectType>(self: Self) -> Result<Ref<U>, Self>
Converts the handle to class U if the object is a U, otherwise
returns the handle unchanged.
is
fn is<U: ObjectType>(self: &Self) -> bool
Whether the object is of class U or a class derived from it.
downgrade
fn downgrade(self: &Self) -> WeakRef<T>
Creates a weak reference to the object.
ptr_eq
fn ptr_eq<U: ObjectType>(self: &Self, other: &Ref<U>) -> bool
Whether two handles refer to the same object.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeResourceKeyObjectPropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyToOwnedErasedDestructorIntoEitherFrom<Ref<Animation>>From<&Ref<Animation>>From<Ref<T>>From<&Ref<T>>From<Ref<CroppedBitmap>>From<&Ref<CroppedBitmap>>FromIterator<Ref<Geometry>>FromIterator<Ref<GradientStop>>FromIterator<Ref<PathFigure>>FromIterator<Ref<PathSegment>>FromIterator<Ref<Transform>>FromIterator<Ref<Drawing>>From<Ref<DrawingImage>>From<&Ref<DrawingImage>>FromIterator<Ref<TextDecoration>>From<Ref<StyleBase>>From<&Ref<StyleBase>>From<Ref<Styles>>From<&Ref<Styles>>WeakEventSenderDerefClonePartialEq<Ref<U>>EqHashDebugIntoRef<U>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.