pub trait EnumSymbolNameValidator: Send + Sync {
// Provided methods
fn regex(&self) -> &'static Regex { ... }
fn validate(&self, symbol: &str) -> AvroResult<()> { ... }
}Expand description
A trait that validates enum symbol names.
To register a custom one use set_enum_symbol_name_validator.
Provided Methods§
Sourcefn regex(&self) -> &'static Regex
fn regex(&self) -> &'static Regex
The regex used to validate the symbols of enums.
The default implementation uses the Avro specified regex.
Sourcefn validate(&self, symbol: &str) -> AvroResult<()>
fn validate(&self, symbol: &str) -> AvroResult<()>
Validate the symbol of an enum.
Should return Details::EnumSymbolName if it is invalid.