pub struct InstallGraph<'a> { /* private fields */ }
Expand description

A simple directed acyclic graph representation of a unity version and it’s modules. This graph allows the traversal of to be installed modules in a topological order. It is also possible to query submodule and or dependencies for a given module.

Implementations§

source§

impl<'a> InstallGraph<'a>

source

pub fn node_count(&self) -> usize

The total number of nodes in the Dag.

source

pub fn keep(&mut self, modules: &HashSet<Component>)

source

pub fn from(manifest: &'a Manifest<'a>) -> Self

Builds a Dag representation of the given Manifest.

source

pub fn topo(&self) -> Topo<NodeIndex, FixedBitSet>

Creates a Topo traversal struct from the current graph to walk the graph in topological order.

source

pub fn version(&self) -> &Version

source

pub fn manifest(&self) -> &Manifest<'_>

source

pub fn mark_all(&mut self, install_status: InstallStatus)

Mark all nodes with the given InstallStatus.

source

pub fn mark_all_missing(&mut self)

Mark all nodes as InstallStatus::Missing.

source

pub fn mark_installed(&mut self, modules: &HashSet<Component>)

Mark all nodes contained in modules as InstallStatus::Installed. If the node is not found in modules the node gets marked as InstallStatus::Missing.

source

pub fn component(&self, node: NodeIndex) -> Option<&Component>

Returns the component for the given node index.

source

pub fn install_status(&self, node: NodeIndex) -> Option<&InstallStatus>

source

pub fn get_node_id(&self, component: Component) -> Option<NodeIndex>

source

pub fn depth(&self, node: NodeIndex) -> usize

source

pub fn get_dependend_modules( &self, node: NodeIndex ) -> Vec<((Component, InstallStatus), NodeIndex)>

Returns a Vec with all depended modules for the given node.

source

pub fn get_sub_modules( &self, node: NodeIndex ) -> Vec<((Component, InstallStatus), NodeIndex)>

Returns a Vec with all submodules for the given node.

source

pub fn context(&self) -> &Dag<(Component, InstallStatus), ()>

Trait Implementations§

source§

impl<'a> Debug for InstallGraph<'a>

source§

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

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

impl<'a> From<&'a Manifest<'a>> for InstallGraph<'a>

source§

fn from(manifest: &'a Manifest<'a>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for InstallGraph<'a>

§

impl<'a> Send for InstallGraph<'a>

§

impl<'a> Sync for InstallGraph<'a>

§

impl<'a> Unpin for InstallGraph<'a>

§

impl<'a> UnwindSafe for InstallGraph<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

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

§

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