Trait embedded_layout::View[][src]

pub trait View {
    fn translate_impl(&mut self, by: Point);
fn bounds(&self) -> Rectangle; fn size(&self) -> Size { ... }
fn translate_mut(&mut self, by: Point) -> &mut Self
    where
        Self: Sized
, { ... }
fn translate(self, by: Point) -> Self
    where
        Self: Sized
, { ... } }
Expand description

A View is the base unit for most of the embedded-layout operations.

Views must have a size and a position.

See the custom_view example for how you can define more complex views.

Required methods

Object-safe version of translate_mut().

The default implementations of translate and translate_mut both call this functions.

Returns the bounding box of the View as a Rectangle

Provided methods

Get the size of a View.

Move the origin of an object by a given number of (x, y) pixels, mutating the object in place.

If you a looking for a method to implement, you might want translate_impl() instead.

Move the origin of an object by a given number of (x, y) pixels, returning a new object.

If you a looking for a method to implement, you might want translate_impl() instead.

Implementors