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