Skip to main content

ReturnHandler

Trait ReturnHandler 

Source
pub trait ReturnHandler: Debug {
    // Required methods
    fn type_system(&self) -> ModelTypeSystem;
    fn rust_ty(&self) -> Type;
    fn return_type_span(&self) -> Span;
    fn is_infallible(&self) -> bool;

    // Provided methods
    fn com_ty(&self) -> Type { ... }
    fn com_to_rust_return(&self, _result: &Ident) -> TokenStream { ... }
    fn rust_to_com_return(&self, _result: &Ident) -> TokenStream { ... }
    fn com_out_args(&self) -> Vec<ComArg> { ... }
}
Expand description

Defines return handler for handling various different return type schemes.

Required Methods§

Source

fn type_system(&self) -> ModelTypeSystem

Returns the current type system. Used internally by the trait.

Source

fn rust_ty(&self) -> Type

The return type of the original Rust method.

Source

fn return_type_span(&self) -> Span

The return type span.

Source

fn is_infallible(&self) -> bool

Infallible status.

Provided Methods§

Source

fn com_ty(&self) -> Type

The return type for COM implementation.

Source

fn com_to_rust_return(&self, _result: &Ident) -> TokenStream

Gets the return statement for converting the COM result into Rust return.

Source

fn rust_to_com_return(&self, _result: &Ident) -> TokenStream

Gets the return statement for converting the Rust result into COM outputs.

Source

fn com_out_args(&self) -> Vec<ComArg>

Gets the COM out arguments that result from the Rust return type.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§