pub struct TypeInfo {
pub name: String,
pub kind: TypeKind,
pub fields: Option<Vec<FieldInfo>>,
pub generic_params: Option<Vec<TypeInfo>>,
pub variants: Option<Vec<String>>,
pub description: Option<String>,
pub metadata: Option<TypeMetadata>,
}Expand description
Type information for a value
Fields§
§name: StringType name (e.g., “Number”, “Candle”, “Array
kind: TypeKindKind of type
fields: Option<Vec<FieldInfo>>For object types: field definitions
generic_params: Option<Vec<TypeInfo>>For generic types: type parameters
variants: Option<Vec<String>>For enum types: variant names
description: Option<String>Human-readable description
metadata: Option<TypeMetadata>Metadata for the type (formatting, plotting, etc.)
Implementations§
Source§impl TypeInfo
impl TypeInfo
Sourcepub fn object(name: impl Into<String>, fields: Vec<FieldInfo>) -> Self
pub fn object(name: impl Into<String>, fields: Vec<FieldInfo>) -> Self
Create an object type info
Sourcepub fn table(element_type: TypeInfo) -> Self
pub fn table(element_type: TypeInfo) -> Self
Create a table type info (with default Timestamp index)
Sourcepub fn table_with_index(element_type: TypeInfo, index_type: TypeInfo) -> Self
pub fn table_with_index(element_type: TypeInfo, index_type: TypeInfo) -> Self
Create a table type info with explicit index type
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Add a description
Sourcepub fn with_metadata(self, metadata: TypeMetadata) -> Self
pub fn with_metadata(self, metadata: TypeMetadata) -> Self
Add metadata
pub fn number() -> Self
pub fn integer() -> Self
pub fn string() -> Self
pub fn bool() -> Self
pub fn timestamp() -> Self
pub fn null() -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TypeInfo
impl<'de> Deserialize<'de> for TypeInfo
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
impl StructuralPartialEq for TypeInfo
Auto Trait Implementations§
impl Freeze for TypeInfo
impl RefUnwindSafe for TypeInfo
impl Send for TypeInfo
impl Sync for TypeInfo
impl Unpin for TypeInfo
impl UnsafeUnpin for TypeInfo
impl UnwindSafe for TypeInfo
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