geo_aid_script::unroll

Trait Convert

source
pub trait Convert
where Self: Sized,
{ // Required methods fn convert<T: ConvertFrom<Self>>(self, context: &CompileContext) -> Expr<T>; fn can_convert<T: ConvertFrom<Self>>(&self) -> bool; }
Expand description

Helper trait for unrolled expression conversions. Automatically implemented. Kinda like Into

Required Methods§

source

fn convert<T: ConvertFrom<Self>>(self, context: &CompileContext) -> Expr<T>

Convert self into a specific type.

§Errors

Returns an error if the conversion is invalid.

source

fn can_convert<T: ConvertFrom<Self>>(&self) -> bool

Check if self can be converted into a specific type.

§Errors

Returns an error if the conversion is invalid.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> Convert for T