Skip to main content

Layers

Trait Layers 

pub trait Layers<R>: Copy + Debug {
    // Required methods
    fn highest_active_key<LS>(
        &self,
        layer_state: &LS,
        default_layer: Option<u32>,
    ) -> Option<(u32, R)>
       where LS: LayerState;
    fn from_iterable<I>(keys: I) -> Result<Self, LayersError>
       where I: IntoIterator<Item = Option<R>>;
}
Expand description

Trait for layers of LayeredKey.

Required Methods§

fn highest_active_key<LS>( &self, layer_state: &LS, default_layer: Option<u32>, ) -> Option<(u32, R)>
where LS: LayerState,

Get the highest active key, if any, for the given LayerState.

fn from_iterable<I>(keys: I) -> Result<Self, LayersError>
where I: IntoIterator<Item = Option<R>>,

Constructs layers; return Err if the iterable has more keys than Layers can store.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

§

impl<R, const L: usize> Layers<R> for [Option<R>; L]
where R: Copy + Debug,

§

fn highest_active_key<LS>( &self, layer_state: &LS, default_layer: Option<u32>, ) -> Option<(u32, R)>
where LS: LayerState,

§

fn from_iterable<I>(keys: I) -> Result<[Option<R>; L], LayersError>
where I: IntoIterator<Item = Option<R>>,

Implementors§