pub struct ImportPathTrace {
pub schema_version: ImportPathTraceSchemaVersion,
pub from: String,
pub to: String,
pub reachable: bool,
pub hops: usize,
pub path: Vec<ImportPathHop>,
pub reason: String,
}Expand description
Result of asking how one module reaches another: the shortest import path.
reachable is the only field that separates “no route exists” from “the
route is empty because both ends are the same module”. Both report
hops: 0, so a consumer must read reachable, never the hop count.
Fields§
§schema_version: ImportPathTraceSchemaVersionWire-shape version of this payload.
from: StringThe module the walk started from, root-relative.
to: StringThe module the walk was looking for, root-relative.
reachable: boolWhether to is reachable from from by following import edges.
hops: usizeNumber of import edges on the reported route. 0 both when the two ends
are the same module and when there is no route at all.
path: Vec<ImportPathHop>The route, in import order. Empty whenever hops is 0.
reason: StringHuman-readable summary of the outcome.
Trait Implementations§
Source§impl Debug for ImportPathTrace
impl Debug for ImportPathTrace
Auto Trait Implementations§
impl Freeze for ImportPathTrace
impl RefUnwindSafe for ImportPathTrace
impl Send for ImportPathTrace
impl Sync for ImportPathTrace
impl Unpin for ImportPathTrace
impl UnsafeUnpin for ImportPathTrace
impl UnwindSafe for ImportPathTrace
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