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> RefUnwindSafe for TypeData<C, L>where
C: RefUnwindSafe,
L: 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§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§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<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.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more