pub enum ImportRequirement {
Module {
mod_name: String,
},
Symbol {
mod_name: String,
symbol_name: String,
},
SymbolAs {
mod_name: String,
symbol_name: String,
as_name: String,
},
}
Expand description
A struct to record a Python import statement.
Variants§
Module
A simple module import.
Symbol
A single symbol from a module.
SymbolAs
A single symbol from a module with the specified local name.
Implementations§
Trait Implementations§
source§impl Clone for ImportRequirement
impl Clone for ImportRequirement
source§fn clone(&self) -> ImportRequirement
fn clone(&self) -> ImportRequirement
Returns a copy of the value. Read more
1.0.0 · 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 ImportRequirement
impl Debug for ImportRequirement
source§impl Ord for ImportRequirement
impl Ord for ImportRequirement
source§fn cmp(&self, other: &ImportRequirement) -> Ordering
fn cmp(&self, other: &ImportRequirement) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<ImportRequirement> for ImportRequirement
impl PartialEq<ImportRequirement> for ImportRequirement
source§fn eq(&self, other: &ImportRequirement) -> bool
fn eq(&self, other: &ImportRequirement) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ImportRequirement> for ImportRequirement
impl PartialOrd<ImportRequirement> for ImportRequirement
source§fn partial_cmp(&self, other: &ImportRequirement) -> Option<Ordering>
fn partial_cmp(&self, other: &ImportRequirement) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for ImportRequirement
impl StructuralEq for ImportRequirement
impl StructuralPartialEq for ImportRequirement
Auto Trait Implementations§
impl RefUnwindSafe for ImportRequirement
impl Send for ImportRequirement
impl Sync for ImportRequirement
impl Unpin for ImportRequirement
impl UnwindSafe for ImportRequirement
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