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§
Sourcefn to_rust_op(&self) -> Result<TokenStream, Box<dyn Error>>
fn to_rust_op(&self) -> Result<TokenStream, Box<dyn Error>>
Convert the operator to its Rust equivalent TokenStream.
Sourcefn is_unknown(&self) -> bool
fn is_unknown(&self) -> bool
Check if this operator is unknown/unimplemented.
Provided Methods§
Sourcefn precedence(&self) -> u8
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.