Skip to main content

ToCore

Trait ToCore 

Source
pub trait ToCore {
    // Required method
    fn to_value(&self, table: &DataConTable) -> Result<Value, BridgeError>;
}
Expand description

Convert a Rust type to a Core Value (for interpolation into CoreExpr or evaluation).

This trait is used to inject Rust values into the Core evaluator.

Required Methods§

Source

fn to_value(&self, table: &DataConTable) -> Result<Value, BridgeError>

Convert this type to a Value using the provided DataConTable for lookups.

§Errors

Returns BridgeError::UnknownDataConName if a required constructor is missing from the table.

Implementations on Foreign Types§

Source§

impl ToCore for Value

Convert a serde_json::Value to a Tidepool Core Value matching the vendored Tidepool.Aeson.Value Haskell type.

The resulting Core value can be passed to Haskell code that expects Value (the aeson-compatible type) and accessed via lens combinators.

Source§

impl ToCore for Value

Source§

impl ToCore for bool

Source§

impl ToCore for char

Source§

impl ToCore for f64

Source§

impl ToCore for i32

Source§

impl ToCore for i64

Source§

impl ToCore for u64

Source§

impl ToCore for ()

Source§

impl ToCore for String

Source§

impl<A: ToCore, B: ToCore> ToCore for (A, B)

Source§

impl<A: ToCore, B: ToCore, C: ToCore> ToCore for (A, B, C)

Source§

impl<T> ToCore for PhantomData<T>

Source§

impl<T: ToCore> ToCore for Option<T>

Source§

impl<T: ToCore> ToCore for Box<T>

Source§

impl<T: ToCore> ToCore for Vec<T>

Source§

impl<T: ToCore, E: ToCore> ToCore for Result<T, E>

Implementors§