[][src]Struct belgium::Machine

pub struct Machine { /* fields omitted */ }

Methods

impl Machine[src]

#[must_use] pub fn new() -> Self[src]

pub fn add_mem_observer(&mut self, obs: Weak<dyn Observer<ChangeEvent>>)[src]

pub fn add_reg_observer(&mut self, obs: Weak<dyn Observer<ChangeEvent>>)[src]

pub fn set_mem(&mut self, i: u8, v: u8)[src]

#[must_use] pub fn mem(&self, i: u8) -> u8[src]

pub fn set_reg(&mut self, i: u8, v: u8) -> Result<(), Error>[src]

Errors

Will return Err if i is an invalid register

pub fn reg(&self, i: u8) -> Result<u8, Error>[src]

Errors

Will return Err if i is an invalid register

pub fn step(&mut self) -> Result<bool, Error>[src]

Errors

Will return Err on a malformed instruction

#[must_use] pub fn iter_mem(&self) -> MemIter[src]

Trait Implementations

impl Default for Machine[src]

Auto Trait Implementations

impl !RefUnwindSafe for Machine

impl !Send for Machine

impl !Sync for Machine

impl Unpin for Machine

impl !UnwindSafe for Machine

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.