pub struct SchemaNodeSpec {
pub content: SchemaNodeContent,
pub metadata: SchemaMetadata,
pub ext_types: IndexMap<Identifier, ExtTypeSchema>,
pub type_codegen: TypeCodegen,
}Expand description
Trait for types that can build their schema representation.
This trait is typically derived using #[derive(BuildSchema)], but can also
be implemented manually for custom schema generation.
§Type Registration
Types can optionally provide a type_name() to register themselves in the
schema’s $types namespace. This is useful for:
- Creating reusable type definitions
- Enabling type references across the schema
- Providing meaningful names in generated schemas
Primitive types typically return None for type_name().
Full node specification returned by BuildSchema::build_schema_node.
Mirrors SchemaNode but is used during schema construction to allow
types to specify all node-level properties including ext_types and
type_codegen, which cannot be expressed through build_schema alone.
Fields§
§content: SchemaNodeContent§metadata: SchemaMetadata§ext_types: IndexMap<Identifier, ExtTypeSchema>§type_codegen: TypeCodegenAuto Trait Implementations§
impl Freeze for SchemaNodeSpec
impl RefUnwindSafe for SchemaNodeSpec
impl Send for SchemaNodeSpec
impl Sync for SchemaNodeSpec
impl Unpin for SchemaNodeSpec
impl UnsafeUnpin for SchemaNodeSpec
impl UnwindSafe for SchemaNodeSpec
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