| Crates.io | inst_derive |
| lib.rs | inst_derive |
| version | 0.1.2 |
| created_at | 2025-10-16 14:43:50.889368+00 |
| updated_at | 2025-12-19 00:58:57.664903+00 |
| description | Derive macro for tagged union enums implementing the Instantiable trait in safety-net |
| homepage | |
| repository | https://github.com/jk2997/inst_derive |
| max_upload_size | |
| id | 1886225 |
| size | 21,298 |
Derive macro for the Instantiable trait in safety-net.
Makes it easier to group Instantiable structs into a single enum.
Use the #[instantiable(constant)] attribute on a variant to specify which variant should be used for from_constant(). The variant must have a pub fn from_constant(val: Logic) -> Option<Self> method that returns an Option of the variant type.
use inst_derive::Instantiable;
use safety_net::{Gate, Identifier, Instantiable, Logic, Net, Parameter};
#[derive(Debug, Clone, Instantiable)]
enum Cell {
#[instantiable(constant)]
Gate(Gate),
// additional variants
}