pub enum MultikeyError {
InvalidMultibase,
DecodedTooShort(usize),
UnknownCodecPrefix,
UnknownCodecName {
reason: CodecNameReason,
},
KeyLengthMismatch {
codec_name: &'static str,
expected: usize,
actual: usize,
},
BindingTypeCodecMismatch {
binding_type: BindingTypeKind,
codec_name: &'static str,
alg: &'static str,
},
BindingAlgorithmMismatch {
binding_alg: BindingAlgorithmKind,
codec_alg: &'static str,
},
BindingAlgorithmMissing {
binding_type: BindingTypeKind,
},
}Expand description
Error returned when parsing, encoding, or validating a multikey fails.
Parsing fails closed: malformed input yields one of these variants.
Variants§
InvalidMultibase
The input is not a valid multibase string.
DecodedTooShort(usize)
The decoded bytes are too short to hold a codec prefix and key.
UnknownCodecPrefix
The multicodec prefix is not a recognized key type.
UnknownCodecName
The given codec name is not one of the supported names.
Fields
reason: CodecNameReasonWhich class of unknown codec name was supplied.
KeyLengthMismatch
The key length does not match the length required by the codec.
Fields
BindingTypeCodecMismatch
The binding type is incompatible with the key’s multicodec.
Fields
binding_type: BindingTypeKindDeclared binding type.
BindingAlgorithmMismatch
The declared binding algorithm disagrees with the codec’s algorithm.
Fields
binding_alg: BindingAlgorithmKindAlgorithm declared in the binding.
BindingAlgorithmMissing
A required explicit algorithm was omitted for this binding type.
Fields
binding_type: BindingTypeKindBinding type that requires an explicit algorithm.
Trait Implementations§
Source§impl Debug for MultikeyError
impl Debug for MultikeyError
Source§impl Display for MultikeyError
impl Display for MultikeyError
Source§impl Error for MultikeyError
impl Error for MultikeyError
1.30.0 · 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()