[][src]Trait embedded_layout::align::Alignment

pub trait Alignment: Copy + Clone + Default {
    fn align_with_offset(
        &self,
        what: Rectangle,
        reference: Rectangle,
        offset: i32
    ) -> i32; fn align(&self, what: Rectangle, reference: Rectangle) -> i32 { ... } }

Base trait for alignment operations

An Alignment object modifies either the horizontal, or the vertical position of a View. Usually, these objects are passed to methods of Align or they can be used to parametrize layouts.

Implementors should also implement either the HorizontalAlignment or VerticalAlignment trait, otherwise the implementor can't be used as an alignment operation with embedded-layout.

Required methods

fn align_with_offset(
    &self,
    what: Rectangle,
    reference: Rectangle,
    offset: i32
) -> i32

Align one coordinate of View to the given reference with some offset

Loading content...

Provided methods

fn align(&self, what: Rectangle, reference: Rectangle) -> i32

Align one coordinate of View to the given reference

Loading content...

Implementors

impl Alignment for embedded_layout::align::horizontal::Center[src]

impl Alignment for Left[src]

impl Alignment for LeftToRight[src]

impl Alignment for embedded_layout::align::horizontal::NoAlignment[src]

impl Alignment for Right[src]

impl Alignment for RightToLeft[src]

impl Alignment for Bottom[src]

impl Alignment for BottomToTop[src]

impl Alignment for embedded_layout::align::vertical::Center[src]

impl Alignment for embedded_layout::align::vertical::NoAlignment[src]

impl Alignment for Top[src]

impl Alignment for TopToBottom[src]

Loading content...