Skip to main content

Composition

Trait Composition 

Source
pub trait Composition<B: Backend> {
    // Required methods
    fn new(background_color: Color) -> Self;
    fn clear(&mut self);
    fn insert(&mut self, order: Order, layer: Layer<B>);
    fn remove(&mut self, order: Order);
}
Expand description

A group of ordered layers.

Required Methods§

Source

fn new(background_color: Color) -> Self

Creates a composition of ordered layers where the layers with lower index appear on top.

Source

fn clear(&mut self)

Resets composition by removing all layers.

Source

fn insert(&mut self, order: Order, layer: Layer<B>)

Inserts layer into the composition.

Source

fn remove(&mut self, order: Order)

Removes layer from the composition.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§