# RuntimeXamlLoaderDocument

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-markup-xaml/struct-runtimexamlloaderdocument/

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

```rust
struct RuntimeXamlLoaderDocument
```

A markup document for the runtime XAML loader.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L10)

## Members

- [`base_uri`](#struct_field-base_uri)
- [`document`](#struct_field-document)
- [`root_instance`](#struct_field-root_instance)
- [`service_provider`](#struct_field-service_provider)
- [`new`](#function-new)
- [`with_base_uri`](#function-with_base_uri)
- [`with_root_instance`](#function-with_root_instance)
- [`with_base_uri_and_root_instance`](#function-with_base_uri_and_root_instance)
- [`from_stream`](#function-from_stream)
- [`from_stream_with_base_uri`](#function-from_stream_with_base_uri)
- [`from_stream_with_root_instance`](#function-from_stream_with_root_instance)
- [`from_stream_with_base_uri_and_root_instance`](#function-from_stream_with_base_uri_and_root_instance)
- [`xaml_stream`](#function-xaml_stream)
- [`read_to_string`](#function-read_to_string)

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

### base_uri

```rust
base_uri: Option<url::Url>
```

The URI of the document: the absolute URL relative references in it
are resolved against.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L13)

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

### document

```rust
document: Option<String>
```

The path of the document, for diagnostics.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L16)

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

### root_instance

```rust
root_instance: Option<ferroui_base::BoxedValue>
```

An existing instance to populate instead of creating the root object
of the document.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L20)

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

### service_provider

```rust
service_provider: Option<std::rc::Rc<dyn IServiceProvider>>
```

A service provider the root of the document is given as its parent:
the context of the place the document is loaded into.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L24)

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

### new

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

A document from text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L31)

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

### with_base_uri

```rust
fn with_base_uri(base_uri: Option<url::Url>, xaml: &str) -> Self
```

A document from text, with its URI.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L36)

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

### with_root_instance

```rust
fn with_root_instance(root_instance: Option<BoxedValue>, xaml: &str) -> Self
```

A document from text that populates `root_instance`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L41)

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

### with_base_uri_and_root_instance

```rust
fn with_base_uri_and_root_instance(base_uri: Option<url::Url>, root_instance: Option<BoxedValue>, xaml: &str) -> Self
```

A document from text, with its URI, that populates `root_instance`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L46)

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

### from_stream

```rust
fn from_stream(stream: Box<dyn Read>) -> Self
```

A document from a stream of UTF-8 text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L51)

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

### from_stream_with_base_uri

```rust
fn from_stream_with_base_uri(base_uri: Option<url::Url>, stream: Box<dyn Read>) -> Self
```

A document from a stream, with its URI.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L62)

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

### from_stream_with_root_instance

```rust
fn from_stream_with_root_instance(root_instance: Option<BoxedValue>, stream: Box<dyn Read>) -> Self
```

A document from a stream that populates `root_instance`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L67)

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

### from_stream_with_base_uri_and_root_instance

```rust
fn from_stream_with_base_uri_and_root_instance(base_uri: Option<url::Url>, root_instance: Option<BoxedValue>, stream: Box<dyn Read>) -> Self
```

A document from a stream, with its URI, that populates
`root_instance`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L73)

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

### xaml_stream

```rust
fn xaml_stream(self: &Self) -> std::cell::RefMut<'_, Box<dyn Read>>
```

The stream of the document. Reading advances it: a document is read
once.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L83)

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

### read_to_string

```rust
fn read_to_string(self: &Self) -> std::io::Result<String>
```

Reads the rest of the document as text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/runtime_xaml_loader_document.rs#L88)

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