pub struct SchemaRegistry { /* private fields */ }Implementations§
Source§impl SchemaRegistry
impl SchemaRegistry
Sourcepub fn register(
&mut self,
schema: TypeSchema,
) -> Result<(), SchemaRegistryError>
pub fn register( &mut self, schema: TypeSchema, ) -> Result<(), SchemaRegistryError>
Registers a schema without replacing a different existing definition.
Re-registering an identical definition is accepted for idempotent plugin registration.
§Errors
Returns SchemaRegistryError::DuplicateType when the type name is
already registered with a different definition.
pub fn get(&self, type_name: &str) -> Option<&TypeSchema>
pub fn iter(&self) -> impl Iterator<Item = &TypeSchema>
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
Source§impl<'de> Deserialize<'de> for SchemaRegistry
impl<'de> Deserialize<'de> for SchemaRegistry
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SchemaRegistry, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SchemaRegistry, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SchemaRegistry
Source§impl PartialEq for SchemaRegistry
impl PartialEq for SchemaRegistry
Source§impl Serialize for SchemaRegistry
impl Serialize for SchemaRegistry
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for SchemaRegistry
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