Skip to main content

ReplaceExpr

Trait ReplaceExpr 

Source
pub trait ReplaceExpr
where Self: Sized,
{ // Required method fn replace_expr(&self, expr: Expr) -> Option<Self>; // Provided method fn is_replaceable(&self) -> bool { ... } }
Expand description

Provides functionality to replacee inner Expr and return new Self with given Expr.

Required Methods§

Source

fn replace_expr(&self, expr: Expr) -> Option<Self>

Replaces current expr by given Expr if it’s possible, returning Some(new Self) with given Expr, otherwise returns None.

Provided Methods§

Source

fn is_replaceable(&self) -> bool

Can expr be replaced or not.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§