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")))
}Вывод
the format cannot represent the value
@error pub(api) enum EncodeErrorС версии. 1.0.0-beta
Варианты
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. |
Определено в: std/core/types.oxl:718