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§
Sourcefn row_reading(self, direction: LayoutDirection) -> Self
fn row_reading(self, direction: LayoutDirection) -> Self
A flex row that runs in reading order.
Sourcefn ps(self, direction: LayoutDirection, length: Pixels) -> Self
fn ps(self, direction: LayoutDirection, length: Pixels) -> Self
Padding on the edge reading begins at.
Sourcefn pe(self, direction: LayoutDirection, length: Pixels) -> Self
fn pe(self, direction: LayoutDirection, length: Pixels) -> Self
Padding on the edge reading ends at.
Sourcefn ms(self, direction: LayoutDirection, length: Pixels) -> Self
fn ms(self, direction: LayoutDirection, length: Pixels) -> Self
Margin on the edge reading begins at.
Sourcefn me(self, direction: LayoutDirection, length: Pixels) -> Self
fn me(self, direction: LayoutDirection, length: Pixels) -> Self
Margin on the edge reading ends at.
Sourcefn border_s(self, direction: LayoutDirection, width: Pixels) -> Self
fn border_s(self, direction: LayoutDirection, width: Pixels) -> Self
A border on the edge reading begins at.
Sourcefn border_e(self, direction: LayoutDirection, width: Pixels) -> Self
fn border_e(self, direction: LayoutDirection, width: Pixels) -> Self
A border on the edge reading ends at.
Sourcefn text_start(self, direction: LayoutDirection) -> Self
fn text_start(self, direction: LayoutDirection) -> Self
Text aligned to where reading begins.
Sourcefn text_end(self, direction: LayoutDirection) -> Self
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".