pub struct Import {
pub module: String,
pub names: Vec<String>,
pub alias: Option<String>,
pub is_wildcard: bool,
pub is_relative: bool,
pub line: usize,
}Expand description
An import statement
Fields§
§module: StringThe module specifier as written in source (e.g., "./foo" or std::collections).
names: Vec<String>Specific names imported from the module (e.g., ["HashMap", "HashSet"]).
alias: Option<String>Local alias for the import (e.g., import numpy as np → "np").
is_wildcard: boolTrue for wildcard imports (import * / use *).
is_relative: boolTrue for relative imports (e.g., ./foo, ../bar).
line: usizeSource line number where this import appears.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Import
impl<'de> Deserialize<'de> for Import
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Import
impl RefUnwindSafe for Import
impl Send for Import
impl Sync for Import
impl Unpin for Import
impl UnsafeUnpin for Import
impl UnwindSafe for Import
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