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
Source§impl JsonSchema for ImportPathTrace
impl JsonSchema for ImportPathTrace
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Serialize for ImportPathTrace
impl Serialize for ImportPathTrace
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
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> ⓘ
Converts
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> ⓘ
Converts
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