pub trait ViewGroup: View {
    // Required methods
    fn len(&self) -> usize;
    fn at(&self, idx: usize) -> &dyn View;
    fn at_mut(&mut self, idx: usize) -> &mut dyn View;

    // Provided methods
    fn bounds_of(&self, idx: usize) -> Rectangle { ... }
    fn translate_child(&mut self, idx: usize, by: Point) { ... }
}
Expand description

A set of operations required to implement View containers.

Required Methods§

source

fn len(&self) -> usize

Returns the number of View objects in this view group.

source

fn at(&self, idx: usize) -> &dyn View

Returns a shared reference the View object at position idx.

source

fn at_mut(&mut self, idx: usize) -> &mut dyn View

Returns an exclusive reference to the View object at position idx.

Provided Methods§

source

fn bounds_of(&self, idx: usize) -> Rectangle

Returns the bounding box of the given View.

source

fn translate_child(&mut self, idx: usize, by: Point)

Translates the given View.

Implementors§

source§

impl ViewGroup for EmptyViewGroup

source§

impl<LD, VG> ViewGroup for LinearLayout<LD, VG>where LD: Orientation, VG: ViewGroup,

source§

impl<T> ViewGroup for Views<'_, T>where T: View,

source§

impl<V> ViewGroup for Chain<V>where V: View,

source§

impl<V, VC> ViewGroup for Link<V, VC>where V: View, VC: ViewGroup + View + ChainElement,