pub trait SchemaRegistryAware: Send + Sync {
// Required methods
fn fetch_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
subject: &'life1 str,
) -> Pin<Box<dyn Future<Output = SchemaResult<RegisteredSchema>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn fetch_schema_by_id<'life0, 'async_trait>(
&'life0 self,
schema_id: i32,
) -> Pin<Box<dyn Future<Output = SchemaResult<RegisteredSchema>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn check_compatibility<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject: &'life1 str,
proposed: &'life2 SchemaRef,
) -> Pin<Box<dyn Future<Output = SchemaResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn register_schema<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject: &'life1 str,
schema: &'life2 SchemaRef,
) -> Pin<Box<dyn Future<Output = SchemaResult<RegisteredSchema>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn build_registry_decoder(
&self,
schema: &RegisteredSchema,
) -> SchemaResult<Box<dyn FormatDecoder>>;
}Expand description
A connector that integrates with a schema registry.
Supports fetching, registering, and checking compatibility of schemas against an external registry (e.g., Confluent Schema Registry).
Required Methods§
Sourcefn fetch_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
subject: &'life1 str,
) -> Pin<Box<dyn Future<Output = SchemaResult<RegisteredSchema>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
subject: &'life1 str,
) -> Pin<Box<dyn Future<Output = SchemaResult<RegisteredSchema>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetches the latest schema for a subject.
§Errors
Returns SchemaError::RegistryError
if the registry is unreachable or the subject is not found.
Sourcefn fetch_schema_by_id<'life0, 'async_trait>(
&'life0 self,
schema_id: i32,
) -> Pin<Box<dyn Future<Output = SchemaResult<RegisteredSchema>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_schema_by_id<'life0, 'async_trait>(
&'life0 self,
schema_id: i32,
) -> Pin<Box<dyn Future<Output = SchemaResult<RegisteredSchema>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn check_compatibility<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject: &'life1 str,
proposed: &'life2 SchemaRef,
) -> Pin<Box<dyn Future<Output = SchemaResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn check_compatibility<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject: &'life1 str,
proposed: &'life2 SchemaRef,
) -> Pin<Box<dyn Future<Output = SchemaResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Checks whether proposed is compatible with the existing schema
for subject under the configured compatibility mode.
§Errors
Returns a schema error if the compatibility check itself fails.
Sourcefn register_schema<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject: &'life1 str,
schema: &'life2 SchemaRef,
) -> Pin<Box<dyn Future<Output = SchemaResult<RegisteredSchema>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn register_schema<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject: &'life1 str,
schema: &'life2 SchemaRef,
) -> Pin<Box<dyn Future<Output = SchemaResult<RegisteredSchema>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn build_registry_decoder(
&self,
schema: &RegisteredSchema,
) -> SchemaResult<Box<dyn FormatDecoder>>
fn build_registry_decoder( &self, schema: &RegisteredSchema, ) -> SchemaResult<Box<dyn FormatDecoder>>
Builds a FormatDecoder configured for the registry schema.
This is a sync method because the decoder construction itself is not async — the registry lookup should happen beforehand.
§Errors
Returns a schema error if the decoder cannot be constructed (e.g., unsupported schema type).