pub struct ImportInfo {
pub module_path: String,
pub symbols: Vec<String>,
pub is_wildcard: bool,
pub relative_level: usize,
pub aliases: Vec<(String, String)>,
}Expand description
Information extracted from a single Python import statement.
Represents the parsed form of either import X or from X import Y
statements. The coordinator (Task 3.5) converts these into
DependencyEdge entries.
Fields§
§module_path: StringThe module path, with leading dots stripped for relative imports.
For import os.path this is "os.path".
For from .utils import helper this is "utils" (dots conveyed by relative_level).
For from . import x (no module name), this is "".
symbols: Vec<String>Specific symbols imported from the module.
Empty for bare import statements (e.g., import os).
Contains ["join", "exists"] for from os.path import join, exists.
is_wildcard: boolWhether this is a wildcard import (from module import *).
relative_level: usizeThe relative import depth.
0 for absolute imports, 1 for ., 2 for .., etc.
aliases: Vec<(String, String)>Aliases for imported names.
Maps original name to alias. For import numpy as np, contains
[("numpy", "np")]. For from os import path as ospath, contains
[("path", "ospath")].
Trait Implementations§
Source§impl Clone for ImportInfo
impl Clone for ImportInfo
Source§fn clone(&self) -> ImportInfo
fn clone(&self) -> ImportInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ImportInfo
impl Debug for ImportInfo
Source§impl PartialEq for ImportInfo
impl PartialEq for ImportInfo
impl Eq for ImportInfo
impl StructuralPartialEq for ImportInfo
Auto Trait Implementations§
impl Freeze for ImportInfo
impl RefUnwindSafe for ImportInfo
impl Send for ImportInfo
impl Sync for ImportInfo
impl Unpin for ImportInfo
impl UnsafeUnpin for ImportInfo
impl UnwindSafe for ImportInfo
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