# MarkupAssembly

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

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

```rust
struct MarkupAssembly
```

What a crate states about itself for markup: the assembly name its
types are addressed by (`using:Ns;assembly=FerroUI.Controls`, asset
URIs) and its XML namespace definitions.

A crate declares one as a constant and registers it from its
`register_types()` function. A type belongs to the assembly whose
`crate_name` is the first segment of the module path
of the type.

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

## Members

- [`name`](#struct_field-name)
- [`crate_name`](#struct_field-crate_name)
- [`xmlns_definitions`](#struct_field-xmlns_definitions)
- [`xmlns_prefixes`](#struct_field-xmlns_prefixes)
- [`metadata`](#struct_field-metadata)
- [`CREATE_SOURCE_INFO`](#assoc_const-create_source_info)
- [`USE_COMPILED_BINDINGS_BY_DEFAULT`](#assoc_const-use_compiled_bindings_by_default)
- [`metadata_value`](#function-metadata_value)
- [`compiles_bindings_by_default`](#function-compiles_bindings_by_default)
- [`register`](#function-register)
- [`register_table`](#function-register_table)
- [`registered_assemblies`](#function-registered_assemblies)
- [`find`](#function-find)
- [`of_module`](#function-of_module)

<a id="struct_field-name"></a>

### name

```rust
name: &'static str
```

The assembly name (`FerroUI.Controls`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L41)

<a id="struct_field-crate_name"></a>

### crate_name

```rust
crate_name: &'static str
```

The crate, as module paths spell it (`ferroui_controls`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L43)

<a id="struct_field-xmlns_definitions"></a>

### xmlns_definitions

```rust
xmlns_definitions: &'static [XmlnsDefinition]
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L44)

<a id="struct_field-xmlns_prefixes"></a>

### xmlns_prefixes

```rust
xmlns_prefixes: &'static [XmlnsPrefix]
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L45)

<a id="struct_field-metadata"></a>

### metadata

```rust
metadata: &'static [(&'static str, &'static str)]
```

Key/value metadata of the assembly (the `AssemblyMetadata` attributes
of the managed original). The markup loader reads
`CREATE_SOURCE_INFO`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L49)

<a id="assoc_const-create_source_info"></a>

### CREATE_SOURCE_INFO

```rust
const CREATE_SOURCE_INFO: &'static str
```

The metadata key that states whether markup compiled for the
assembly records source information by default (`"true"`/`"false"`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L55)

<a id="assoc_const-use_compiled_bindings_by_default"></a>

### USE_COMPILED_BINDINGS_BY_DEFAULT

```rust
const USE_COMPILED_BINDINGS_BY_DEFAULT: &'static str
```

The metadata key that states whether `{Binding}` in markup of the
assembly is a compiled binding by default (`"True"`/`"False"`): the
`FerroUseCompiledBindingsByDefault` entry the build task of upstream writes
into every assembly it compiles markup for, with the value of its
`DefaultCompileBindings`. The previewer of the designer reads it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L62)

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

### metadata_value

```rust
fn metadata_value(self: &Self, key: &str) -> Option<&'static str>
```

The value of the metadata entry `key`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L65)

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

### compiles_bindings_by_default

```rust
fn compiles_bindings_by_default(self: &Self) -> bool
```

Whether `{Binding}` in markup of the assembly is a compiled binding by default, as the
build compiles it: the entry `USE_COMPILED_BINDINGS_BY_DEFAULT`
(`true` for `"True"` in any casing, with surrounding white space, and `false` for any
other value), and compiled bindings, the default of the build (#603), without the entry.

Not from upstream (#604): upstream reads `false` without the entry, which its build
always writes. The previewer of the designer and `RuntimeXamlLoaderConfiguration::for_assembly`
read this, so a previewed or reloaded document binds the way the built application does.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L77)

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

### register

```rust
fn register(assembly: &'static MarkupAssembly)
```

Adds an assembly to the process-wide table of assemblies.
Registering an assembly again does nothing.

Always registers. An application registers its own assembly with this
function; a crate of the framework registers its assembly with
`register_table`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L89)

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

### register_table

```rust
fn register_table(assembly: &'static MarkupAssembly)
```

Registers the assembly of a crate of the framework, at start-up from
the crate's `register_types()` function; as
`register`. Without the feature
`type-tables` the table is trimmed: this does nothing, and what only
the table reaches is left out of the binary. An application registers
its own assembly with `register`, which always
registers.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L102)

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

### registered_assemblies

```rust
fn registered_assemblies() -> Vec<&'static MarkupAssembly>
```

Every registered assembly, in registration order.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L121)

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

### find

```rust
fn find(name: &str) -> Option<&'static MarkupAssembly>
```

The registered assembly named `name`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L126)

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

### of_module

```rust
fn of_module(module_path: &str) -> Option<&'static MarkupAssembly>
```

The registered assembly that declares the module `module_path`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/metadata/markup_assembly.rs#L131)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`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`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`

## Availability

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