Struct bonsaidb::core::schema::Schematic [−][src]
pub struct Schematic {
pub name: SchemaName,
// some fields omitted
}
Expand description
A collection of defined collections and views.
Fields
name: SchemaName
The name of the schema this was built from.
Implementations
Returns an initialized version from S
.
Adds the collection C
and its views.
pub fn define_view<V>(&mut self, view: V) -> Result<(), Error> where
V: 'static + ViewSchema<View = V> + SerializedView + Clone,
pub fn define_view<V>(&mut self, view: V) -> Result<(), Error> where
V: 'static + ViewSchema<View = V> + SerializedView + Clone,
Adds the view V
.
pub fn define_view_with_schema<V, S>(
&mut self,
view: V,
schema: S
) -> Result<(), Error> where
V: 'static + SerializedView,
S: 'static + ViewSchema<View = V>,
pub fn define_view_with_schema<V, S>(
&mut self,
view: V,
schema: S
) -> Result<(), Error> where
V: 'static + SerializedView,
S: 'static + ViewSchema<View = V>,
Adds the view V
.
Returns true
if this schema contains the collection C
.
Returns true
if this schema contains the collection C
.
pub fn next_id_for_collection(
&self,
collection: &CollectionName,
id: Option<DocumentId>
) -> Result<DocumentId, Error>
pub fn next_id_for_collection(
&self,
collection: &CollectionName,
id: Option<DocumentId>
) -> Result<DocumentId, Error>
Returns the next id in sequence for the collection, if the primary key type supports the operation and the next id would not overflow.
Looks up a view::Serialized
by name.
Looks up a view::Serialized
through the the type V
.
Iterates over all registered views.
pub fn views_in_collection(
&self,
collection: &CollectionName
) -> Option<Vec<&dyn Serialized, Global>>
pub fn views_in_collection(
&self,
collection: &CollectionName
) -> Option<Vec<&dyn Serialized, Global>>
Iterates over all views that belong to collection
.
pub fn unique_views_in_collection(
&self,
collection: &CollectionName
) -> Option<Vec<&dyn Serialized, Global>>
pub fn unique_views_in_collection(
&self,
collection: &CollectionName
) -> Option<Vec<&dyn Serialized, Global>>
Iterates over all views that are unique that belong to collection
.
Returns a collection’s default encryption key, if one was defined.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Schematic
impl !UnwindSafe for Schematic
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more