pub struct Graph {
pub spec_version: String,
pub topology: Topology,
pub lineage: Lineage,
pub registry: CircuitRegistry,
pub verification: Verification,
pub revision: Revision,
pub nodes: BTreeMap<StableId, Node>,
pub edges: BTreeMap<StableId, Edge>,
pub modulations: BTreeMap<StableId, Modulation>,
}Expand description
The Canonical IR Graph — The Forensic Record of Sound.
Fields§
§spec_version: String§topology: Topology§lineage: Lineage§registry: CircuitRegistry§verification: Verification§revision: Revision§nodes: BTreeMap<StableId, Node>§edges: BTreeMap<StableId, Edge>§modulations: BTreeMap<StableId, Modulation>Implementations§
Source§impl Graph
impl Graph
Sourcepub fn sync(&mut self)
pub fn sync(&mut self)
Synchronizes legacy compatibility fields from the layered structure. Call this after deserializing or modifying layers.
pub fn squash_history(&mut self)
pub fn create_snapshot(&mut self, name: &str)
pub fn node(&self, id: &StableId) -> Option<&Node>
pub fn edge(&self, id: &StableId) -> Option<&Edge>
pub fn validate_port_ref(&self, port_ref: &PortRef) -> bool
pub fn add_node(&mut self, node: Node)
pub fn remove_node(&mut self, id: StableId)
pub fn connect( &mut self, source: PortRef, target: PortRef, ) -> Result<StableId, String>
pub fn disconnect(&mut self, edge_id: StableId) -> Result<(), String>
pub fn set_config( &mut self, node_id: StableId, key: &str, value: ConfigValue, ) -> Result<(), String>
Source§impl Graph
impl Graph
pub fn apply_patch(&mut self, patch: &Patch) -> Result<(), PatchError>
pub fn diff(&self, other: &Graph) -> PatchSet
pub fn replay(patches: &[Patch]) -> Result<Self, PatchError>
pub fn replay_and_verify( patches: &[Patch], expected_hash: &Hash, ) -> Result<Self, PatchError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Graph
impl<'de> Deserialize<'de> for Graph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Graph
Auto Trait Implementations§
impl Freeze for Graph
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnsafeUnpin for Graph
impl UnwindSafe for Graph
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.