# Border

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

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

```rust
struct Border
```

A control which decorates a child with a border and background.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`background_property`](#function-background_property)
- [`background_sizing_property`](#function-background_sizing_property)
- [`border_brush_property`](#function-border_brush_property)
- [`border_thickness_property`](#function-border_thickness_property)
- [`corner_radius_property`](#function-corner_radius_property)
- [`box_shadow_property`](#function-box_shadow_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`background`](#function-background)
- [`set_background`](#function-set_background)
- [`background_sizing`](#function-background_sizing)
- [`set_background_sizing`](#function-set_background_sizing)
- [`border_brush`](#function-border_brush)
- [`set_border_brush`](#function-set_border_brush)
- [`border_thickness`](#function-border_thickness)
- [`set_border_thickness`](#function-set_border_thickness)
- [`corner_radius`](#function-corner_radius)
- [`set_corner_radius`](#function-set_corner_radius)
- [`box_shadow`](#function-box_shadow)
- [`set_box_shadow`](#function-set_box_shadow)
- [`layout_thickness`](#function-layout_thickness)
- [`clip_to_bounds_radius`](#function-clip_to_bounds_radius)

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

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L38)

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

### background_property

```rust
fn background_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
```

Defines the `Background` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L127)

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

### background_sizing_property

```rust
fn background_sizing_property() -> &'static StyledProperty<BackgroundSizing>
```

Defines the `BackgroundSizing` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L127)

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

### border_brush_property

```rust
fn border_brush_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
```

Defines the `BorderBrush` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L127)

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

### border_thickness_property

```rust
fn border_thickness_property() -> &'static StyledProperty<Thickness>
```

Defines the `BorderThickness` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L127)

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

### corner_radius_property

```rust
fn corner_radius_property() -> &'static StyledProperty<CornerRadius>
```

Defines the `CornerRadius` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L127)

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

### box_shadow_property

```rust
fn box_shadow_property() -> &'static StyledProperty<BoxShadows>
```

Defines the `BoxShadow` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L127)

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

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L193)

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

### background

```rust
fn background(self: &Self) -> Option<Rc<dyn IBrush>>
```

A brush with which to paint the background.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L207)

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

### set_background

```rust
fn set_background(self: &Self, value: Option<Rc<dyn IBrush>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L211)

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

### background_sizing

```rust
fn background_sizing(self: &Self) -> BackgroundSizing
```

How the background is drawn relative to the border.

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

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

### set_background_sizing

```rust
fn set_background_sizing(self: &Self, value: BackgroundSizing)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L220)

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

### border_brush

```rust
fn border_brush(self: &Self) -> Option<Rc<dyn IBrush>>
```

A brush with which to paint the border.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L225)

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

### set_border_brush

```rust
fn set_border_brush(self: &Self, value: Option<Rc<dyn IBrush>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L229)

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

### border_thickness

```rust
fn border_thickness(self: &Self) -> Thickness
```

The thickness of the border.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L234)

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

### set_border_thickness

```rust
fn set_border_thickness(self: &Self, value: Thickness)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L238)

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

### corner_radius

```rust
fn corner_radius(self: &Self) -> CornerRadius
```

The radius of the border rounded corners.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L243)

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

### set_corner_radius

```rust
fn set_corner_radius(self: &Self, value: CornerRadius)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L247)

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

### box_shadow

```rust
fn box_shadow(self: &Self) -> BoxShadows
```

The box shadow effect parameters.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L252)

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

### set_box_shadow

```rust
fn set_box_shadow(self: &Self, value: BoxShadows)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L256)

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

### layout_thickness

```rust
fn layout_thickness(self: &Self) -> Thickness
```

The border thickness used for rendering: rounded to device pixels
when layout rounding is in use.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L262)

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

### clip_to_bounds_radius

```rust
fn clip_to_bounds_radius(self: &Self) -> CornerRadius
```

The corner radius with which the visual is clipped when it clips to
its bounds.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/border.rs#L292)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- `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`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`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/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<Border>`](/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/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)

## Availability

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