pub struct Import {
pub module: String,
pub relative_dots: u8,
pub names: Vec<String>,
pub bindings: Vec<String>,
pub is_star: bool,
pub type_checking_only: bool,
pub line: u32,
}Expand description
An import / from ... import ... statement.
Fields§
§module: StringThe module path, e.g. os.path or mypkg.sub. Empty for relative dots
captured in relative_dots.
relative_dots: u8Number of leading dots in a relative import (from . import x -> 1).
names: Vec<String>Imported names (from m import a, b -> [a, b]). Empty for import m.
bindings: Vec<String>Local names this statement binds, honoring aliases: import a.b -> [a];
import a.b as c -> [c]; from m import x as y -> [y]. Empty for *.
is_star: boolTrue for from m import *.
type_checking_only: boolTrue if guarded by if TYPE_CHECKING: / if False: — a deliberate
type-only import that must never be flagged as unused.
line: u32Trait Implementations§
impl Eq for Import
impl StructuralPartialEq for Import
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
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
Compare self to
key and return true if they are equal.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