enum EncodeError
Why a value could not be encoded (std.ser re-exports it; §9, D-2115).
Example:
fn describe(e: EncodeError) -> str {
match e {
EncodeError.Secret _ => "a secret field cannot go to JSON"
EncodeError.Unsupported _ => "the format cannot represent the value"
EncodeError.Failed _ => "a codec failed"
}
}
fn main() io {
print(describe(EncodeError.Unsupported(msg: "cbor")))
}Output
the format cannot represent the value
@error pub(api) enum EncodeErrorSince. 1.0.0-beta
Variants
Secret(msg: str) | A |
Unsupported(msg: str) | The format cannot represent the value (ActorRef on a single node, MessagePack, CBOR). |
Failed(msg: str) | A user codec returned an error. |
Defined in: std/core/types.oxl:718