pub enum TypeDesc {
Show 18 variants
Any,
None,
Bool,
Int,
Float,
Str,
Datetime,
Date,
Timedelta,
List {
item: Box<TypeDesc>,
},
Tuple {
items: Vec<TypeDesc>,
},
Dict {
value: Box<TypeDesc>,
},
Literal {
values: Vec<Value>,
},
Union {
variants: Vec<TypeDesc>,
},
TypedDict {
name: String,
fields: Vec<Field>,
},
Dataclass {
name: String,
fields: Vec<Field>,
},
Model {
name: String,
schema: Value,
},
ProcessResult,
}Expand description
The type of a value that can be stored as a task output.
Variants§
Any
Anything (an explicit Any): only the run-time check applies.
None
None.
Bool
bool.
Int
int.
Float
float.
Str
str.
Datetime
datetime (stored tagged).
Date
date (stored tagged).
Timedelta
timedelta (stored tagged).
List
list[T].
Tuple
tuple[A, B, ...] (stored tagged).
Dict
dict[str, T] (keys are always strings).
Literal
Literal[...].
Union
A union, including Optional[T] (T | None).
TypedDict
A TypedDict.
Dataclass
A dataclass.
Fields
Model
A Pydantic model (decision 59), described by Pydantic’s JSON Schema of it: what
model_dump(mode="json") writes. Only the Python layer compares it; here its parts
are Any.
Fields
ProcessResult
The output of a command or script task.
Implementations§
Source§impl TypeDesc
impl TypeDesc
Sourcepub fn field(&self, name: &str) -> Option<&TypeDesc>
pub fn field(&self, name: &str) -> Option<&TypeDesc>
The type of the named field or key, for checking an output path such as out.rows.
Returns None if this type has no such field: TypedDicts, dataclasses and
ProcessResult have named fields, dict[str, T] has any key (giving T), and Any
and a model give Any.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TypeDesc
impl<'de> Deserialize<'de> for TypeDesc
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>,
impl Eq for TypeDesc
Source§impl JsonSchema for TypeDesc
impl JsonSchema for TypeDesc
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more