pub enum ProtocolError {
Identity(ContentError),
NonCanonicalId {
presented: String,
},
InvalidId {
kind: &'static str,
reason: String,
},
UnsupportedFeature {
feature: String,
known: bool,
},
NonCanonical {
schema: String,
input_len: usize,
},
Malformed {
reason: String,
},
UnknownSchema {
tag: String,
expected: &'static str,
},
}Expand description
What can go wrong constructing or reading a protocol record.
Variants§
Identity(ContentError)
A canonical encoding or content-id operation failed.
NonCanonicalId
An id was presented in a form that is not its canonical rendering. Accepting an alternate spelling would let two strings name one record.
InvalidId
An identifier’s shape is invalid (empty, or outside the charset).
UnsupportedFeature
A REQUIRED surface feature could not be met — either this build does not recognize it, or the surface lacks it. Both are the same fact to an operator: the document cannot be shown faithfully.
Fields
NonCanonical
The bytes decode, but they are not the canonical encoding of what they decode to — reordered map keys, a non-minimal integer, an indefinite-length string. Accepting them would mint an id different from the one their author published.
Malformed
The bytes are not a readable record. Corruption is a different fact from a version we do not know, and is reported differently.
UnknownSchema
A record declared a schema tag this build does not know. Unknown REQUIRED behavior fails closed (ADR law 5).
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()