pub struct Shape {
pub root: ShapeRef,
pub definitions: Vec<DefinitionShape>,
}Expand description
A complete shape graph rooted at one type.
Fields§
§root: ShapeRefThe root shape reference.
definitions: Vec<DefinitionShape>Named type definitions reachable from the root.
Implementations§
Source§impl Shape
impl Shape
Sourcepub fn for_type<T>() -> Selfwhere
T: SerdeShape + ?Sized,
pub fn for_type<T>() -> Selfwhere
T: SerdeShape + ?Sized,
Build a complete shape graph rooted at T.
Sourcepub fn definition(&self, id: ShapeId) -> Option<&DefinitionShape>
pub fn definition(&self, id: ShapeId) -> Option<&DefinitionShape>
Return a definition by id.
Trait Implementations§
impl Eq for Shape
impl StructuralPartialEq for Shape
Auto Trait Implementations§
impl Freeze for Shape
impl RefUnwindSafe for Shape
impl Send for Shape
impl Sync for Shape
impl Unpin for Shape
impl UnsafeUnpin for Shape
impl UnwindSafe for Shape
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