Trait ConvertFrom

Source
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§

Source

fn convert_from(value: T, context: &CompileContext) -> Expr<Self>

Convert a value to Self.

§Errors

Returns an error if the conversion is invalid.

Source

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.

Implementors§

Source§

impl ConvertFrom<AnyExpr> for Circle

Source§

impl ConvertFrom<AnyExpr> for Line

Source§

impl ConvertFrom<AnyExpr> for Point

Source§

impl ConvertFrom<AnyExpr> for Derived

Source§

impl ConvertFrom<AnyExpr> for Number

Source§

impl ConvertFrom<AnyExpr> for PointCollection

Source§

impl ConvertFrom<Expr<Circle>> for Circle

Source§

impl ConvertFrom<Expr<Circle>> for Line

Source§

impl ConvertFrom<Expr<Circle>> for Point

Source§

impl ConvertFrom<Expr<Circle>> for Derived

Source§

impl ConvertFrom<Expr<Circle>> for Number

Source§

impl ConvertFrom<Expr<Circle>> for PointCollection

Source§

impl ConvertFrom<Expr<Line>> for Circle

Source§

impl ConvertFrom<Expr<Line>> for Line

Source§

impl ConvertFrom<Expr<Line>> for Point

Source§

impl ConvertFrom<Expr<Line>> for Derived

Source§

impl ConvertFrom<Expr<Line>> for Number

Source§

impl ConvertFrom<Expr<Line>> for PointCollection

Source§

impl ConvertFrom<Expr<Point>> for Circle

Source§

impl ConvertFrom<Expr<Point>> for Line

Source§

impl ConvertFrom<Expr<Point>> for Point

Source§

impl ConvertFrom<Expr<Point>> for Derived

Source§

impl ConvertFrom<Expr<Point>> for Number

Source§

impl ConvertFrom<Expr<Point>> for PointCollection

Source§

impl ConvertFrom<Expr<Unknown>> for Circle

Source§

impl ConvertFrom<Expr<Unknown>> for Line

Source§

impl ConvertFrom<Expr<Unknown>> for Point

Source§

impl ConvertFrom<Expr<Unknown>> for Derived

Source§

impl ConvertFrom<Expr<Unknown>> for Number

Source§

impl ConvertFrom<Expr<Unknown>> for PointCollection

Source§

impl ConvertFrom<Expr<Derived>> for Circle

Source§

impl ConvertFrom<Expr<Derived>> for Line

Source§

impl ConvertFrom<Expr<Derived>> for Point

Source§

impl ConvertFrom<Expr<Derived>> for Derived

Source§

impl ConvertFrom<Expr<Derived>> for Number

Source§

impl ConvertFrom<Expr<Derived>> for PointCollection

Source§

impl ConvertFrom<Expr<Number>> for Circle

Source§

impl ConvertFrom<Expr<Number>> for Line

Source§

impl ConvertFrom<Expr<Number>> for Point

Source§

impl ConvertFrom<Expr<Number>> for Derived

Source§

impl ConvertFrom<Expr<Number>> for Number

Source§

impl ConvertFrom<Expr<Number>> for PointCollection

Source§

impl ConvertFrom<Expr<PointCollection>> for Circle

Source§

impl ConvertFrom<Expr<PointCollection>> for Line

Source§

impl ConvertFrom<Expr<PointCollection>> for Point

Source§

impl ConvertFrom<Expr<PointCollection>> for Derived

Source§

impl ConvertFrom<Expr<PointCollection>> for Number

Source§

impl ConvertFrom<Expr<PointCollection>> for PointCollection