Skip to main content

RecordFieldNameValidator

Trait RecordFieldNameValidator 

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

Source

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

The regex used to validate the record field names.

The default implementation uses the Avro specified regex.

Source

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

Validate the name of a record field.

Should return Details::FieldName if it is invalid.

Implementors§