Skip to main content

DirectionalExt

Trait DirectionalExt 

Source
pub trait DirectionalExt: Styled + Sized {
    // Provided methods
    fn row_reading(self, direction: LayoutDirection) -> Self { ... }
    fn ps(self, direction: LayoutDirection, length: Pixels) -> Self { ... }
    fn pe(self, direction: LayoutDirection, length: Pixels) -> Self { ... }
    fn ms(self, direction: LayoutDirection, length: Pixels) -> Self { ... }
    fn me(self, direction: LayoutDirection, length: Pixels) -> Self { ... }
    fn border_s(self, direction: LayoutDirection, width: Pixels) -> Self { ... }
    fn border_e(self, direction: LayoutDirection, width: Pixels) -> Self { ... }
    fn text_start(self, direction: LayoutDirection) -> Self { ... }
    fn text_end(self, direction: LayoutDirection) -> Self { ... }
}
Expand description

Logical box model helpers, named by reading order.

Each one takes the direction explicitly rather than reaching for the global, because a component has already read it once by the time it styles anything and passing it keeps these usable in a test with no application.

Provided Methods§

Source

fn row_reading(self, direction: LayoutDirection) -> Self

A flex row that runs in reading order.

Source

fn ps(self, direction: LayoutDirection, length: Pixels) -> Self

Padding on the edge reading begins at.

Source

fn pe(self, direction: LayoutDirection, length: Pixels) -> Self

Padding on the edge reading ends at.

Source

fn ms(self, direction: LayoutDirection, length: Pixels) -> Self

Margin on the edge reading begins at.

Source

fn me(self, direction: LayoutDirection, length: Pixels) -> Self

Margin on the edge reading ends at.

Source

fn border_s(self, direction: LayoutDirection, width: Pixels) -> Self

A border on the edge reading begins at.

Source

fn border_e(self, direction: LayoutDirection, width: Pixels) -> Self

A border on the edge reading ends at.

Source

fn text_start(self, direction: LayoutDirection) -> Self

Text aligned to where reading begins.

Source

fn text_end(self, direction: LayoutDirection) -> Self

Text aligned to where reading ends.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§