pub struct Schema {
pub components: Vec<ComponentDef>,
}Expand description
A schema consisting of ordered components.
Fields§
§components: Vec<ComponentDef>Implementations§
Source§impl Schema
impl Schema
Sourcepub fn new(components: Vec<ComponentDef>) -> SchemaResult<Self>
pub fn new(components: Vec<ComponentDef>) -> SchemaResult<Self>
Creates a schema from components after validation.
Sourcepub fn builder() -> SchemaBuilder
pub fn builder() -> SchemaBuilder
Creates a schema builder.
Sourcepub fn validate(&self) -> SchemaResult<()>
pub fn validate(&self) -> SchemaResult<()>
Validates schema invariants.
Trait Implementations§
impl Eq for Schema
impl StructuralPartialEq for Schema
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnwindSafe for Schema
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