# XamlGroup

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-build/struct-xamlgroup/

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

```rust
struct XamlGroup
```

A group of documents that are compiled together into one module: the group
transformers see every document of it, so includes between them are linked, as
upstream compiles the documents of an assembly.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/lib.rs#L254)

## Members

- [`new`](#function-new)
- [`class_document`](#function-class_document)
- [`constructor`](#function-constructor)
- [`documents`](#function-documents)
- [`create_source_info`](#function-create_source_info)
- [`internal`](#function-internal)

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

### new

```rust
fn new(module: &str) -> Self
```

A group whose generated file is the body of the module `module` of the crate
root. Without `documents` the group is every `.xaml` file
below the XAML root of the build.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/lib.rs#L285)

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

### class_document

```rust
fn class_document(self: Self, name: &str) -> Self
```

Makes the group the group of a class of the crate: `name` (its path below the root
URI of the assembly) is the document of the class its root names with `x:Class`,
and the group is that document with every document of the group it includes,
directly or not. The generated file is the file of the class
(`rust_emitter::generate_class_file`): `populate`, which the constructor of the
class calls, the build functions of the included documents and the loader table.
Its module is declared at the crate root like the module of any group
(`crate::<module>::populate`).

Only with `TypeSystem::Model`: the class is a type of the crate being built.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/lib.rs#L299)

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

### constructor

```rust
fn constructor(self: Self, constructor: ClassConstructor) -> Self
```

The constructor the loader table creates the class of a class group with. Without
the call the compiler picks it as upstream's does: a public parameterless
constructor, else a public constructor that takes the service provider.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/lib.rs#L307)

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

### documents

```rust
fn documents(self: Self, documents: &[(&str, &str)]) -> Self
```

The documents of the group, by their path below the root URI of the assembly
(`Views/Main.xaml`), in the order they are compiled. The build script states the
files they come from with `Build::input`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/lib.rs#L315)

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

### create_source_info

```rust
fn create_source_info(self: Self, value: bool) -> Self
```

Whether the documents are compiled with source information (`CreateSourceInfo`);
without the call, as the assembly states it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/lib.rs#L322)

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

### internal

```rust
fn internal(self: Self) -> Self
```

Keeps the group out of the loader table and of the `.xamlmeta` of the crate: its
documents are reached by their build functions only (a second compilation of
documents another group registers, as a test compiles them).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/lib.rs#L330)

## Trait implementations

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

## Availability

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