DepGraph

Struct DepGraph 

Source
pub struct DepGraph<T: Eq> { /* private fields */ }
Expand description

This is the dependency graph. The type T is intended to be a small type, or a reference to a larger type that implements Eq (you will need to supply the type and vectors of the type to functions).

Implementations§

Source§

impl<T: Eq> DepGraph<T>

Source

pub fn new() -> DepGraph<T>

Create an empty DepGraph.

Source

pub fn register_nodes(&mut self, nodes: Vec<T>)

Register nodes in the graph. The nodes are added to any existing nodes, after checking to avoid duplicates.

Source

pub fn register_node(&mut self, node: T)

Register a node in the graph. The node is added to any existing nodes, after checking to avoid duplicates.

Source

pub fn register_dependency(&mut self, node: T, depends_on: T)

Add a dependency to a DepGraph. The node does not need to pre-exist, nor does the dependency node. If the node does pre-exist, the depends_on will be added to its existing dependency list. Otherwise it will be created.

Source

pub fn register_dependencies(&mut self, node: T, depends_on: Vec<T>)

Add multiple dependencies of one node to a DepGraph. The node does not need to pre-exist, nor does the dependency node. If the node does pre-exist, the depends_on will be added to its existing dependency list. Otherwise it will be created.

Source

pub fn mark_as_satisfied(&mut self, nodes: &[T]) -> Result<(), SolventError>

This marks a node as satisfied. Iterators will not output such nodes. Nodes must exist.

Source

pub fn dependencies_of<'a>( &'a self, target: &T, ) -> Result<DepGraphIterator<'a, T>, SolventError>

Get an iterator to iterate through the dependencies of the target node. Target node must exist.

Trait Implementations§

Source§

impl<T: Clone + Eq> Clone for DepGraph<T>

Source§

fn clone(&self) -> DepGraph<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug + Eq> Debug for DepGraph<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Eq> Default for DepGraph<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for DepGraph<T>

§

impl<T> RefUnwindSafe for DepGraph<T>
where T: RefUnwindSafe,

§

impl<T> Send for DepGraph<T>
where T: Send,

§

impl<T> Sync for DepGraph<T>
where T: Sync,

§

impl<T> Unpin for DepGraph<T>
where T: Unpin,

§

impl<T> UnwindSafe for DepGraph<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.