PositionView

Trait PositionView 

Source
pub trait PositionView: View {
    // Provided methods
    fn top(self, y: Val) -> Self { ... }
    fn left(self, x: Val) -> Self { ... }
    fn right(self, x: Val) -> Self { ... }
    fn bottom(self, y: Val) -> Self { ... }
    fn position(self, x: Val, y: Val) -> Self { ... }
}
Expand description

A trait that provides convenient absolute positioning methods for views.

Provided Methods§

Source

fn top(self, y: Val) -> Self

Sets the top offset of the view in absolute positioning mode.

§Arguments
  • y - Vertical distance from the top edge of the parent container.
Source

fn left(self, x: Val) -> Self

Sets the left offset of the view in absolute positioning mode.

§Arguments
  • x - Horizontal distance from the left edge of the parent container.
Source

fn right(self, x: Val) -> Self

Sets the right offset of the view in absolute positioning mode.

§Arguments
  • x - Distance from the right edge of the parent container.
Source

fn bottom(self, y: Val) -> Self

Sets the bottom offset of the view in absolute positioning mode.

§Arguments
  • y - Distance from the bottom edge of the parent container.
Source

fn position(self, x: Val, y: Val) -> Self

Sets both the left and top offsets of the view in absolute positioning mode.

§Arguments
  • x - Horizontal distance from the left edge.
  • y - Vertical distance from the top edge.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§