Enum python_parser::ast::Import[][src]

pub enum Import {
    ImportFrom {
        leading_dots: usize,
        path: Vec<Name>,
        names: Vec<(Name, Option<Name>)>,
    },
    ImportStarFrom {
        leading_dots: usize,
        path: Vec<Name>,
    },
    Import {
        names: Vec<(Vec<Name>, Option<Name>)>,
    },
}

An import statement.

Variants

from x import y

Fields of ImportFrom

For from .....x import y, this is 5

For from .....x import y, this x

For from x import y, z, this vec![(y, None), (vec![z], None)]. For from x import y as z, this vec![(y, Some(z))].

For from x import *, this is vec![].

Fields of ImportStarFrom

import x.y as z, foo.bar is Import::Import(vec![(vec![x, y], Some(z)), (vec![foo, bar], None)]).

Fields of Import

Trait Implementations

impl Clone for Import
[src]
[+]

[]

Returns a copy of the value. Read more

[]

Performs copy-assignment from source. Read more

impl Debug for Import
[src]
[+]

[]

Formats the value using the given formatter. Read more

impl PartialEq for Import
[src]
[+]

[]

This method tests for self and other values to be equal, and is used by ==. Read more

[]

This method tests for !=.

impl Eq for Import
[src]

impl Hash for Import
[src]
[+]

[]

Feeds this value into the given [Hasher]. Read more

[]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Send for Import

impl Sync for Import