Struct fog_pack::schema::SchemaBuilder [−][src]
Builds schemas up from Validators.
A schema can be directly made from any document, but it’s generally much easier to construct
them from Validator structs and turn the result into a
Document.
Implementations
impl SchemaBuilder[src]
pub fn new(doc: Validator) -> Self[src]
Start building a new schema. Requires the validator to use for any documents adhering to this schema.
pub fn description(self, description: &str) -> Self[src]
Set the schema description. This is only used for documentation purposes.
pub fn doc_compress(self, doc_compress: Compress) -> Self[src]
Set the default compression to use for documents adhering to this schema.
pub fn entry_add(
self,
entry: &str,
validator: Validator,
compress: Option<Compress>
) -> Self[src]
self,
entry: &str,
validator: Validator,
compress: Option<Compress>
) -> Self
Add a new entry type to the schema, where entry is the key for the entry, validator
will be used to validate each entry, and compress optionally overrides the default
compression with a specific compression setting.
pub fn name(self, name: &str) -> Self[src]
Set the schema name. This is only used for documentation purposes.
pub fn type_add(self, type_ref: &str, validator: Validator) -> Self[src]
Add a new stored type to the schema.
pub fn version<T: Into<Integer>>(self, version: T) -> Self[src]
Set the schema version. This is only used for documentation purposes.
pub fn build(self) -> Result<Document>[src]
Build the Schema, compiling the result into a Document
Auto Trait Implementations
impl RefUnwindSafe for SchemaBuilder
impl Send for SchemaBuilder
impl Sync for SchemaBuilder
impl Unpin for SchemaBuilder
impl UnwindSafe for SchemaBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,