#[non_exhaustive]pub struct Edge {
pub source: String,
pub target: String,
pub external: bool,
pub import_kinds: ImportKindSet,
}Expand description
One directed dependency in an extracted Rust project.
Internal endpoints are normalized workspace-relative file identifiers. When Self::external
is true, target is instead the Cargo-visible crate name used in source.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.source: StringThe internal file containing the dependency syntax.
target: StringThe internal target file or external Cargo-visible crate name.
external: boolWhether the target is outside the analyzed workspace.
import_kinds: ImportKindSetEvery Rust syntax form that produced this source-target pair.
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn new(
source: impl AsRef<str>,
target: impl AsRef<str>,
external: bool,
import_kinds: impl IntoIterator<Item = ImportKind>,
) -> Self
pub fn new( source: impl AsRef<str>, target: impl AsRef<str>, external: bool, import_kinds: impl IntoIterator<Item = ImportKind>, ) -> Self
Builds an edge and lexically normalizes both identifiers.
An edge whose normalized endpoints are equal is canonicalized to Self::self_edge.
Sourcepub fn self_edge(identifier: impl AsRef<str>) -> Self
pub fn self_edge(identifier: impl AsRef<str>) -> Self
Builds the marker edge that keeps a dependency-free file in the graph.
Sourcepub fn is_self_edge(&self) -> bool
pub fn is_self_edge(&self) -> bool
Returns whether this edge is the marker from a file to itself.
Trait Implementations§
Source§impl FromIterator<Edge> for Graph
impl FromIterator<Edge> for Graph
impl Eq for Edge
impl StructuralPartialEq for Edge
Auto Trait Implementations§
impl Freeze for Edge
impl RefUnwindSafe for Edge
impl Send for Edge
impl Sync for Edge
impl Unpin for Edge
impl UnwindSafe for Edge
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.