Skip to main content

Cycle

Struct Cycle 

Source
pub struct Cycle {
    pub path: Vec<Name>,
    pub others: Vec<Name>,
    pub edges: Vec<CycleEdge>,
}
Expand description

A dependency cycle: one loop through a strongly-connected component of the import graph, alongside the import that created each edge between consecutive modules (wrapping around to the first), and any component member that loop does not pass through.

Fields§

§path: Vec<Name>

One cycle within the strongly-connected component, in cycle order — what the summary note is built from. Not necessarily every module in the component: a component with several overlapping loops has more than one cycle in it, and picking the shortest one through a single start node (see cycle_walk) can leave others out. Finding a cycle that covers every member is the Hamiltonian cycle problem, and no such cycle need exist, so this does not try; the members left out are in Cycle::others instead, and the note names them so a user does not break one loop and immediately hit the next one hiding in the same component.

§others: Vec<Name>

The other modules in the same component: genuinely part of the circular dependency, but not on the particular cycle path names. Empty whenever path already covers the component, which every fixture and every real import graph seen so far is.

§edges: Vec<CycleEdge>

edges[i] is the import written in path[i] that names path[i + 1] (or path[0], for the last edge). Same length as path, and every entry is a real import, because cycle_walk only ever returns a path whose consecutive pairs are edges of the graph.

Trait Implementations§

Source§

impl Clone for Cycle

Source§

fn clone(&self) -> Cycle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Cycle

Source§

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

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

impl PartialEq for Cycle

Source§

fn eq(&self, other: &Cycle) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Cycle

Auto Trait Implementations§

§

impl Freeze for Cycle

§

impl RefUnwindSafe for Cycle

§

impl Send for Cycle

§

impl Sync for Cycle

§

impl Unpin for Cycle

§

impl UnsafeUnpin for Cycle

§

impl UnwindSafe for Cycle

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.