Something went wrong. Try again.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253use crate::share;
#[derive(serde::Deserialize)]#[serde(untagged)]pub enum Element { Move(Move), Component(Component), Wire(Vec<Move>),}
#[derive(serde::Deserialize)]#[serde(tag = "type", rename_all = "kebab-case")]pub enum Component { VSource { label: String, voltage: String, direction: Option<share::Direction>, rotation: Option<share::Direction>, }, ASource { label: String, current: String, direction: Option<share::Direction>, rotation: Option<share::Direction>, }, Resistor { label: String, ohm: String, direction: Option<share::Direction>, rotation: Option<share::Direction>, }, Terminal { label: String, direction: Option<share::Direction>, }, Split { content: Vec<Vec<Element>>, }, Addon { offset: Option<(isize, isize)>, content: Vec<Element>, },}
#[derive(serde::Deserialize)]#[serde(tag = "type", rename_all = "kebab-case")]pub enum Move { Up { value: usize }, Down { value: usize }, Left { value: usize }, Right { value: usize },}