pub fn spool_command_of(
kind: ActionKind,
spool_id: Option<SpoolId>,
body: Value,
) -> Result<SpoolCommand, BodyRefusal>Expand description
The spool command one request asks for, assembled from its body.
The body is the command’s own fields, less the two a caller never supplies: the tag, which the operation it was sent to names, and — for a command about one spool — the spool, which its path names. Everything else is read by the contracts’ own type, so a field it refuses is refused in its own words and a field it gains is one this reads with nothing written here. The reason is ruled on first and travels trimmed, exactly as a print action’s does.
§Errors
Returns BodyRefusal when the body is not a document, carries no reason,
names the tag or the spool itself, or is not the command’s own fields.