pub struct SchemaRegistry { /* private fields */ }Implementations§
Source§impl SchemaRegistry
impl SchemaRegistry
pub fn new() -> Self
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Resets the schema registry to a blank slate without releasing the allocations
Sourcepub fn register(
&mut self,
type_id: WireTypeId,
entry: SchemaEntry,
) -> Result<(), String>
pub fn register( &mut self, type_id: WireTypeId, entry: SchemaEntry, ) -> Result<(), String>
Register a schema under the given wire type ID.
pub fn get(&self, type_id: WireTypeId) -> Option<&SchemaEntry>
pub fn entries(&self) -> impl Iterator<Item = (WireTypeId, &SchemaEntry)>
Sourcepub fn next_type_id(&mut self) -> WireTypeId
pub fn next_type_id(&mut self) -> WireTypeId
Allocate the next wire type ID.
Sourcepub fn sync_next_id(&mut self)
pub fn sync_next_id(&mut self)
Advance next_id past all registered type IDs.
Call this after bulk-inserting schemas (e.g. from a decoded trace) so
that next_type_id won’t collide.
Trait Implementations§
Source§impl Clone for SchemaRegistry
impl Clone for SchemaRegistry
Source§fn clone(&self) -> SchemaRegistry
fn clone(&self) -> SchemaRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SchemaRegistry
impl Debug for SchemaRegistry
Source§impl Default for SchemaRegistry
impl Default for SchemaRegistry
Source§fn default() -> SchemaRegistry
fn default() -> SchemaRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SchemaRegistry
impl RefUnwindSafe for SchemaRegistry
impl Send for SchemaRegistry
impl Sync for SchemaRegistry
impl Unpin for SchemaRegistry
impl UnsafeUnpin for SchemaRegistry
impl UnwindSafe for SchemaRegistry
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