Trait ViewGroup

Source
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,