Skip to main content

ExportTrace

Struct ExportTrace 

Source
pub struct ExportTrace {
    pub file: PathBuf,
    pub export_name: String,
    pub namespace: SemanticNamespace,
    pub file_reachable: bool,
    pub is_entry_point: bool,
    pub is_used: bool,
    pub direct_references: Vec<ExportReference>,
    pub direct_references_by_namespace: Vec<NamespacedExportReferences>,
    pub star_export_ambiguity: Option<StarExportAmbiguity>,
    pub re_export_chains: Vec<ReExportChain>,
    pub reason: String,
    pub semantic: Option<SemanticSymbolTrace>,
}
Expand description

Result of tracing an export: why it is considered used or unused.

Fields§

§file: PathBuf

The file containing the export.

§export_name: String

The export name being traced.

§namespace: SemanticNamespace

Namespace whose references are listed for the traced export. The preferred lane wins whenever it carries a reference: value for a value export, type for a type-only one. When the preferred lane carries none and the other lane resolves to the same declaration, the other lane’s references are listed and this field names it, so a value export whose only credit is a bound import type reports type with is_used: true. is_used and direct_references follow the listed lane only, and only reachable reference sources can credit it. Legal declaration merges share one declaration group across lanes, including an interface next to a same-name class and a class next to a same-name namespace, so references to either lane credit the merged declaration. Distinct same-name declarations outside a merge remain separate and keep the preferred lane. semantic.target.namespace names the lane the declaration itself occupies and can therefore differ from this field. Producers always emit the field; the schema permits omission by payloads created before namespaces were exposed.

§file_reachable: bool

Whether the file is reachable from an entry point.

§is_entry_point: bool

Whether the file is an entry point.

§is_used: bool

Whether the export is considered used.

§direct_references: Vec<ExportReference>

Files that reference this export directly.

§direct_references_by_namespace: Vec<NamespacedExportReferences>

Reachable direct references grouped by namespace. This is additive to namespace and direct_references, whose winning-lane meaning remains unchanged for backwards compatibility.

§star_export_ambiguity: Option<StarExportAmbiguity>

A star-export collision that makes the traced name ambiguous. When present, is_used: false is an abstention rather than an unused-code verdict.

§re_export_chains: Vec<ReExportChain>

Re-export chains that pass through this export.

§reason: String

Human-readable reason summary.

§semantic: Option<SemanticSymbolTrace>

Exact checker-backed references when type-aware tracing is enabled.

Trait Implementations§

Source§

impl Debug for ExportTrace

Source§

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

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

impl Serialize for ExportTrace

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
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<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.