Expression

Trait Expression 

Source
pub trait Expression: Debug {
    // Required methods
    fn to_expr(&self) -> Expr;
    fn to_pattern(&self) -> Pat;
    fn to_type() -> Type;
}
Expand description

Convert to a variety of source-code-related formats.

Required Methods§

Source

fn to_expr(&self) -> Expr

Convert &Self -> syn::Expr.

Source

fn to_pattern(&self) -> Pat

Convert &Self -> syn::Pat.

Source

fn to_type() -> Type

Write a syn::Type type representing this value’s type.

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.

Implementations on Foreign Types§

Source§

impl Expression for char

Source§

impl Expression for u8

Implementors§