pub struct Shapes {
base: Validator,
described: BTreeMap<String, Described>,
}Expand description
The collections this engine knows the shape of, each with the schema that shape produces, plus the base schema for everything else.
Fields§
§base: Validator§described: BTreeMap<String, Described>Implementations§
Source§impl Shapes
impl Shapes
Sourcepub fn describe(
&mut self,
collection: &str,
shape: Shape,
) -> Result<(), ShapeError>
pub fn describe( &mut self, collection: &str, shape: Shape, ) -> Result<(), ShapeError>
Describe collection’s records, replacing any earlier shape.
Sourcepub fn shape_of(&self, collection: &str) -> Option<&Shape>
pub fn shape_of(&self, collection: &str) -> Option<&Shape>
The shape of collection’s records, if described.
Sourcepub fn collections(&self) -> impl Iterator<Item = &str>
pub fn collections(&self) -> impl Iterator<Item = &str>
Every described collection, in order.
pub(crate) fn base(&self) -> &Validator
pub(crate) fn validator_for(&self, collection: &str) -> Option<&Validator>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Shapes
impl RefUnwindSafe for Shapes
impl Send for Shapes
impl Sync for Shapes
impl Unpin for Shapes
impl UnsafeUnpin for Shapes
impl UnwindSafe for Shapes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more