#[non_exhaustive]pub enum CodeGenError {
MissingField(&'static str),
InvalidTypePath(String),
InvalidSyntax(String),
FileNotFound(String),
Other(String),
ReservedFieldName {
message_name: String,
field_name: String,
},
ModuleNameConflict {
scope: String,
name_a: String,
name_b: String,
module_name: String,
},
ReservedModuleName {
name: String,
location: String,
},
MessageSetNotSupported {
message_name: String,
},
InvalidCustomAttribute {
path: String,
attribute: String,
detail: String,
},
}Expand description
Code generation error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingField(&'static str)
A required field was absent in a descriptor.
The &'static str names the missing field for diagnostics.
InvalidTypePath(String)
A resolved type path string could not be parsed as a Rust type.
InvalidSyntax(String)
The accumulated TokenStream failed to parse as valid Rust syntax.
FileNotFound(String)
A requested file was not present in the descriptor set.
Other(String)
Unexpected descriptor state (e.g. a map entry or oneof that cannot be resolved to a known descriptor field).
ReservedFieldName
A proto field name uses the __buffa_ reserved prefix, which would
conflict with buffa’s internal generated fields.
ModuleNameConflict
Two sibling messages produce the same Rust module name after
snake_case conversion (e.g., HTTPRequest and HttpRequest both
become pub mod http_request).
ReservedModuleName
A proto package segment, message name, or file-level enum name
would emit a Rust item matching the reserved sentinel __buffa.
This is the only name buffa reserves in user namespace. Resolve by renaming the proto element.
MessageSetNotSupported
The input contains a message with option message_set_wire_format = true
but CodeGenConfig::allow_message_set was not set.
InvalidCustomAttribute
A custom attribute string configured via CodeGenConfig::type_attributes,
CodeGenConfig::field_attributes, or CodeGenConfig::message_attributes
could not be parsed as a Rust attribute.
Trait Implementations§
Source§impl Clone for CodeGenError
impl Clone for CodeGenError
Source§fn clone(&self) -> CodeGenError
fn clone(&self) -> CodeGenError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CodeGenError
impl Debug for CodeGenError
Source§impl Display for CodeGenError
impl Display for CodeGenError
Source§impl Error for CodeGenError
impl Error for CodeGenError
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()