Skip to main content

SchemaNameValidator

Trait 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 Details::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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§