pub struct GeneratorExp {
pub elt: Box<ExprType>,
pub generators: Vec<Comprehension>,
pub lineno: Option<usize>,
pub col_offset: Option<usize>,
pub end_lineno: Option<usize>,
pub end_col_offset: Option<usize>,
}
Expand description
Generator expression (e.g., (x for x in range(10) if x % 2 == 0))
Fields§
§elt: Box<ExprType>
The element expression being computed
generators: Vec<Comprehension>
The generators (for clauses)
lineno: Option<usize>
Position information
col_offset: Option<usize>
§end_lineno: Option<usize>
§end_col_offset: Option<usize>
Trait Implementations§
Source§impl Clone for GeneratorExp
impl Clone for GeneratorExp
Source§fn clone(&self) -> GeneratorExp
fn clone(&self) -> GeneratorExp
Returns a duplicate 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 CodeGen for GeneratorExp
impl CodeGen for GeneratorExp
Source§type Context = CodeGenContext
type Context = CodeGenContext
A type, generally an enum, that passes the code generator the context of the node.
Source§type Options = PythonOptions
type Options = PythonOptions
A struct representing the set of compilation options.
Source§type SymbolTable = SymbolTableScopes
type SymbolTable = SymbolTableScopes
A trait for a symbol table
Source§fn find_symbols(self, symbols: Self::SymbolTable) -> Self::SymbolTable
fn find_symbols(self, symbols: Self::SymbolTable) -> Self::SymbolTable
A default implementation for find_symbols(), which simply returns the input.
Language nodes that modify the symbol table should override this method.
Source§fn to_rust(
self,
ctx: Self::Context,
options: Self::Options,
symbols: Self::SymbolTable,
) -> Result<TokenStream, Box<dyn Error>>
fn to_rust( self, ctx: Self::Context, options: Self::Options, symbols: Self::SymbolTable, ) -> Result<TokenStream, Box<dyn Error>>
A trait method to output Rust code in a general sense. The output should be stream of Rust tokens,
however, it is not guaranteed that it will fully compile because of scoping errors and other checks
that don’t occur until later.
Source§fn get_docstring(&self) -> Option<String>
fn get_docstring(&self) -> Option<String>
A trait method for extracting a docstring from an object that can have a docstring.
Source§impl Debug for GeneratorExp
impl Debug for GeneratorExp
Source§impl<'de> Deserialize<'de> for GeneratorExp
impl<'de> Deserialize<'de> for GeneratorExp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> FromPyObject<'a> for GeneratorExp
impl<'a> FromPyObject<'a> for GeneratorExp
Source§impl Node for GeneratorExp
impl Node for GeneratorExp
Source§fn lineno(&self) -> Option<usize>
fn lineno(&self) -> Option<usize>
A method for getting the starting line number of the node. This may not exist for all node types.
Source§fn col_offset(&self) -> Option<usize>
fn col_offset(&self) -> Option<usize>
A method for getting the starting column of the node. This may not exist for all node types.
Source§fn end_lineno(&self) -> Option<usize>
fn end_lineno(&self) -> Option<usize>
A method for getting the ending line number of the node. This may not exist for all node types.
Source§fn end_col_offset(&self) -> Option<usize>
fn end_col_offset(&self) -> Option<usize>
A method for getting the ending column of the node. This may not exist for all node types.
Source§impl PartialEq for GeneratorExp
impl PartialEq for GeneratorExp
Source§impl Serialize for GeneratorExp
impl Serialize for GeneratorExp
impl StructuralPartialEq for GeneratorExp
Auto Trait Implementations§
impl Freeze for GeneratorExp
impl RefUnwindSafe for GeneratorExp
impl Send for GeneratorExp
impl Sync for GeneratorExp
impl Unpin for GeneratorExp
impl UnwindSafe for GeneratorExp
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> ErrorContext for Twhere
T: Debug,
impl<T> ErrorContext for Twhere
T: Debug,
Source§fn with_context(&self, operation: &str) -> String
fn with_context(&self, operation: &str) -> String
Generate a standardized error message with context.