EnumSymbolNameValidator

Trait EnumSymbolNameValidator 

Source
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§

Source

fn regex(&self) -> &'static Regex

The regex used to validate the symbols of enums.

The default implementation uses the Avro specified regex.

Source

fn validate(&self, symbol: &str) -> AvroResult<()>

Validate the symbol of an enum.

Should return Details::EnumSymbolName if it is invalid.

Implementors§