Expand description
Lenient deserializers used by the generated response types.
Slack returns some fields as a string in one place and a number in another (ts, date_created,
post_at, …). These functions accept such variations so that one unexpected type does not fail
the whole response. They read values directly through a Visitor, without an intermediate tree.
Functions§
- opt_
bool - Reads a boolean;
0/1and"true"/"false"are accepted. - opt_f64
- Reads a float; numeric strings are accepted.
- opt_i64
- Reads an integer; numeric strings and floats (truncated) are accepted.
- opt_
object - Reads an object;
nulland non-object values ("",false, …) becomeNone. - opt_
string - Reads a string; numbers and booleans are converted to strings.
- vec
- Reads an array;
nulland non-array values become an emptyVec.