Trait ChainableOperation

Source
pub trait ChainableOperation {
    type Operand;
    type Operator;

    // Required methods
    fn operands(&self) -> Vec<&Self::Operand>;
    fn operators(&self) -> Vec<&Self::Operator>;
    fn generate_chained_rust(
        &self,
        ctx: CodeGenContext,
        options: PythonOptions,
        symbols: SymbolTableScopes,
    ) -> Result<TokenStream, Box<dyn Error>>;
}
Expand description

Trait for operations that can be chained (like comparison operations).

Required Associated Types§

Required Methods§

Source

fn operands(&self) -> Vec<&Self::Operand>

Get all operands in the chain.

Source

fn operators(&self) -> Vec<&Self::Operator>

Get all operators in the chain.

Source

fn generate_chained_rust( &self, ctx: CodeGenContext, options: PythonOptions, symbols: SymbolTableScopes, ) -> Result<TokenStream, Box<dyn Error>>

Generate chained Rust code.

Implementors§