#[non_exhaustive]pub enum DescriptorError {
Show 14 variants
Decode(DecodeError),
MissingFileName,
MissingName {
location: String,
},
UnresolvedType {
field: String,
type_name: String,
},
DuplicateType(String),
DuplicateFile(String),
Proto3RequiredField {
field: String,
},
InvalidFieldNumber {
message: String,
number: i32,
max: u32,
},
MissingFieldType {
field: String,
},
MissingTypeName {
field: String,
kind: &'static str,
},
InvalidOneofIndex {
field: String,
index: i32,
count: usize,
},
Proto3EnumMissingZero(String),
InvalidDefaultValue {
field: String,
value: String,
message: String,
},
Validation(String),
}Expand description
All ways descriptor pool construction or lookup can fail.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Decode(DecodeError)
The serialized FileDescriptorSet bytes could not be parsed.
MissingFileName
A FileDescriptorProto.name field was missing.
MissingName
A nested type (message / enum / field / oneof) had no name set.
Fields
UnresolvedType
A field referenced a type_name that no descriptor in the pool
defines.
Fields
DuplicateType(String)
Two descriptors share the same fully-qualified name within a single pool.
DuplicateFile(String)
Two FileDescriptorProtos carry the same name.
Proto3RequiredField
proto3 forbids LABEL_REQUIRED. The descriptor declared one anyway.
InvalidFieldNumber
A field declared a number outside the protobuf-permitted range or inside the reserved internal range.
Fields
MissingFieldType
FieldDescriptorProto.type was unset and no type_name was supplied
— we cannot resolve the field’s crate::Kind.
MissingTypeName
FieldDescriptorProto.type was
MESSAGE
or GROUP/ENUM but type_name was empty.
Fields
InvalidOneofIndex
A oneof_index referenced a slot that does not exist in the
containing message’s oneof_decl list.
Fields
Proto3EnumMissingZero(String)
A proto3 enum is missing a variant with value 0 (required for
proto3 default semantics).
InvalidDefaultValue
FieldDescriptorProto.default_value could not be parsed against
the field’s resolved kind.
Fields
Validation(String)
Generic descriptor-validation failure.
Trait Implementations§
Source§impl Debug for DescriptorError
impl Debug for DescriptorError
Source§impl Display for DescriptorError
impl Display for DescriptorError
Source§impl Error for DescriptorError
impl Error for DescriptorError
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()