pub enum StatementType {
Show 13 variants
AsyncFunctionDef(FunctionDef),
Assign(Assign),
Break,
Continue,
ClassDef(ClassDef),
Call(Call),
Pass,
Return(Option<Expr>),
Import(Import),
ImportFrom(ImportFrom),
Expr(Expr),
FunctionDef(FunctionDef),
Unimplemented(String),
}
Variants§
AsyncFunctionDef(FunctionDef)
Assign(Assign)
Break
Continue
ClassDef(ClassDef)
Call(Call)
Pass
Return(Option<Expr>)
Import(Import)
ImportFrom(ImportFrom)
Expr(Expr)
FunctionDef(FunctionDef)
Unimplemented(String)
Trait Implementations§
Source§impl Clone for StatementType
impl Clone for StatementType
Source§fn clone(&self) -> StatementType
fn clone(&self) -> StatementType
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 CodeGen for StatementType
impl CodeGen for StatementType
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 StatementType
impl Debug for StatementType
Source§impl<'de> Deserialize<'de> for StatementType
impl<'de> Deserialize<'de> for StatementType
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 StatementType
impl<'a> FromPyObject<'a> for StatementType
Source§impl PartialEq for StatementType
impl PartialEq for StatementType
Source§impl Serialize for StatementType
impl Serialize for StatementType
impl StructuralPartialEq for StatementType
Auto Trait Implementations§
impl Freeze for StatementType
impl RefUnwindSafe for StatementType
impl Send for StatementType
impl Sync for StatementType
impl Unpin for StatementType
impl UnwindSafe for StatementType
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