Skip to main content

opt_bool

Function opt_bool 

Source
pub fn opt_bool(args: &Value, name: &str) -> ArgResult<bool>
Expand description

Extract a boolean argument ("type": "boolean").

Accepts a JSON boolean or the strings "true" / "false" in any case. Rejects 0 / 1 and every other spelling.

§Errors

Returns the client-facing message when the value is present but not a boolean.