FerroPropertyRegistry
struct · ferroui-base · v0.5.0
struct FerroPropertyRegistry
Tracks registered property definitions.
Members
instanceunregister_by_moduleget_registeredget_registered_attachedget_registered_directget_registered_inheritedget_declaredget_registered_forget_registered_direct_forfind_registered_directfind_registeredfind_registered_forfind_registered_by_idis_registeredis_registered_forregisterregister_attached
instance
fn instance() -> &'static FerroPropertyRegistry
The property registry of the current thread.
unregister_by_module
fn unregister_by_module(self: &Self, types: impl IntoIterator<Item = &'static TypeInfo>) -> bool
Unregisters the properties of the given types: removes the metadata every registered, attached and direct property holds for each type, and the property lists cached for it.
Returns whether the types were unregistered. (The managed original returns false when unregistering throws; nothing fails here.)
get_registered
fn get_registered(self: &Self, type_: &'static TypeInfo) -> std::rc::Rc<Vec<&'static crate::FerroProperty>>
Gets all non-attached properties registered on a type (and its bases).
get_registered_attached
fn get_registered_attached(self: &Self, type_: &'static TypeInfo) -> std::rc::Rc<Vec<&'static crate::FerroProperty>>
Gets all attached properties registered on a type (and its bases).
get_registered_direct
fn get_registered_direct(self: &Self, type_: &'static TypeInfo) -> std::rc::Rc<Vec<&'static crate::FerroProperty>>
Gets all direct properties registered on a type (and its bases).
get_registered_inherited
fn get_registered_inherited(self: &Self, type_: &'static TypeInfo) -> std::rc::Rc<Vec<&'static crate::FerroProperty>>
Gets all inherited properties registered on a type: registered and attached properties whose values are inherited.
get_declared
fn get_declared(self: &Self, type_: &'static TypeInfo) -> Vec<&'static FerroProperty>
Gets the properties a type itself declares (registered with the type as owner: styled, direct, attached and added-owner properties), in declaration order, without those of its base types.
get_registered_for
fn get_registered_for(self: &Self, o: &FerroObject) -> std::rc::Rc<Vec<&'static crate::FerroProperty>>
Gets all properties registered on an object's type.
get_registered_direct_for
fn get_registered_direct_for<T: PropertyValue>(self: &Self, o: &FerroObject, property: &'static DirectPropertyBase<T>) -> &'static DirectPropertyBase<T>
Finds the direct property registered on the type of o that shares
the identity of property.
Panics if the property is not registered on the object's type.
find_registered_direct
fn find_registered_direct<T: PropertyValue>(self: &Self, o: &FerroObject, property: &'static DirectPropertyBase<T>) -> Option<&'static DirectPropertyBase<T>>
Finds the direct property registered on the type of o that shares
the identity of property.
find_registered
fn find_registered(self: &Self, type_: &'static TypeInfo, name: &str) -> Option<&'static FerroProperty>
Finds a registered property on a type by name.
Panics if name contains a .: attached properties are not looked up
through this method.
find_registered_for
fn find_registered_for(self: &Self, o: &FerroObject, name: &str) -> Option<&'static FerroProperty>
Finds a registered property on an object's type by name.
find_registered_by_id
fn find_registered_by_id(self: &Self, id: u32) -> Option<&'static FerroProperty>
Finds a registered property by its ID.
is_registered
fn is_registered(self: &Self, type_: &'static TypeInfo, property: &FerroProperty) -> bool
Checks whether a property is registered on a type (or its bases).
is_registered_for
fn is_registered_for(self: &Self, o: &FerroObject, property: &FerroProperty) -> bool
Checks whether a property is registered on an object's type.
register
fn register<P: Registrable>(self: &Self, type_: &'static TypeInfo, property: &'static P)
Registers a property on a type.
You won't usually want to call this method directly; use the
FerroProperty::register* functions instead.
register_attached
fn register_attached<P: Registrable>(self: &Self, type_: &'static TypeInfo, property: &'static P)
Registers an attached property on a host type.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.