pub struct MemorySchemaRegistry { /* private fields */ }Expand description
In-memory schema registry for development and testing
Stores schemas in a HashMap protected by RwLock.
Schemas are lost on process restart.
Implementations§
Trait Implementations§
Source§impl Default for MemorySchemaRegistry
impl Default for MemorySchemaRegistry
Source§impl SchemaRegistry for MemorySchemaRegistry
impl SchemaRegistry for MemorySchemaRegistry
Source§fn register(&self, schema: EventSchema) -> Result<()>
fn register(&self, schema: EventSchema) -> Result<()>
Register a schema for an event type at a specific version
Source§fn get(&self, event_type: &str, version: u32) -> Result<Option<EventSchema>>
fn get(&self, event_type: &str, version: u32) -> Result<Option<EventSchema>>
Get the schema for an event type at a specific version
Source§fn latest_version(&self, event_type: &str) -> Result<Option<u32>>
fn latest_version(&self, event_type: &str) -> Result<Option<u32>>
Get the latest schema version for an event type
Source§fn validate(&self, event: &Event) -> Result<()>
fn validate(&self, event: &Event) -> Result<()>
Validate an event’s payload against its registered schema Read more
Source§fn check_compatibility(
&self,
event_type: &str,
new_version: u32,
mode: Compatibility,
) -> Result<()>
fn check_compatibility( &self, event_type: &str, new_version: u32, mode: Compatibility, ) -> Result<()>
Check if a new schema version is compatible with the previous version
Auto Trait Implementations§
impl !Freeze for MemorySchemaRegistry
impl RefUnwindSafe for MemorySchemaRegistry
impl Send for MemorySchemaRegistry
impl Sync for MemorySchemaRegistry
impl Unpin for MemorySchemaRegistry
impl UnsafeUnpin for MemorySchemaRegistry
impl UnwindSafe for MemorySchemaRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more