pub struct TypeRefStatic {
pub kind: TypeKind,
pub name: Option<&'static str>,
pub inner: &'static [TypeRefStatic],
pub optional: bool,
pub nullable: bool,
pub value: Option<StaticValue>,
}Expand description
Static type metadata used by proc macros in link-time endpoint registration.
Fields§
§kind: TypeKindLanguage-neutral type category.
name: Option<&'static str>Primitive/model/enum name, when applicable.
inner: &'static [TypeRefStatic]Nested type references for arrays, records, tuples, and unions.
optional: boolWhether the value may be omitted.
nullable: boolWhether the value may be null.
value: Option<StaticValue>Literal value metadata, when applicable.
Implementations§
Source§impl TypeRefStatic
impl TypeRefStatic
Sourcepub fn to_schema_type_ref(&self) -> TypeRef
pub fn to_schema_type_ref(&self) -> TypeRef
Convert static metadata into the canonical schema type reference.
Sourcepub const fn primitive(name: &'static str) -> Self
pub const fn primitive(name: &'static str) -> Self
Construct static type metadata for a primitive type.
Sourcepub const fn model(name: &'static str) -> Self
pub const fn model(name: &'static str) -> Self
Construct static type metadata for a model reference.
Sourcepub const fn enum_ref(name: &'static str) -> Self
pub const fn enum_ref(name: &'static str) -> Self
Construct static type metadata for an enum reference.
Sourcepub const fn array(item: &'static [TypeRefStatic]) -> Self
pub const fn array(item: &'static [TypeRefStatic]) -> Self
Construct static type metadata for an array item type.
Pass a one-element slice containing the item type.
Sourcepub const fn union(members: &'static [TypeRefStatic]) -> Self
pub const fn union(members: &'static [TypeRefStatic]) -> Self
Construct static type metadata for a union of member types.
Sourcepub const fn literal(value: StaticValue) -> Self
pub const fn literal(value: StaticValue) -> Self
Construct static type metadata for a literal value.
Trait Implementations§
Source§impl Clone for TypeRefStatic
impl Clone for TypeRefStatic
Source§fn clone(&self) -> TypeRefStatic
fn clone(&self) -> TypeRefStatic
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more