Struct bonsaidb_core::schema::Schematic
source · [−]pub struct Schematic {
pub name: SchemaName,
/* private fields */
}Expand description
A collection of defined collections and views.
Fields
name: SchemaNameThe 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: ViewSchema<View = V> + SerializedView + Clone + 'static>(
&mut self,
view: V
) -> Result<(), Error>
pub fn define_view<V: ViewSchema<View = V> + SerializedView + Clone + 'static>(
&mut self,
view: V
) -> Result<(), Error>
Adds the view V.
pub fn define_view_with_schema<V: SerializedView + 'static, S: ViewSchema<View = V> + 'static>(
&mut self,
view: V,
schema: S
) -> Result<(), Error>
pub fn define_view_with_schema<V: SerializedView + 'static, S: ViewSchema<View = V> + 'static>(
&mut self,
view: V,
schema: S
) -> Result<(), Error>
Adds the view V.
Returns true if this schema contains the collection C.
Returns true if this schema contains the collection C.
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>>
pub fn views_in_collection(
&self,
collection: &CollectionName
) -> Option<Vec<&dyn Serialized>>
Iterates over all views that belong to collection.
pub fn unique_views_in_collection(
&self,
collection: &CollectionName
) -> Option<Vec<&dyn Serialized>>
pub fn unique_views_in_collection(
&self,
collection: &CollectionName
) -> Option<Vec<&dyn Serialized>>
Iterates over all views that are unique that belong to collection.
Returns a collection’s default encryption key, if one was defined.
pub fn collections(&self) -> Vec<CollectionName>ⓘ
pub fn collections(&self) -> Vec<CollectionName>ⓘ
Returns a list of all collections contained in this schematic.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Schematic
impl !UnwindSafe for Schematic
Blanket Implementations
Mutably borrows from an owned value. Read more
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