pub struct Module<'a> {
pub root: RegionId,
pub nodes: Vec<Node<'a>>,
pub regions: Vec<Region<'a>>,
pub terms: Vec<Term<'a>>,
}
Expand description
A module consisting of a hugr graph together with terms.
Fields§
§root: RegionId
The id of the root region.
nodes: Vec<Node<'a>>
Table of Node
s.
regions: Vec<Region<'a>>
Table of Region
s.
terms: Vec<Term<'a>>
Table of Term
s.
Implementations§
Source§impl<'a> Module<'a>
impl<'a> Module<'a>
Sourcepub fn get_node(&self, node_id: NodeId) -> Option<&Node<'a>>
pub fn get_node(&self, node_id: NodeId) -> Option<&Node<'a>>
Return the node data for a given node id.
Sourcepub fn get_node_mut(&mut self, node_id: NodeId) -> Option<&mut Node<'a>>
pub fn get_node_mut(&mut self, node_id: NodeId) -> Option<&mut Node<'a>>
Return a mutable reference to the node data for a given node id.
Sourcepub fn insert_node(&mut self, node: Node<'a>) -> NodeId
pub fn insert_node(&mut self, node: Node<'a>) -> NodeId
Insert a new node into the module and return its id.
Sourcepub fn get_term(&self, term_id: TermId) -> Option<&Term<'a>>
pub fn get_term(&self, term_id: TermId) -> Option<&Term<'a>>
Return the term data for a given term id.
Sourcepub fn get_term_mut(&mut self, term_id: TermId) -> Option<&mut Term<'a>>
pub fn get_term_mut(&mut self, term_id: TermId) -> Option<&mut Term<'a>>
Return a mutable reference to the term data for a given term id.
Sourcepub fn insert_term(&mut self, term: Term<'a>) -> TermId
pub fn insert_term(&mut self, term: Term<'a>) -> TermId
Insert a new term into the module and return its id.
Sourcepub fn get_region(&self, region_id: RegionId) -> Option<&Region<'a>>
pub fn get_region(&self, region_id: RegionId) -> Option<&Region<'a>>
Return the region data for a given region id.
Sourcepub fn get_region_mut(&mut self, region_id: RegionId) -> Option<&mut Region<'a>>
pub fn get_region_mut(&mut self, region_id: RegionId) -> Option<&mut Region<'a>>
Return a mutable reference to the region data for a given region id.
Sourcepub fn insert_region(&mut self, region: Region<'a>) -> RegionId
pub fn insert_region(&mut self, region: Region<'a>) -> RegionId
Insert a new region into the module and return its id.
Trait Implementations§
impl<'a> Eq for Module<'a>
impl<'a> StructuralPartialEq for Module<'a>
Auto Trait Implementations§
impl<'a> Freeze for Module<'a>
impl<'a> RefUnwindSafe for Module<'a>
impl<'a> Send for Module<'a>
impl<'a> Sync for Module<'a>
impl<'a> Unpin for Module<'a>
impl<'a> UnwindSafe for Module<'a>
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