Struct sunscreen_fhe_program::GraphQuery
source · [−]pub struct GraphQuery<'a>(_);
Expand description
A wrapper for ascertaining the structure of the underlying FheProgram
.
This type is used in FheProgram::forward_traverse
and
FheProgram::reverse_traverse
callbacks.
Implementations
sourceimpl<'a> GraphQuery<'a>
impl<'a> GraphQuery<'a>
sourcepub fn new(ir: &'a FheProgram) -> Self
pub fn new(ir: &'a FheProgram) -> Self
Creates a new GraphQuery
from a reference to an FheProgram
.
sourcepub fn get_node(&self, x: NodeIndex) -> &NodeInfo
pub fn get_node(&self, x: NodeIndex) -> &NodeInfo
Returns the NodeInfo
for the graph node with the given index x
.
sourcepub fn neighbors_directed(
&self,
x: NodeIndex,
direction: Direction
) -> Neighbors<'_, EdgeInfo>
pub fn neighbors_directed(
&self,
x: NodeIndex,
direction: Direction
) -> Neighbors<'_, EdgeInfo>
Returns the children or parents of the node with index x
. If direction is [
Direction::Outgoing], this will return the children. If the direction is [
Direction::Incoming`], this will return the parents.
Typically, you want children writing forward traversal compiler passes and parents when writing reverse traversal compiler passes.
Auto Trait Implementations
impl<'a> RefUnwindSafe for GraphQuery<'a>
impl<'a> Send for GraphQuery<'a>
impl<'a> Sync for GraphQuery<'a>
impl<'a> Unpin for GraphQuery<'a>
impl<'a> UnwindSafe for GraphQuery<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more