Struct stack_graphs::graph::StackGraph [−][src]
pub struct StackGraph { /* fields omitted */ }Expand description
Contains all of the nodes and edges that make up a stack graph.
Implementations
impl StackGraph[src]
impl StackGraph[src]pub fn add_symbol<S: AsRef<str> + ?Sized>(
&mut self,
symbol: &S
) -> Handle<Symbol>[src]
pub fn add_symbol<S: AsRef<str> + ?Sized>(
&mut self,
symbol: &S
) -> Handle<Symbol>[src]Adds a symbol to the stack graph, ensuring that there’s only ever one copy of a particular symbol stored in the graph.
pub fn iter_symbols(&self) -> impl Iterator<Item = Handle<Symbol>>[src]
pub fn iter_symbols(&self) -> impl Iterator<Item = Handle<Symbol>>[src]Returns an iterator over all of the handles of all of the symbols in this stack graph.
(Note that because we’re only returning handles, this iterator does not retain a
reference to the StackGraph.)
impl StackGraph[src]
impl StackGraph[src]pub fn add_file<S: AsRef<str> + ?Sized>(
&mut self,
name: &S
) -> Result<Handle<File>, Handle<File>>[src]
pub fn add_file<S: AsRef<str> + ?Sized>(
&mut self,
name: &S
) -> Result<Handle<File>, Handle<File>>[src]Adds a file to the stack graph. There can only ever be one file with a particular name in
the graph. If a file with the requested name already exists, we return Err; if it
doesn’t already exist, we return Ok. In both cases, the value of the result is the
file’s handle.
pub fn get_or_create_file<S: AsRef<str> + ?Sized>(
&mut self,
name: &S
) -> Handle<File>[src]
pub fn get_or_create_file<S: AsRef<str> + ?Sized>(
&mut self,
name: &S
) -> Handle<File>[src]Adds a file to the stack graph, returning its handle. There can only ever be one file with a particular name in the graph, so if you call this multiple times with the same name, you’ll get the same handle each time.
impl StackGraph[src]
impl StackGraph[src]pub fn iter_files(&self) -> impl Iterator<Item = Handle<File>> + '_[src]
pub fn iter_files(&self) -> impl Iterator<Item = Handle<File>> + '_[src]Returns an iterator over all of the handles of all of the files in this stack graph. (Note
that because we’re only returning handles, this iterator does not retain a reference to
the StackGraph.)
impl StackGraph[src]
impl StackGraph[src]pub fn jump_to_node(&self) -> Handle<Node>[src]
pub fn jump_to_node(&self) -> Handle<Node>[src]Returns a handle to the stack graph’s singleton jump to scope node.
pub fn root_node(&self) -> Handle<Node>[src]
pub fn root_node(&self) -> Handle<Node>[src]Returns a handle to the stack graph’s singleton root node.
pub fn new_node_id(&mut self, file: Handle<File>) -> NodeID[src]
pub fn new_node_id(&mut self, file: Handle<File>) -> NodeID[src]Returns an unused local node ID for the given file.
pub fn iter_nodes(&self) -> impl Iterator<Item = Handle<Node>>[src]
pub fn iter_nodes(&self) -> impl Iterator<Item = Handle<Node>>[src]Returns an iterator of all of the nodes in the graph. (Note that because we’re only
returning handles, this iterator does not retain a reference to the StackGraph.)
impl StackGraph[src]
impl StackGraph[src]impl StackGraph[src]
impl StackGraph[src]pub fn remove_edge(&mut self, edge: Edge)[src]
pub fn remove_edge(&mut self, edge: Edge)[src]Removes an edge from the stack graph.
impl StackGraph[src]
impl StackGraph[src]pub fn new() -> StackGraph[src]
pub fn new() -> StackGraph[src]Creates a new, initially empty stack graph.
Trait Implementations
impl Index<Handle<File>> for StackGraph[src]
impl Index<Handle<File>> for StackGraph[src]impl Index<Handle<Node>> for StackGraph[src]
impl Index<Handle<Node>> for StackGraph[src]impl Index<Handle<Symbol>> for StackGraph[src]
impl Index<Handle<Symbol>> for StackGraph[src]