pub struct Definitions { /* private fields */ }Expand description
The named shapes a document is described by, in the order they were first reached.
Implementations§
Source§impl Definitions
impl Definitions
Sourcepub fn of<T: Shape>() -> Self
pub fn of<T: Shape>() -> Self
The definition of T and of every named type it refers to.
§Panics
When two different types reachable from T have the same definition name, naming both types. A derived
type’s name is its identifier, or the one #[shape(name = "...")] gives.
pub fn get(&self, name: &str) -> Option<&ShapeDef>
pub fn iter(&self) -> impl Iterator<Item = (&str, &ShapeDef)>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn stripping(self, strip: impl Fn(&ObjectDef) -> bool) -> Self
pub fn stripping(self, strip: impl Fn(&ObjectDef) -> bool) -> Self
Marks every closed object, in every definition, for which strip holds as one whose validation lets an unknown
key pass (see ObjectDef::strips), and returns the definitions. The schema and the declarations still write
those objects as closed, so the document describes the objects a check accepts after the key is dropped.
Trait Implementations§
Source§impl Clone for Definitions
impl Clone for Definitions
Source§impl Debug for Definitions
impl Debug for Definitions
Source§impl Default for Definitions
impl Default for Definitions
Source§impl PartialEq for Definitions
impl PartialEq for Definitions
impl StructuralPartialEq for Definitions
Auto Trait Implementations§
impl Forget for Definitions
impl Freeze for Definitions
impl Move for Definitions
impl RefUnwindSafe for Definitions
impl Send for Definitions
impl Sync for Definitions
impl Unpin for Definitions
impl UnsafeUnpin for Definitions
impl UnwindSafe for Definitions
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