Skip to main content

encode

Function encode 

Source
pub fn encode(
    crosswalk: &Crosswalk,
    document: &Value,
) -> Result<Value, CrossmapError>
Expand description

Encodes a native document into the shared shape. A rule’s when is evaluated against document.

§Errors

CrossmapError::Structure when the crosswalk fails structural validation; CrossmapError::RuleApplication when a read path is absent, a value does not fit an operation, two rules claim one output location, or an output array is left with an element no rule wrote; CrossmapError::WhenEvaluation when a gate cannot be evaluated.