pub struct FerroPropertyRegistry { /* private fields */ }Expand description
Tracks registered property definitions.
Implementations§
Source§impl FerroPropertyRegistry
impl FerroPropertyRegistry
Sourcepub fn instance() -> &'static FerroPropertyRegistry
pub fn instance() -> &'static FerroPropertyRegistry
The property registry of the current thread.
Sourcepub fn unregister_by_module(
&self,
types: impl IntoIterator<Item = &'static TypeInfo>,
) -> bool
pub fn unregister_by_module( &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.)
Sourcepub fn get_registered(
&self,
type_: &'static TypeInfo,
) -> Rc<Vec<&'static FerroProperty>>
pub fn get_registered( &self, type_: &'static TypeInfo, ) -> Rc<Vec<&'static FerroProperty>>
Gets all non-attached properties registered on a type (and its bases).
Sourcepub fn get_registered_attached(
&self,
type_: &'static TypeInfo,
) -> Rc<Vec<&'static FerroProperty>>
pub fn get_registered_attached( &self, type_: &'static TypeInfo, ) -> Rc<Vec<&'static FerroProperty>>
Gets all attached properties registered on a type (and its bases).
Sourcepub fn get_registered_direct(
&self,
type_: &'static TypeInfo,
) -> Rc<Vec<&'static FerroProperty>>
pub fn get_registered_direct( &self, type_: &'static TypeInfo, ) -> Rc<Vec<&'static FerroProperty>>
Gets all direct properties registered on a type (and its bases).
Sourcepub fn get_registered_inherited(
&self,
type_: &'static TypeInfo,
) -> Rc<Vec<&'static FerroProperty>>
pub fn get_registered_inherited( &self, type_: &'static TypeInfo, ) -> Rc<Vec<&'static FerroProperty>>
Gets all inherited properties registered on a type: registered and attached properties whose values are inherited.
Sourcepub fn get_declared(
&self,
type_: &'static TypeInfo,
) -> Vec<&'static FerroProperty>
pub fn get_declared( &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.
Sourcepub fn get_registered_for(
&self,
o: &FerroObject,
) -> Rc<Vec<&'static FerroProperty>>
pub fn get_registered_for( &self, o: &FerroObject, ) -> Rc<Vec<&'static FerroProperty>>
Gets all properties registered on an object’s type.
Sourcepub fn get_registered_direct_for<T: PropertyValue>(
&self,
o: &FerroObject,
property: &'static DirectPropertyBase<T>,
) -> &'static DirectPropertyBase<T>
pub fn get_registered_direct_for<T: PropertyValue>( &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.
Sourcepub fn find_registered_direct<T: PropertyValue>(
&self,
o: &FerroObject,
property: &'static DirectPropertyBase<T>,
) -> Option<&'static DirectPropertyBase<T>>
pub fn find_registered_direct<T: PropertyValue>( &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.
Sourcepub fn find_registered(
&self,
type_: &'static TypeInfo,
name: &str,
) -> Option<&'static FerroProperty>
pub fn find_registered( &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.
Sourcepub fn find_registered_for(
&self,
o: &FerroObject,
name: &str,
) -> Option<&'static FerroProperty>
pub fn find_registered_for( &self, o: &FerroObject, name: &str, ) -> Option<&'static FerroProperty>
Finds a registered property on an object’s type by name.
Sourcepub fn find_registered_by_id(&self, id: u32) -> Option<&'static FerroProperty>
pub fn find_registered_by_id(&self, id: u32) -> Option<&'static FerroProperty>
Finds a registered property by its ID.
Sourcepub fn is_registered(
&self,
type_: &'static TypeInfo,
property: &FerroProperty,
) -> bool
pub fn is_registered( &self, type_: &'static TypeInfo, property: &FerroProperty, ) -> bool
Checks whether a property is registered on a type (or its bases).
Sourcepub fn is_registered_for(
&self,
o: &FerroObject,
property: &FerroProperty,
) -> bool
pub fn is_registered_for( &self, o: &FerroObject, property: &FerroProperty, ) -> bool
Checks whether a property is registered on an object’s type.
Sourcepub fn register<P: Registrable>(
&self,
type_: &'static TypeInfo,
property: &'static P,
)
pub fn register<P: Registrable>( &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.
Sourcepub fn register_attached<P: Registrable>(
&self,
type_: &'static TypeInfo,
property: &'static P,
)
pub fn register_attached<P: Registrable>( &self, type_: &'static TypeInfo, property: &'static P, )
Registers an attached property on a host type.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FerroPropertyRegistry
impl !RefUnwindSafe for FerroPropertyRegistry
impl !Send for FerroPropertyRegistry
impl !Sync for FerroPropertyRegistry
impl !UnwindSafe for FerroPropertyRegistry
impl Unpin for FerroPropertyRegistry
impl UnsafeUnpin for FerroPropertyRegistry
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more