# FerroPropertyRegistry

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/struct-ferropropertyregistry/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct FerroPropertyRegistry
```

Tracks registered property definitions.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L30)

## Members

- [`instance`](#function-instance)
- [`unregister_by_module`](#function-unregister_by_module)
- [`get_registered`](#function-get_registered)
- [`get_registered_attached`](#function-get_registered_attached)
- [`get_registered_direct`](#function-get_registered_direct)
- [`get_registered_inherited`](#function-get_registered_inherited)
- [`get_declared`](#function-get_declared)
- [`get_registered_for`](#function-get_registered_for)
- [`get_registered_direct_for`](#function-get_registered_direct_for)
- [`find_registered_direct`](#function-find_registered_direct)
- [`find_registered`](#function-find_registered)
- [`find_registered_for`](#function-find_registered_for)
- [`find_registered_by_id`](#function-find_registered_by_id)
- [`is_registered`](#function-is_registered)
- [`is_registered_for`](#function-is_registered_for)
- [`register`](#function-register)
- [`register_attached`](#function-register_attached)

<a id="function-instance"></a>

### instance

```rust
fn instance() -> &'static FerroPropertyRegistry
```

The property registry of the current thread.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L61)

<a id="function-unregister_by_module"></a>

### unregister_by_module

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L79)

<a id="function-get_registered"></a>

### get_registered

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L112)

<a id="function-get_registered_attached"></a>

### get_registered_attached

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L130)

<a id="function-get_registered_direct"></a>

### get_registered_direct

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L144)

<a id="function-get_registered_inherited"></a>

### get_registered_inherited

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L168)

<a id="function-get_declared"></a>

### get_declared

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L188)

<a id="function-get_registered_for"></a>

### get_registered_for

```rust
fn get_registered_for(self: &Self, o: &FerroObject) -> std::rc::Rc<Vec<&'static crate::FerroProperty>>
```

Gets all properties registered on an object's type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L196)

<a id="function-get_registered_direct_for"></a>

### get_registered_direct_for

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L204)

<a id="function-find_registered_direct"></a>

### find_registered_direct

```rust
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`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L216)

<a id="function-find_registered"></a>

### find_registered

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L256)

<a id="function-find_registered_for"></a>

### find_registered_for

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L262)

<a id="function-find_registered_by_id"></a>

### find_registered_by_id

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

Finds a registered property by its ID.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L267)

<a id="function-is_registered"></a>

### is_registered

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L272)

<a id="function-is_registered_for"></a>

### is_registered_for

```rust
fn is_registered_for(self: &Self, o: &FerroObject, property: &FerroProperty) -> bool
```

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L278)

<a id="function-register"></a>

### register

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L286)

<a id="function-register_attached"></a>

### register_attached

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

Registers an attached property on a host type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_property_registry.rs#L311)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `Default`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
