pub trait Net: Debug {
type Place: Place;
type Transition: Transition;
type Arc: Arc;
Show 14 methods
// Required methods
fn places(&self) -> Vec<&Self::Place>;
fn place(&self, id: &NodeId) -> Option<&Self::Place>;
fn place_mut(&mut self, id: &NodeId) -> Option<&mut Self::Place>;
fn add_place(&mut self) -> NodeId;
fn add_labeled_place<S>(&mut self, label: S) -> NodeId
where S: Into<String>;
fn transitions(&self) -> Vec<&Self::Transition>;
fn transition(&self, id: &NodeId) -> Option<&Self::Transition>;
fn transition_mut(&mut self, id: &NodeId) -> Option<&mut Self::Transition>;
fn add_transition(&mut self) -> NodeId;
fn add_labeled_transition<S>(&mut self, label: S) -> NodeId
where S: Into<String>;
fn arcs(&self) -> Vec<&Self::Arc>;
fn add_arc(&mut self, source: NodeId, target: NodeId);
fn inputs(&self, id: &NodeId) -> Vec<&NodeId>;
fn outputs(&self, id: &NodeId) -> Vec<&NodeId>;
}Expand description
This is the core trait for a Net \(N\) comprising a set of places \(P\), a set of transitions \(T\), and a set of arcs \(A\) such that \(N=\left\langle P,T,A \right\rangle\)
Required Associated Types§
Required Methods§
fn places(&self) -> Vec<&Self::Place>
fn place(&self, id: &NodeId) -> Option<&Self::Place>
fn place_mut(&mut self, id: &NodeId) -> Option<&mut Self::Place>
fn add_place(&mut self) -> NodeId
fn add_labeled_place<S>(&mut self, label: S) -> NodeId
fn transitions(&self) -> Vec<&Self::Transition>
fn transition(&self, id: &NodeId) -> Option<&Self::Transition>
fn transition_mut(&mut self, id: &NodeId) -> Option<&mut Self::Transition>
fn add_transition(&mut self) -> NodeId
fn add_labeled_transition<S>(&mut self, label: S) -> NodeId
fn arcs(&self) -> Vec<&Self::Arc>
fn add_arc(&mut self, source: NodeId, target: NodeId)
fn inputs(&self, id: &NodeId) -> Vec<&NodeId>
fn outputs(&self, id: &NodeId) -> Vec<&NodeId>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.