Trait apache_avro::validator::SchemaNameValidator

source ·
pub trait SchemaNameValidator: Send + Sync {
    // Required method
    fn validate(&self, schema_name: &str) -> AvroResult<(String, Namespace)>;

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

A trait that validates schema names. To register a custom one use set_schema_name_validator.

Required Methods§

source

fn validate(&self, schema_name: &str) -> AvroResult<(String, Namespace)>

Validates the schema name and returns the name and the optional namespace, or Error::InvalidSchemaName if it is invalid.

Provided Methods§

source

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

Returns the regex used to validate the schema name according to the Avro specification.

Implementors§