Struct python_ast::tree::statement::Statement
source · pub struct Statement {
pub lineno: Option<usize>,
pub col_offset: Option<usize>,
pub end_lineno: Option<usize>,
pub end_col_offset: Option<usize>,
pub statement: StatementType,
}
Fields§
§lineno: Option<usize>
§col_offset: Option<usize>
§end_lineno: Option<usize>
§end_col_offset: Option<usize>
§statement: StatementType
Trait Implementations§
source§impl<'a> CodeGen for Statement
impl<'a> CodeGen for Statement
§type Context = CodeGenContext
type Context = CodeGenContext
A type, generally an enum, that passes the code generator the context of the node.
§type Options = PythonOptions
type Options = PythonOptions
A struct representing the set of compilation options.
source§fn to_rust(
self,
ctx: Self::Context,
options: Self::Options
) -> Result<TokenStream, Box<dyn Error>>
fn to_rust( self, ctx: Self::Context, options: Self::Options ) -> 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<'a> FromPyObject<'a> for Statement
impl<'a> FromPyObject<'a> for Statement
source§impl<'a> Node<'a> for Statement
impl<'a> Node<'a> for Statement
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.
Auto Trait Implementations§
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnwindSafe for Statement
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