pub struct SerializeShapeContext { /* private fields */ }Expand description
A context that accumulates named serialization definitions while a graph is built.
Implementations§
Source§impl SerializeShapeContext
impl SerializeShapeContext
Sourcepub fn define_named_type<F>(
&mut self,
type_name: TypeName,
build: F,
) -> ShapeRefwhere
F: FnOnce(&mut Self) -> SerializeDefinitionKind + 'static,
pub fn define_named_type<F>(
&mut self,
type_name: TypeName,
build: F,
) -> ShapeRefwhere
F: FnOnce(&mut Self) -> SerializeDefinitionKind + 'static,
Defines a named type once and returns a reference to its definition.
The concrete builder type and diagnostic Rust name form the graph-local identity. Call this method from one stable closure expression for every occurrence of the same named type.
Sourcepub fn define_named_type_with_description<F>(
&mut self,
type_name: TypeName,
description: Option<&'static str>,
build: F,
) -> ShapeRefwhere
F: FnOnce(&mut Self) -> SerializeDefinitionKind + 'static,
pub fn define_named_type_with_description<F>(
&mut self,
type_name: TypeName,
description: Option<&'static str>,
build: F,
) -> ShapeRefwhere
F: FnOnce(&mut Self) -> SerializeDefinitionKind + 'static,
Defines a named type with user-facing documentation.
This behaves like Self::define_named_type and stores description on the resulting
definition.
Trait Implementations§
Source§impl Debug for SerializeShapeContext
impl Debug for SerializeShapeContext
Source§impl Default for SerializeShapeContext
impl Default for SerializeShapeContext
Source§fn default() -> SerializeShapeContext
fn default() -> SerializeShapeContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SerializeShapeContext
impl RefUnwindSafe for SerializeShapeContext
impl Send for SerializeShapeContext
impl Sync for SerializeShapeContext
impl Unpin for SerializeShapeContext
impl UnsafeUnpin for SerializeShapeContext
impl UnwindSafe for SerializeShapeContext
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