# XamlSourceInfo

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

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

```rust
struct XamlSourceInfo
```

Represents source location information for an element within a XAML
file.

This type is instantiated through the XAML compiler.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`new`](#function-new)
- [`source_uri`](#function-source_uri)
- [`line_number`](#function-line_number)
- [`line_position`](#function-line_position)
- [`set_xaml_source_info`](#function-set_xaml_source_info)
- [`set_xaml_source_info_for_key`](#function-set_xaml_source_info_for_key)
- [`get_xaml_source_info`](#function-get_xaml_source_info)
- [`get_xaml_source_info_for_key`](#function-get_xaml_source_info_for_key)

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

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this type.

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

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

### new

```rust
fn new(line: i32, column: i32, file_path: Option<&str>) -> Self
```

Initializes a new instance with the specified line, column, and file
path.

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

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

### source_uri

```rust
fn source_uri(self: &Self) -> Option<&Url>
```

The full path of the source file containing the XAML element: the
file URL of the path the element was loaded from.

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

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

### line_number

```rust
fn line_number(self: &Self) -> i32
```

The 1-based line number in the source file where the element is
defined.

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

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

### line_position

```rust
fn line_position(self: &Self) -> i32
```

The 1-based column position in the source file where the element is
defined.

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

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

### set_xaml_source_info

```rust
fn set_xaml_source_info(obj: &BoxedValue, info: Option<XamlSourceInfo>)
```

Associates XAML source information with the specified object for
debugging or diagnostic purposes.

This method is typically used to attach source information to objects
at run time, which can be useful for debugging tools or diagnostics.
The information does not keep the object alive.

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

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

### set_xaml_source_info_for_key

```rust
fn set_xaml_source_info_for_key(dictionary: &Rc<dyn IResourceDictionary>, key: impl Into<ResourceKey>, info: Option<XamlSourceInfo>)
```

Associates XAML source information with a specified key in the given
resource dictionary. Passing `None` removes the source information of
the key.

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

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

### get_xaml_source_info

```rust
fn get_xaml_source_info(obj: &BoxedValue) -> Option<XamlSourceInfo>
```

Retrieves the XAML source information associated with the specified
object, if available.

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

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

### get_xaml_source_info_for_key

```rust
fn get_xaml_source_info_for_key(dictionary: &Rc<dyn IResourceDictionary>, key: impl Into<ResourceKey>) -> Option<XamlSourceInfo>
```

Retrieves the XAML source information associated with the specified
key in the given resource dictionary, if available.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ToString`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- `Display`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)

## Availability

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