FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    upcast

    fn upcast<U: ObjectType>(self: Self) -> Ref<U>
    where T: Upcast<U>
    

    Converts the handle to a handle of a base class.

    Source

    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).

    Source

    cast

    fn cast<U: ObjectType>(self: &Self) -> Option<Ref<U>>
    

    Returns a handle of class U if the object is a U.

    Source

    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.

    Source

    is

    fn is<U: ObjectType>(self: &Self) -> bool
    

    Whether the object is of class U or a class derived from it.

    Source

    downgrade

    fn downgrade(self: &Self) -> WeakRef<T>
    

    Creates a weak reference to the object.

    Source

    ptr_eq

    fn ptr_eq<U: ObjectType>(self: &Self, other: &Ref<U>) -> bool
    

    Whether two handles refer to the same object.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ResourceKeyObject
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Receiver
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • From<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>>
    • WeakEventSender
    • Deref
    • Clone
    • PartialEq<Ref<U>>
    • Eq
    • Hash
    • Debug
    • IntoRef<U>

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.