Trait PythonOperator

Source
pub trait PythonOperator: Clone + Debug {
    // Required methods
    fn to_rust_op(&self) -> Result<TokenStream, Box<dyn Error>>;
    fn is_unknown(&self) -> bool;

    // Provided method
    fn precedence(&self) -> u8 { ... }
}
Expand description

Common trait for Python operators that can be converted to Rust tokens.

Required Methods§

Source

fn to_rust_op(&self) -> Result<TokenStream, Box<dyn Error>>

Convert the operator to its Rust equivalent TokenStream.

Source

fn is_unknown(&self) -> bool

Check if this operator is unknown/unimplemented.

Provided Methods§

Source

fn precedence(&self) -> u8

Get the operator precedence for proper parenthesization.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§