# Span

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/documents/struct-span/

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

```rust
struct Span
```

Span element used for grouping other `Inline` elements.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L15)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`inlines_property`](#function-inlines_property)
- [`construct`](#function-construct)
- [`as_add_child_of_inline`](#function-as_add_child_of_inline)
- [`as_add_child_of_control`](#function-as_add_child_of_control)
- [`as_add_child_of_string`](#function-as_add_child_of_string)
- [`new`](#function-new)
- [`inlines`](#function-inlines)
- [`set_inlines`](#function-set_inlines)
- [`add_child`](#function-add_child)
- [`add_child_control`](#function-add_child_control)
- [`add_child_text`](#function-add_child_text)

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

### TYPE

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

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L20)

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<Span>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L20)

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

### inlines_property

```rust
fn inlines_property() -> &'static StyledProperty<Option<InlineCollection>>
```

Defines the `Inlines` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L138)

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

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L149)

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

### as_add_child_of_inline

```rust
fn as_add_child_of_inline(this: Ref<Span>) -> Rc<dyn IAddChild<Ref<Inline>>>
```

The span as the contract through which markup adds an inline child.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L154)

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

### as_add_child_of_control

```rust
fn as_add_child_of_control(this: Ref<Span>) -> Rc<dyn IAddChild<Ref<Control>>>
```

The span as the contract through which markup adds a control child:
the control is wrapped in an inline container.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L160)

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

### as_add_child_of_string

```rust
fn as_add_child_of_string(this: Ref<Span>) -> Rc<dyn IAddChild<String>>
```

The span as the contract through which markup adds a text child: the
text becomes a run.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L166)

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

### new

```rust
fn new() -> Ref<Self>
```

Initializes a new instance of a `Span` class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L171)

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

### inlines

```rust
fn inlines(self: &Self) -> InlineCollection
```

Gets or sets the inlines.

Panics when the collection was removed by setting the property to
its unset value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L179)

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

### set_inlines

```rust
fn set_inlines(self: &Self, value: InlineCollection)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L183)

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

### add_child

```rust
fn add_child(self: &Self, inline: impl IntoRef<Inline>)
```

Adds an inline child (the content model of the element).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L209)

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

### add_child_control

```rust
fn add_child_control(self: &Self, child: impl IntoRef<Control>)
```

Adds a control child, wrapped in an `InlineUIContainer`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L216)

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

### add_child_text

```rust
fn add_child_text(self: &Self, text: &str)
```

Adds a text child, wrapped in a `Run`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/documents/span.rs#L223)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`InlineImplExt`](/docs/0.5.0/api/ferroui-controls/documents/trait-inlineimplext/)
- [`TextElementImplExt`](/docs/0.5.0/api/ferroui-controls/documents/trait-textelementimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<Span>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`TextElementImpl`](/docs/0.5.0/api/ferroui-controls/documents/trait-textelementimpl/)
- [`InlineImpl`](/docs/0.5.0/api/ferroui-controls/documents/trait-inlineimpl/)

## Availability

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