pub struct MachineBuilder { /* private fields */ }
Expand description
Builder pattern to construct an EndBASIC interpreter.
Unless otherwise specified, the interpreter is connected to a terminal-based console.
Implementations§
Source§impl MachineBuilder
impl MachineBuilder
Sourcepub fn with_console(self, console: Rc<RefCell<dyn Console>>) -> Self
pub fn with_console(self, console: Rc<RefCell<dyn Console>>) -> Self
Overrides the default terminal-based console with the given one.
Sourcepub fn with_gpio_pins(self, pins: Rc<RefCell<dyn Pins>>) -> Self
pub fn with_gpio_pins(self, pins: Rc<RefCell<dyn Pins>>) -> Self
Overrides the default hardware-based GPIO pins with the given ones.
Sourcepub fn with_sleep_fn(self, sleep_fn: SleepFn) -> Self
pub fn with_sleep_fn(self, sleep_fn: SleepFn) -> Self
Overrides the default sleep function with the given one.
Sourcepub fn with_yield_now_fn(self, yield_now_fn: YieldNowFn) -> Self
pub fn with_yield_now_fn(self, yield_now_fn: YieldNowFn) -> Self
Overrides the default yielding function with the given one.
Sourcepub fn with_signals_chan(self, chan: (Sender<Signal>, Receiver<Signal>)) -> Self
pub fn with_signals_chan(self, chan: (Sender<Signal>, Receiver<Signal>)) -> Self
Overrides the default signals channel with the given one.
Sourcepub fn get_console(&mut self) -> Rc<RefCell<dyn Console>>
pub fn get_console(&mut self) -> Rc<RefCell<dyn Console>>
Lazily initializes the console
field with a default value and returns it.
Sourcepub fn make_interactive(self) -> InteractiveMachineBuilder
pub fn make_interactive(self) -> InteractiveMachineBuilder
Extends the machine with interactive (REPL) features.
Trait Implementations§
Source§impl Default for MachineBuilder
impl Default for MachineBuilder
Source§fn default() -> MachineBuilder
fn default() -> MachineBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MachineBuilder
impl !RefUnwindSafe for MachineBuilder
impl !Send for MachineBuilder
impl !Sync for MachineBuilder
impl !Unpin for MachineBuilder
impl !UnwindSafe for MachineBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more