Skip to main content

decode

Function decode 

Source
pub fn decode<E: Effect>(
    published: &[ResourceSpec],
    resource: &str,
    action: &str,
    arguments: &Map<String, Value>,
) -> Result<E, ApiError>
Expand description

The effect of E that invoking action of resource with arguments names, once the spec published offers for it checked the arguments and that it is available now. A spec offered bound to an item (a network, an accessory) adds the item’s arguments.

It sits beside offer for the same reason: whatever answers a vocabulary’s actions decodes them without the service host.

§Errors

ApiError::Unknown when nothing published names it, ApiError::Unavailable, or the arguments’ refusal.