Struct pliantdb_core::schema::Schema [−][src]
A collection of defined collections and views.
Implementations
impl Schema[src]
pub fn define_collection<C: Collection + 'static>(&mut self)[src]
Adds the collection C and its views.
pub fn define_view<V: View + 'static>(&mut self, view: V)[src]
Adds the view V.
#[must_use]pub fn contains<C: Collection + 'static>(&self) -> bool[src]
Returns true if this schema contains the collection C.
#[must_use]pub fn view_by_name(&self, name: &str) -> Option<&dyn Serialized>[src]
Looks up a view::Serialized by name.
#[must_use]pub fn view<V: View + 'static>(&self) -> Option<&dyn Serialized>[src]
Looks up a view::Serialized through the the type V.
pub fn views(&self) -> impl Iterator<Item = &dyn Serialized>[src]
Iterates over all registered views.
#[must_use]pub fn views_in_collection(
&self,
collection: &Id
) -> Option<Vec<&dyn Serialized>>[src]
&self,
collection: &Id
) -> Option<Vec<&dyn Serialized>>
Iterates over all views that belong to collection.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl !UnwindSafe for Schema
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>,