Enum doku::TypeKind[][src]

pub enum TypeKind {
    Array {
        ty: Box<Type>,
        size: Option<usize>,
    },
    Bool,
    Enum {
        tag: Tag,
        variants: Vec<Variant>,
    },
    Float,
    Integer,
    Map {
        key: Box<Type>,
        value: Box<Type>,
    },
    Optional {
        ty: Box<Type>,
    },
    String,
    Struct {
        fields: Fields,
        transparent: bool,
    },
    Tuple {
        fields: Vec<Type>,
    },
}

Variants

Array

A homogeneous array of a possibly known size

Fields of Array

ty: Box<Type>

Type of items this array accepts

size: Option<usize>

An optional hint about the array’s expected size

Bool

true / false

Enum

An algebraic data type

Fields of Enum

tag: Tag

The way enum should be serialized

variants: Vec<Variant>

All enum’s variants

Float

A floating-point number

Integer

An integer number

Map

A homogeneous map

Fields of Map

key: Box<Type>value: Box<Type>
Optional

Option<Ty>

Fields of Optional

ty: Box<Type>
String

A UTF-8 string

Struct

A structure

Fields of Struct

fields: Fieldstransparent: bool

Whether this type should behave as a passthrough-wrapper. Corresponds to #[serde(transparent)].

Tuple

A heterogeneous list of an up-front known size

Fields of Tuple

fields: Vec<Type>

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.