pub enum TypeKind {
Primitive {
primitive: Primitive,
},
Pointer {
pointee: TypeId,
is_const: bool,
},
Array {
element: TypeId,
count: u64,
},
Struct {
size: u64,
align: u64,
fields: Vec<Field>,
},
Union {
size: u64,
align: u64,
fields: Vec<Field>,
},
Enum {
underlying: TypeId,
variants: Vec<EnumVariant>,
},
Function {
calling_convention: CallingConvention,
parameters: Vec<TypeId>,
return_type: TypeId,
variadic: bool,
},
Typedef {
target: TypeId,
},
Opaque {
size: Option<u64>,
},
}Expand description
A type’s kind and the data specific to it.
Serialized flat into the enclosing TypeDef, with a "kind"
discriminator.
Variants§
Primitive
A built-in primitive type.
Pointer
A pointer to another type.
Array
A fixed-length array.
Struct
A C struct.
Fields
Union
A C union.
Fields
Enum
A C enumeration: a set of named integer constants over an underlying integer type.
Fields
§
variants: Vec<EnumVariant>The named constants.
Function
A function (pointer) type.
Fields
§
calling_convention: CallingConventionThe calling convention.
Typedef
An alias for another type (a typedef).
Opaque
A type whose layout is unknown, with an optional known size.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TypeKind
impl<'de> Deserialize<'de> for TypeKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for TypeKind
impl JsonSchema for TypeKind
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for TypeKind
Auto Trait Implementations§
impl Freeze for TypeKind
impl RefUnwindSafe for TypeKind
impl Send for TypeKind
impl Sync for TypeKind
impl Unpin for TypeKind
impl UnsafeUnpin for TypeKind
impl UnwindSafe for TypeKind
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