Trait RegisterBank

Source
pub trait RegisterBank<T>
where Self: Sized,
{ // Required methods fn new() -> Self; fn set(&mut self, register: RegisterId, raw: T); fn get(&self, register: RegisterId) -> T; fn apply(&self, range: RegisterRange, function: RangeApplication<T>) -> T; fn slice(&self, range: RegisterRange) -> &[T]; fn copy(&mut self, to: RegisterId, slice: &[T]); }

Required Methods§

Source

fn new() -> Self

Create a new complete bank with register initialized at their default value.

Source

fn set(&mut self, register: RegisterId, raw: T)

Sets a specific register in the bank.

Source

fn get(&self, register: RegisterId) -> T

Gets a specific register from the bank.

Source

fn apply(&self, range: RegisterRange, function: RangeApplication<T>) -> T

Apply the specified RangeApplication in the bank on the specified RegisterRange.

Source

fn slice(&self, range: RegisterRange) -> &[T]

Return a slice from the specified range in the bank.

Source

fn copy(&mut self, to: RegisterId, slice: &[T])

Copy the specified slice into the bank to the specified RegisterId and nexts.

Do not overflow. Only the fitting elements are copied.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§