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’sValueKindas well as theTypeKindof any child types.metadata- The type’sTypeMetadatawhich includes the name of the type and any of its fields or variants.validation- The type’sTypeValidationwhich 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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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.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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more