EnumSymbolNameValidator

Trait EnumSymbolNameValidator 

Source
pub trait EnumSymbolNameValidator: Send + Sync {
    // Required method
    fn validate(&self, name: &str) -> AvroResult<()>;

    // Provided method
    fn regex(&self) -> &'static Regex { ... }
}
Expand description

A trait that validates enum symbol names.

To register a custom one use set_enum_symbol_name_validator.

Required Methods§

Source

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

Validate the symbol of an enum.

Should return Details::EnumSymbolName if it is invalid.

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.

Implementors§