pub trait ConvertFrom<T>: Displayed {
// Required methods
fn convert_from(value: T, context: &CompileContext) -> Expr<Self>;
fn can_convert_from(value: &T) -> bool;
}
Expand description
Helper trait for unrolled expression conversions.
Required Methods§
Sourcefn convert_from(value: T, context: &CompileContext) -> Expr<Self>
fn convert_from(value: T, context: &CompileContext) -> Expr<Self>
Sourcefn can_convert_from(value: &T) -> bool
fn can_convert_from(value: &T) -> bool
Check if conversion from a value to Self
can be made.
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.