Struct fog_pack::schema::SchemaBuilder[][src]

pub struct SchemaBuilder { /* fields omitted */ }

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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,