[−][src]Struct virt_ic::Board
A Board that contains Traces and Sockets
Implementations
impl Board
[src]
pub fn new() -> Board
[src]
Create a new empty Board
pub fn new_trace(&mut self) -> Rc<RefCell<Trace>>
[src]
Create a new trace and return it
pub fn new_socket(&mut self) -> Rc<RefCell<Socket>>
[src]
Create a new socket and return it Note that you'll have to plug a chip on it before linking it with the traces
pub fn new_socket_with(&mut self, chip: Box<dyn Chip>) -> Rc<RefCell<Socket>>
[src]
Create a new socket with a chip and return it
pub fn get_sockets(&self) -> Vec<Rc<RefCell<Socket>>>
[src]
pub fn get_traces(&self) -> Vec<Rc<RefCell<Trace>>>
[src]
pub fn get_socket(&mut self, uuid: u128) -> Option<Rc<RefCell<Socket>>>
[src]
pub fn run(&mut self, time_elapsed: Duration)
[src]
Run the circuit for a certain amount of time
You must use use_during
since it provides more accurate simulation by stepping
pub fn run_during(&mut self, duration: Duration, step: Duration)
[src]
Run the circuit for a certain amount of time segmented by a step The smaller the step the more accurate the simulation will be.
pub fn run_realtime(&mut self, duration: Duration)
[src]
pub fn save(&self, filepath: &str) -> Result<()>
[src]
Save the board to a file in RON format
pub fn load(
filepath: &str,
chip_factory: &dyn Fn(&str) -> Option<Box<dyn Chip>>
) -> Result<Board>
[src]
filepath: &str,
chip_factory: &dyn Fn(&str) -> Option<Box<dyn Chip>>
) -> Result<Board>
Load a file and create a board according to this file
You'll need to provide a "chip factory" function as second parameter
By default it's virt_ic::chip::virt_ic_chip_factory
use virt_ic::chip::virt_ic_chip_factory; let mut board = Board::load("my_saved_board.ron", &virt_ic_chip_factory).unwrap();
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Board
impl !Send for Board
impl !Sync for Board
impl Unpin for Board
impl !UnwindSafe for Board
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,