pub struct DependencyEdge {
pub from: PathBuf,
pub to: PathBuf,
pub dep_type: DependencyType,
pub symbol: Option<SymbolDependency>,
}Expand description
A dependency edge representing a relationship between two files.
Edges are directed: from depends on to. For example, if main.rs
imports utils.rs, the edge is from: main.rs, to: utils.rs.
§Examples
use thread_flow::incremental::types::{DependencyEdge, DependencyType};
use std::path::PathBuf;
let edge = DependencyEdge {
from: PathBuf::from("src/main.rs"),
to: PathBuf::from("src/utils.rs"),
dep_type: DependencyType::Import,
symbol: None,
};
assert_eq!(edge.dep_type, DependencyType::Import);Fields§
§from: PathBufSource file path (the file that depends on another).
to: PathBufTarget file path (the file being depended upon).
dep_type: DependencyTypeThe type of dependency relationship.
symbol: Option<SymbolDependency>Optional symbol-level dependency information. When present, enables finer-grained invalidation.
Implementations§
Source§impl DependencyEdge
impl DependencyEdge
Sourcepub fn new(from: PathBuf, to: PathBuf, dep_type: DependencyType) -> Self
pub fn new(from: PathBuf, to: PathBuf, dep_type: DependencyType) -> Self
Creates a new dependency edge with the given parameters.
§Arguments
from- The source file path (dependent).to- The target file path (dependency).dep_type- The type of dependency.
§Examples
use thread_flow::incremental::types::{DependencyEdge, DependencyType};
use std::path::PathBuf;
let edge = DependencyEdge::new(
PathBuf::from("a.rs"),
PathBuf::from("b.rs"),
DependencyType::Import,
);
assert!(edge.symbol.is_none());Sourcepub fn with_symbol(
from: PathBuf,
to: PathBuf,
dep_type: DependencyType,
symbol: SymbolDependency,
) -> Self
pub fn with_symbol( from: PathBuf, to: PathBuf, dep_type: DependencyType, symbol: SymbolDependency, ) -> Self
Creates a new dependency edge with symbol-level tracking.
§Arguments
from- The source file path (dependent).to- The target file path (dependency).dep_type- The type of dependency.symbol- Symbol-level dependency information.
Sourcepub fn effective_strength(&self) -> DependencyStrength
pub fn effective_strength(&self) -> DependencyStrength
Returns the effective dependency strength.
If a symbol-level dependency is present, uses its strength.
Otherwise, defaults to DependencyStrength::Strong for import/trait
edges and DependencyStrength::Weak for export edges.
Trait Implementations§
Source§impl Clone for DependencyEdge
impl Clone for DependencyEdge
Source§fn clone(&self) -> DependencyEdge
fn clone(&self) -> DependencyEdge
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DependencyEdge
impl Debug for DependencyEdge
Source§impl<'de> Deserialize<'de> for DependencyEdge
impl<'de> Deserialize<'de> for DependencyEdge
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>,
Source§impl PartialEq for DependencyEdge
impl PartialEq for DependencyEdge
Source§impl Serialize for DependencyEdge
impl Serialize for DependencyEdge
impl Eq for DependencyEdge
impl StructuralPartialEq for DependencyEdge
Auto Trait Implementations§
impl Freeze for DependencyEdge
impl RefUnwindSafe for DependencyEdge
impl Send for DependencyEdge
impl Sync for DependencyEdge
impl Unpin for DependencyEdge
impl UnsafeUnpin for DependencyEdge
impl UnwindSafe for DependencyEdge
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more