[−][src]Struct genco::lang::python::ImportModule
The import of a Python module import module
.
Created through the import_module() function.
Implementations
impl ImportModule
[src]
pub fn with_alias<N>(self, new_alias: N) -> Self where
N: Into<ItemStr>,
[src]
N: Into<ItemStr>,
Set alias for imported module.
Examples
use genco::prelude::*; let toks = quote! { #(python::import_module("collections").with_alias("c")) }; assert_eq!( vec![ "import collections as c", "", "c", ], toks.to_file_vec()? );
Trait Implementations
impl AsAny for ImportModule
[src]
impl Clone for ImportModule
[src]
fn clone(&self) -> ImportModule
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ImportModule
[src]
impl Eq for ImportModule
[src]
impl FormatInto<Python> for ImportModule
[src]
fn format_into(self, tokens: &mut Tokens<Python>)
[src]
impl<'a> FormatInto<Python> for &'a ImportModule
[src]
fn format_into(self, tokens: &mut Tokens<Python>)
[src]
impl Hash for ImportModule
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl LangItem<Python> for ImportModule
[src]
fn format(&self, out: &mut Formatter, _: &Config, _: &Format) -> Result
[src]
fn as_import(&self) -> Option<&dyn AsAny>
[src]
fn __lang_item_as_any(&self) -> &dyn Any
[src]
fn __lang_item_clone(&self) -> Box<dyn LangItem<Python>>
[src]
fn __lang_item_eq(&self, other: &dyn LangItem<Python>) -> bool
[src]
impl Ord for ImportModule
[src]
fn cmp(&self, other: &ImportModule) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<ImportModule> for ImportModule
[src]
fn eq(&self, other: &ImportModule) -> bool
[src]
fn ne(&self, other: &ImportModule) -> bool
[src]
impl PartialOrd<ImportModule> for ImportModule
[src]
fn partial_cmp(&self, other: &ImportModule) -> Option<Ordering>
[src]
fn lt(&self, other: &ImportModule) -> bool
[src]
fn le(&self, other: &ImportModule) -> bool
[src]
fn gt(&self, other: &ImportModule) -> bool
[src]
fn ge(&self, other: &ImportModule) -> bool
[src]
impl Register<Python> for ImportModule
[src]
impl<'a> Register<Python> for &'a ImportModule
[src]
impl StructuralEq for ImportModule
[src]
impl StructuralPartialEq for ImportModule
[src]
Auto Trait Implementations
impl RefUnwindSafe for ImportModule
impl Send for ImportModule
impl Sync for ImportModule
impl Unpin for ImportModule
impl UnwindSafe for ImportModule
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,