Skip to main content

PythonOperator

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;
}
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.

The error type is Box<dyn std::error::Error> to remain compatible with the upstream to_tokenstream::CodeGen trait. Implementors should still construct structured crate::Error values (anyhow_tracing::Error) underneath — those flow transparently into the boxed return type and remain downcast-able.

Source

fn is_unknown(&self) -> bool

Check if this operator is unknown/unimplemented.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§