Skip to main content

FerroPropertyRegistry

Struct FerroPropertyRegistry 

Source
pub struct FerroPropertyRegistry { /* private fields */ }
Expand description

Tracks registered property definitions.

Implementations§

Source§

impl FerroPropertyRegistry

Source

pub fn instance() -> &'static FerroPropertyRegistry

The property registry of the current thread.

Source

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

Source

pub fn get_registered( &self, type_: &'static TypeInfo, ) -> Rc<Vec<&'static FerroProperty>>

Gets all non-attached properties registered on a type (and its bases).

Source

pub fn get_registered_attached( &self, type_: &'static TypeInfo, ) -> Rc<Vec<&'static FerroProperty>>

Gets all attached properties registered on a type (and its bases).

Source

pub fn get_registered_direct( &self, type_: &'static TypeInfo, ) -> Rc<Vec<&'static FerroProperty>>

Gets all direct properties registered on a type (and its bases).

Source

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.

Source

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.

Source

pub fn get_registered_for( &self, o: &FerroObject, ) -> Rc<Vec<&'static FerroProperty>>

Gets all properties registered on an object’s type.

Source

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.

Source

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.

Source

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.

Source

pub fn find_registered_for( &self, o: &FerroObject, name: &str, ) -> Option<&'static FerroProperty>

Finds a registered property on an object’s type by name.

Source

pub fn find_registered_by_id(&self, id: u32) -> Option<&'static FerroProperty>

Finds a registered property by its ID.

Source

pub fn is_registered( &self, type_: &'static TypeInfo, property: &FerroProperty, ) -> bool

Checks whether a property is registered on a type (or its bases).

Source

pub fn is_registered_for( &self, o: &FerroObject, property: &FerroProperty, ) -> bool

Checks whether a property is registered on an object’s type.

Source

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.

Source

pub fn register_attached<P: Registrable>( &self, type_: &'static TypeInfo, property: &'static P, )

Registers an attached property on a host type.

Trait Implementations§

Source§

impl Default for FerroPropertyRegistry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.