pub trait SchemaNameValidator: Send + Sync {
// Provided methods
fn regex(&self) -> &'static Regex { ... }
fn validate(&self, schema_name: &str) -> AvroResult<usize> { ... }
}Expand description
A trait that validates schema names.
To register a custom one use set_schema_name_validator.
Provided Methods§
Sourcefn regex(&self) -> &'static Regex
fn regex(&self) -> &'static Regex
The regex used to validate the schema name.
When the name part of the full name is provided as a capture group named name, the
default implementation of Self::validate can be used.
The default implementation uses the Avro specified regex.
Sourcefn validate(&self, schema_name: &str) -> AvroResult<usize>
fn validate(&self, schema_name: &str) -> AvroResult<usize>
Validates the schema name and returns the start byte of the name.
Requires that the implementation of Self::regex provides a capture group named name
that captures the name part of the full name.
Should return Details::InvalidSchemaName if it is invalid.