Skip to main content

SchemaNodeSpec

Struct SchemaNodeSpec 

Source
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: TypeCodegen

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.