Struct Manager

Source
pub struct Manager<const ROWS: usize, const COLS: usize, const CODE_SIZE: usize> { /* private fields */ }

Implementations§

Source§

impl<const ROWS: usize, const COLS: usize, const LAYOUT_MAX: usize> Manager<ROWS, COLS, LAYOUT_MAX>

Source

pub fn load( &mut self, iter: impl IntoIterator<Item = u16>, ) -> Result<(), LoadError>

Load mapping config into Manager. The format of mapping is as follows:

protocol version layer count row_count (high byte), column_count (low byte) should match ROWS and COLS layer positions, layers. Layer positions mark the index in codes where the layers start. Layers are dense if every entry has a value; size == ROWS * COLS Layers are sparse if size < ROWS * COLS in which case it is a list of ordered tuples where the first byte is the row, second is the column and the next word is the value

Source

pub fn find_code(&self, row: usize, column: usize) -> Option<KeyPlusMod>

Source

pub fn get_macro(&self, id: u16) -> Macro

Source

pub fn get_layer(&self, layer_num: u16) -> Option<Layer<'_, ROWS, COLS>>

Source

pub fn macro_stack(&self) -> usize

Source

pub fn set_layout(&mut self, n: u16)

Source

pub fn push_layer(&mut self, n: u16) -> bool

Source

pub fn pop_layer(&mut self, n: u16) -> bool

Trait Implementations§

Source§

impl<const ROWS: usize, const COLS: usize, const LAYOUT_MAX: usize> Default for Manager<ROWS, COLS, LAYOUT_MAX>

Source§

fn default() -> Manager<ROWS, COLS, LAYOUT_MAX>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<const ROWS: usize, const COLS: usize, const CODE_SIZE: usize> Freeze for Manager<ROWS, COLS, CODE_SIZE>

§

impl<const ROWS: usize, const COLS: usize, const CODE_SIZE: usize> RefUnwindSafe for Manager<ROWS, COLS, CODE_SIZE>

§

impl<const ROWS: usize, const COLS: usize, const CODE_SIZE: usize> Send for Manager<ROWS, COLS, CODE_SIZE>

§

impl<const ROWS: usize, const COLS: usize, const CODE_SIZE: usize> Sync for Manager<ROWS, COLS, CODE_SIZE>

§

impl<const ROWS: usize, const COLS: usize, const CODE_SIZE: usize> Unpin for Manager<ROWS, COLS, CODE_SIZE>

§

impl<const ROWS: usize, const COLS: usize, const CODE_SIZE: usize> UnwindSafe for Manager<ROWS, COLS, CODE_SIZE>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.