pub struct SchemaBuilder { /* private fields */ }
Implementations§
Source§impl SchemaBuilder
impl SchemaBuilder
Sourcepub fn new(schema_uri: Option<&str>) -> Self
pub fn new(schema_uri: Option<&str>) -> Self
Create a new SchemaBuilder object. The schema_uri parameter is optional, a value of “AUTO” will automatically detect the schema URI based on the input schema, if no schema URI was detected, a default URI of “http://json-schema.org/schema#” will be used. A value of None will leave out the “$schema” keyword in the output schema.
Sourcepub fn add_schema(&mut self, schema: Value)
pub fn add_schema(&mut self, schema: Value)
Merge in raw JSON schema object
Sourcepub fn add_schema_node(&mut self, node: SchemaNode)
pub fn add_schema_node(&mut self, node: SchemaNode)
Merge in another SchemaNode object
Sourcepub fn add_object(&mut self, object: &BorrowedValue<'_>)
pub fn add_object(&mut self, object: &BorrowedValue<'_>)
Modify the schema to accomodate the input object
Auto Trait Implementations§
impl Freeze for SchemaBuilder
impl RefUnwindSafe for SchemaBuilder
impl Send for SchemaBuilder
impl Sync for SchemaBuilder
impl Unpin for SchemaBuilder
impl UnwindSafe for SchemaBuilder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more