pub struct TypeData<C, L>where
C: CustomTypeKind<L>,
L: SchemaTypeLink,{
pub kind: TypeKind<C, L>,
pub metadata: TypeMetadata,
pub validation: TypeValidation<<C as CustomTypeKind<L>>::CustomTypeValidation>,
}
Expand description
Combines all data about a Type:
kind
- The type’sTypeKind
- this is essentially the definition of the structure of the type, and includes the type’sValueKind
as well as theTypeKind
of any child types.metadata
- The type’sTypeMetadata
which includes the name of the type and any of its fields or variants.validation
- The type’sTypeValidation
which includes extra validation instructions for the type.
Fields§
§kind: TypeKind<C, L>
§metadata: TypeMetadata
§validation: TypeValidation<<C as CustomTypeKind<L>>::CustomTypeValidation>
Implementations§
Source§impl<C, L> TypeData<C, L>where
C: CustomTypeKind<L>,
L: SchemaTypeLink,
impl<C, L> TypeData<C, L>where
C: CustomTypeKind<L>,
L: SchemaTypeLink,
pub fn new(kind: TypeKind<C, L>, metadata: TypeMetadata) -> TypeData<C, L>
pub fn unnamed(kind: TypeKind<C, L>) -> TypeData<C, L>
pub fn no_child_names( kind: TypeKind<C, L>, name: &'static str, ) -> TypeData<C, L>
pub fn struct_with_unit_fields(name: &'static str) -> TypeData<C, L>
pub fn struct_with_unnamed_fields( name: &'static str, field_types: Vec<L>, ) -> TypeData<C, L>
pub fn struct_with_named_fields( name: &'static str, fields: Vec<(&'static str, L)>, ) -> TypeData<C, L>
pub fn enum_variants( name: &'static str, variants: IndexMap<u8, TypeData<C, L>>, ) -> TypeData<C, L>
pub fn with_validation( self, type_validation: TypeValidation<<C as CustomTypeKind<L>>::CustomTypeValidation>, ) -> TypeData<C, L>
pub fn with_name(self, name: Option<Cow<'static, str>>) -> TypeData<C, L>
Trait Implementations§
Source§impl<C, L> Clone for TypeData<C, L>where
C: Clone + CustomTypeKind<L>,
L: Clone + SchemaTypeLink,
<C as CustomTypeKind<L>>::CustomTypeValidation: Clone,
impl<C, L> Clone for TypeData<C, L>where
C: Clone + CustomTypeKind<L>,
L: Clone + SchemaTypeLink,
<C as CustomTypeKind<L>>::CustomTypeValidation: Clone,
Source§impl<C, L> Debug for TypeData<C, L>where
C: Debug + CustomTypeKind<L>,
L: Debug + SchemaTypeLink,
<C as CustomTypeKind<L>>::CustomTypeValidation: Debug,
impl<C, L> Debug for TypeData<C, L>where
C: Debug + CustomTypeKind<L>,
L: Debug + SchemaTypeLink,
<C as CustomTypeKind<L>>::CustomTypeValidation: Debug,
Source§impl<C, L> PartialEq for TypeData<C, L>where
C: PartialEq + CustomTypeKind<L>,
L: PartialEq + SchemaTypeLink,
<C as CustomTypeKind<L>>::CustomTypeValidation: PartialEq,
impl<C, L> PartialEq for TypeData<C, L>where
C: PartialEq + CustomTypeKind<L>,
L: PartialEq + SchemaTypeLink,
<C as CustomTypeKind<L>>::CustomTypeValidation: PartialEq,
impl<C, L> Eq for TypeData<C, L>where
C: Eq + CustomTypeKind<L>,
L: Eq + SchemaTypeLink,
<C as CustomTypeKind<L>>::CustomTypeValidation: Eq,
impl<C, L> StructuralPartialEq for TypeData<C, L>where
C: CustomTypeKind<L>,
L: SchemaTypeLink,
Auto Trait Implementations§
impl<C, L> Freeze for TypeData<C, L>
impl<C, L> RefUnwindSafe for TypeData<C, L>where
L: RefUnwindSafe,
C: RefUnwindSafe,
<C as CustomTypeKind<L>>::CustomTypeValidation: RefUnwindSafe,
impl<C, L> Send for TypeData<C, L>
impl<C, L> Sync for TypeData<C, L>
impl<C, L> Unpin for TypeData<C, L>
impl<C, L> UnwindSafe for TypeData<C, L>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
type Error = <U as ContextualTryFrom<T>>::Error
type Context = <U as ContextualTryFrom<T>>::Context
fn contextual_try_into( self, context: &<U as ContextualTryFrom<T>>::Context, ) -> Result<U, <U as ContextualTryFrom<T>>::Error>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.