pub trait SchemaRegistry: Send + Sync {
// Required methods
fn get_by_fingerprint(&self, fp: &EventFingerprint) -> Option<Schema>;
fn get_by_name(&self, name: &str, version: Option<u32>) -> Option<Schema>;
fn list_for_chain(&self, chain_slug: &str) -> Vec<Schema>;
fn history(&self, name: &str) -> Vec<Schema>;
}Expand description
A thread-safe, read-only view of a schema registry.
Concrete implementations live in chaincodec-registry.
Required Methods§
Sourcefn get_by_fingerprint(&self, fp: &EventFingerprint) -> Option<Schema>
fn get_by_fingerprint(&self, fp: &EventFingerprint) -> Option<Schema>
Look up a schema by its fingerprint.
Sourcefn get_by_name(&self, name: &str, version: Option<u32>) -> Option<Schema>
fn get_by_name(&self, name: &str, version: Option<u32>) -> Option<Schema>
Look up a schema by name and optional version.
If version is None, returns the latest non-deprecated version.
Sourcefn list_for_chain(&self, chain_slug: &str) -> Vec<Schema>
fn list_for_chain(&self, chain_slug: &str) -> Vec<Schema>
Returns all schemas applicable to the given chain slug.