Struct AsyncFor

Source
pub struct AsyncFor {
    pub target: ExprType,
    pub iter: ExprType,
    pub body: Vec<Statement>,
    pub orelse: Vec<Statement>,
    pub lineno: Option<usize>,
    pub col_offset: Option<usize>,
    pub end_lineno: Option<usize>,
    pub end_col_offset: Option<usize>,
}
Expand description

Async for loop (async for target in iter: …)

Fields§

§target: ExprType

The target variable(s)

§iter: ExprType

The iterable expression

§body: Vec<Statement>

The body of the loop

§orelse: Vec<Statement>

The else clause (executed when the loop completes normally)

§lineno: Option<usize>

Position information

§col_offset: Option<usize>§end_lineno: Option<usize>§end_col_offset: Option<usize>

Trait Implementations§

Source§

impl Clone for AsyncFor

Source§

fn clone(&self) -> AsyncFor

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CodeGen for AsyncFor

Source§

type Context = CodeGenContext

A type, generally an enum, that passes the code generator the context of the node.
Source§

type Options = PythonOptions

A struct representing the set of compilation options.
Source§

type SymbolTable = SymbolTableScopes

A trait for a symbol table
Source§

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>>

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>

A trait method for extracting a docstring from an object that can have a docstring.
Source§

impl Debug for AsyncFor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AsyncFor

Source§

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 AsyncFor

Source§

fn extract_bound(ob: &Bound<'a, PyAny>) -> PyResult<Self>

Extracts Self from the bound smart pointer obj. Read more
Source§

impl Node for AsyncFor

Source§

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>

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>

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>

A method for getting the ending column of the node. This may not exist for all node types.
Source§

fn error_message( &self, mod_name: impl AsRef<str>, message: impl AsRef<str>, ) -> String

Generate an error message for the current code, adding line and column number.
Source§

impl PartialEq for AsyncFor

Source§

fn eq(&self, other: &AsyncFor) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AsyncFor

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for AsyncFor

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErrorContext for T
where T: Debug,

Source§

fn with_context(&self, operation: &str) -> String

Generate a standardized error message with context.
Source§

impl<'a, T> ExtractFromPython<'a> for T
where T: FromPyObject<'a>,

Source§

fn extract_with_context( ob: &Bound<'a, PyAny>, context: &str, ) -> Result<T, PyErr>

Extract from Python object with context for better error messages.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'py, T> FromPyObjectBound<'_, 'py> for T
where T: FromPyObject<'py>,

Source§

fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>

Extracts Self from the bound smart pointer obj. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Ungil for T
where T: Send,