pub struct SchemaRegistry { /* private fields */ }Expand description
Owned registry resolving (op_type, domain, opset) to an operator schema.
Implementations§
Source§impl SchemaRegistry
impl SchemaRegistry
Sourcepub fn load_yaml(&mut self, yaml: &str) -> Result<(), SchemaError>
pub fn load_yaml(&mut self, yaml: &str) -> Result<(), SchemaError>
Load one schema from YAML and register it.
Sourcepub fn register(&mut self, schema: OpSchema) -> Result<(), SchemaError>
pub fn register(&mut self, schema: OpSchema) -> Result<(), SchemaError>
Register a schema. A later since_version supersedes earlier versions.
Sourcepub fn lookup(
&self,
op_type: &str,
domain: &str,
opset: u64,
) -> Option<&OpSchema>
pub fn lookup( &self, op_type: &str, domain: &str, opset: u64, ) -> Option<&OpSchema>
Resolve the schema whose interval contains opset.
Sourcepub fn contains_operator(&self, op_type: &str, domain: &str) -> bool
pub fn contains_operator(&self, op_type: &str, domain: &str) -> bool
Whether any version of this operator is registered.
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