pub struct ParsedFromImport {
pub line: usize,
pub end_line: usize,
pub module: String,
pub names: Vec<ImportedName>,
pub is_multiline: bool,
}Expand description
A parsed from X import a, b (or multiline variant) statement.
Fields§
§line: usize0-based line of the from keyword.
end_line: usize0-based last line of the statement (equals line for single-line imports).
module: StringFully-qualified module path, including leading dots for relative imports.
names: Vec<ImportedName>Names imported.
Note: for multiline imports parsed via the string fallback (i.e. the file had syntax errors), this list will be empty because the individual names cannot be reliably extracted line-by-line. The AST path always populates this field correctly.
is_multiline: booltrue when the import spans multiple lines (parenthesised form).
Implementations§
Trait Implementations§
Source§impl Clone for ParsedFromImport
impl Clone for ParsedFromImport
Source§fn clone(&self) -> ParsedFromImport
fn clone(&self) -> ParsedFromImport
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParsedFromImport
impl Debug for ParsedFromImport
Source§impl PartialEq for ParsedFromImport
impl PartialEq for ParsedFromImport
Source§fn eq(&self, other: &ParsedFromImport) -> bool
fn eq(&self, other: &ParsedFromImport) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ParsedFromImport
Auto Trait Implementations§
impl Freeze for ParsedFromImport
impl RefUnwindSafe for ParsedFromImport
impl Send for ParsedFromImport
impl Sync for ParsedFromImport
impl Unpin for ParsedFromImport
impl UnsafeUnpin for ParsedFromImport
impl UnwindSafe for ParsedFromImport
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<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