Struct pliantdb_core::schema::Schema[][src]

pub struct Schema { /* fields omitted */ }

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]

Iterates over all views that belong to collection.

Trait Implementations

impl Debug for Schema[src]

impl Default for Schema[src]

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]

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.