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§
Sourcefn to_value(&self, table: &DataConTable) -> Result<Value, BridgeError>
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.
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.