EvalType

Trait EvalType 

Source
pub trait EvalType: EvalTypeMethods + 'static {
    type RefType<'a>;

    // Required methods
    fn type_info() -> TypeInfo;
    fn to_ref_type<'a>(&'a self) -> Self::RefType<'a>;
    fn register<Ctx: EvalType>(
        registry: RegistryAccess<'_, Ctx, Self>,
    ) -> Result<()>;

    // Provided method
    fn make_dyn_fn<Ctx: EvalType>(
        f: impl for<'a> Fn(&'a Ctx) -> Self::RefType<'a> + Clone + 'static,
    ) -> DynFn { ... }
}

Required Associated Types§

Source

type RefType<'a>

Required Methods§

Source

fn type_info() -> TypeInfo

Source

fn to_ref_type<'a>(&'a self) -> Self::RefType<'a>

Source

fn register<Ctx: EvalType>( registry: RegistryAccess<'_, Ctx, Self>, ) -> Result<()>

Provided Methods§

Source

fn make_dyn_fn<Ctx: EvalType>( f: impl for<'a> Fn(&'a Ctx) -> Self::RefType<'a> + Clone + 'static, ) -> DynFn

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 EvalType for f64

Source§

type RefType<'a> = f64

Source§

fn type_info() -> TypeInfo

Source§

fn to_ref_type<'a>(&'a self) -> Self::RefType<'a>

Source§

fn register<Ctx: EvalType>( registry: RegistryAccess<'_, Ctx, Self>, ) -> Result<()>

Source§

impl EvalType for i64

Source§

type RefType<'a> = i64

Source§

fn type_info() -> TypeInfo

Source§

fn to_ref_type<'a>(&'a self) -> Self::RefType<'a>

Source§

fn register<Ctx: EvalType>( registry: RegistryAccess<'_, Ctx, Self>, ) -> Result<()>

Source§

impl EvalType for ()

Source§

type RefType<'a> = ()

Source§

fn type_info() -> TypeInfo

Source§

fn to_ref_type<'a>(&'a self) -> Self::RefType<'a>

Source§

fn register<Ctx: EvalType>( _registry: RegistryAccess<'_, Ctx, Self>, ) -> Result<()>

Source§

impl EvalType for String

Source§

type RefType<'a> = Cow<'a, str>

Source§

fn type_info() -> TypeInfo

Source§

fn to_ref_type<'a>(&'a self) -> Self::RefType<'a>

Source§

fn register<Ctx: EvalType>( registry: RegistryAccess<'_, Ctx, Self>, ) -> Result<()>

Source§

impl<T1, T2> EvalType for (T1, T2)
where T1: EvalType, T2: EvalType,

Source§

type RefType<'a> = &'a (T1, T2)

Source§

fn type_info() -> TypeInfo

Source§

fn to_ref_type<'a>(&'a self) -> Self::RefType<'a>

Source§

fn register<Ctx: EvalType>( _registry: RegistryAccess<'_, Ctx, Self>, ) -> Result<()>

Source§

impl<T1, T2, T3> EvalType for (T1, T2, T3)
where T1: EvalType, T2: EvalType, T3: EvalType,

Source§

type RefType<'a> = &'a (T1, T2, T3)

Source§

fn type_info() -> TypeInfo

Source§

fn to_ref_type<'a>(&'a self) -> Self::RefType<'a>

Source§

fn register<Ctx: EvalType>( _registry: RegistryAccess<'_, Ctx, Self>, ) -> Result<()>

Source§

impl<T1, T2, T3, T4> EvalType for (T1, T2, T3, T4)
where T1: EvalType, T2: EvalType, T3: EvalType, T4: EvalType,

Source§

type RefType<'a> = &'a (T1, T2, T3, T4)

Source§

fn type_info() -> TypeInfo

Source§

fn to_ref_type<'a>(&'a self) -> Self::RefType<'a>

Source§

fn register<Ctx: EvalType>( _registry: RegistryAccess<'_, Ctx, Self>, ) -> Result<()>

Source§

impl<T1, T2, T3, T4, T5> EvalType for (T1, T2, T3, T4, T5)
where T1: EvalType, T2: EvalType, T3: EvalType, T4: EvalType, T5: EvalType,

Source§

type RefType<'a> = &'a (T1, T2, T3, T4, T5)

Source§

fn type_info() -> TypeInfo

Source§

fn to_ref_type<'a>(&'a self) -> Self::RefType<'a>

Source§

fn register<Ctx: EvalType>( _registry: RegistryAccess<'_, Ctx, Self>, ) -> Result<()>

Implementors§