pub fn virt_ic_chip_factory(chip_name: &str) -> Option<Box<dyn Chip>> {
    match chip_name {
        "virt_ic::Button" => Some(Box::new(buttons::Button::new())),
        "virt_ic::Clock100Hz" => Some(Box::new(clocks::Clock100Hz::new())),
        "virt_ic::Clock1kHz" => Some(Box::new(clocks::Clock1kHz::new())),
        "virt_ic::SimpleCPU" => Some(Box::new(cpu::SimpleCPU::new())),
        "virt_ic::GateOr" => Some(Box::new(gates::GateOr::new())),
        "virt_ic::GateAnd" => Some(Box::new(gates::GateAnd::new())),
        "virt_ic::GateNot" => Some(Box::new(gates::GateNot::new())),
        "virt_ic::Generator" => Some(Box::new(generators::Generator::new())),
        "virt_ic::Ram256B" => Some(Box::new(memory::Ram256B::new())),
        "virt_ic::Rom256B" => Some(Box::new(memory::Rom256B::new())),
        _ => None,
    }
}
/// Factory function for chips that are built-in for the virt_ic crate.
///
/// You can provide your own factory function to the `Board::Load` to build your custom chips.
/// ```
/// pub fn my_custom_factory(chip_name: &str) -> Option<Box<dyn Chip>> {
///     if let Some(chip) = virt_ic::chip::virt_ic_chip_factory(chip_name) {
///         return chip;
///     } else {
///         // build your chips here
///         // with a match chip_name for example
///     }
/// }
/// ```
Factory function for chips that are built-in for the virt_ic crate.
You can provide your own factory function to the `Board::Load` to build your custom chips.
Factory function for chips that are built - in for the virt_ic crate . You can provide your own factory function to the ` Board :: Load ` to build your custom chips .
pub fn virt_ic_chip_factory(chip_name: &str) -> Option<Box<dyn Chip>> {
    match chip_name {
        "virt_ic::Button" => Some(Box::new(buttons::Button::new())),
        "virt_ic::Clock100Hz" => Some(Box::new(clocks::Clock100Hz::new())),
        "virt_ic::Clock1kHz" => Some(Box::new(clocks::Clock1kHz::new())),
        "virt_ic::SimpleCPU" => Some(Box::new(cpu::SimpleCPU::new())),
        "virt_ic::GateOr" => Some(Box::new(gates::GateOr::new())),
        "virt_ic::GateAnd" => Some(Box::new(gates::GateAnd::new())),
        "virt_ic::GateNot" => Some(Box::new(gates::GateNot::new())),
        "virt_ic::Generator" => Some(Box::new(generators::Generator::new())),
        "virt_ic::Ram256B" => Some(Box::new(memory::Ram256B::new())),
        "virt_ic::Rom256B" => Some(Box::new(memory::Rom256B::new())),
        _ => None,
    }
}
pub fn virt_ic_chip_factory ( chip_name : & str ) -> Option < Box < dyn Chip > > { match chip_name { " " => Some ( Box :: new ( buttons :: Button :: new ( ) ) ) , " " => Some ( Box :: new ( clocks :: Clock100Hz :: new ( ) ) ) , " " => Some ( Box :: new ( clocks :: Clock1kHz :: new ( ) ) ) , " " => Some ( Box :: new ( cpu :: SimpleCPU :: new ( ) ) ) , " " => Some ( Box :: new ( gates :: GateOr :: new ( ) ) ) , " " => Some ( Box :: new ( gates :: GateAnd :: new ( ) ) ) , " " => Some ( Box :: new ( gates :: GateNot :: new ( ) ) ) , " " => Some ( Box :: new ( generators :: Generator :: new ( ) ) ) , " " => Some ( Box :: new ( memory :: Ram256B :: new ( ) ) ) , " " => Some ( Box :: new ( memory :: Rom256B :: new ( ) ) ) , _ => None , } }
Factory function for chips that are built-in for the virt_ic crate.
Factory function for chips that are built - in for the virt_ic crate .
chip_name
&str
chip_name
&str