pub struct Predicate {
pub nodes: Vec<Node>,
pub edges: Vec<Edge>,
}
Expand description
A program dependency graph.
Fields§
§nodes: Vec<Node>
Programs in the graph.
edges: Vec<Edge>
Dependencies between programs in the graph.
Edges are directed.
The edge from A
to B
indicates that B
depends on A
, i.e., B
is a child of A
.
Implementations§
Source§impl Predicate
impl Predicate
Sourcepub fn encode(
&self,
) -> Result<impl Iterator<Item = u8> + '_, PredicateEncodeError>
pub fn encode( &self, ) -> Result<impl Iterator<Item = u8> + '_, PredicateEncodeError>
Encode the predicate into a bytes iterator.
Sourcepub fn encoded_size(&self) -> usize
pub fn encoded_size(&self) -> usize
The size of the encoded predicate in bytes.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, PredicateDecodeError>
pub fn decode(bytes: &[u8]) -> Result<Self, PredicateDecodeError>
Decode a predicate from bytes.
Sourcepub fn node_edges(&self, node_ix: usize) -> Option<&[Edge]>
pub fn node_edges(&self, node_ix: usize) -> Option<&[Edge]>
The slice of edges associated with the node at the given index.
Returns None
in the case that the given node index is out of bound, or if any of the
node’s edges are out of bounds of the predicate’s edges
slice.
If the node is a leaf, returns an empty slice.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Predicate
impl<'de> Deserialize<'de> for Predicate
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
Source§impl Ord for Predicate
impl Ord for Predicate
Source§impl PartialOrd for Predicate
impl PartialOrd for Predicate
impl Eq for Predicate
impl StructuralPartialEq for Predicate
Auto Trait Implementations§
impl Freeze for Predicate
impl RefUnwindSafe for Predicate
impl Send for Predicate
impl Sync for Predicate
impl Unpin for Predicate
impl UnwindSafe for Predicate
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