pub struct SchemaRegistry { /* private fields */ }Expand description
Registry for loading and storing schemas
Implementations§
Source§impl SchemaRegistry
impl SchemaRegistry
Sourcepub fn from_directory(schemas_dir: &Path) -> ValidationResult<Self>
pub fn from_directory(schemas_dir: &Path) -> ValidationResult<Self>
Sourcepub fn validate_values(
&self,
namespace: &str,
values: &Value,
) -> ValidationResult<()>
pub fn validate_values( &self, namespace: &str, values: &Value, ) -> ValidationResult<()>
Sourcepub fn get(&self, namespace: &str) -> Option<&Arc<NamespaceSchema>>
pub fn get(&self, namespace: &str) -> Option<&Arc<NamespaceSchema>>
Get a namespace schema by name
Sourcepub fn load_values_json(
&self,
values_dir: &Path,
) -> ValidationResult<ValuesByNamespace>
pub fn load_values_json( &self, values_dir: &Path, ) -> ValidationResult<ValuesByNamespace>
Load and validate JSON values from a directory.
Expects structure: {values_dir}/{namespace}/values.json
Skips namespaces without a values.json file.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SchemaRegistry
impl !RefUnwindSafe for SchemaRegistry
impl Send for SchemaRegistry
impl Sync for SchemaRegistry
impl Unpin for SchemaRegistry
impl !UnwindSafe for SchemaRegistry
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more