pub enum TypeExpr {
Scalar(ValueType),
Opaque(String),
Optional(Box<TypeExpr>),
List(Box<TypeExpr>),
Map(Box<TypeExpr>, Box<TypeExpr>),
Tuple(Vec<TypeExpr>),
Struct(Vec<StructField>),
Enum(Vec<EnumVariant>),
}Expand description
Type expression to describe structured types.
use daedalus_data::model::{TypeExpr, ValueType};
let ty = TypeExpr::List(Box::new(TypeExpr::Scalar(ValueType::Int)));
assert!(matches!(ty, TypeExpr::List(_)));Variants§
Scalar(ValueType)
Opaque(String)
Opaque, named type identifier (e.g. plugin-defined types).
This is useful when a type’s internal structure isn’t expressed in the graph type system, but you still want strong matching and a meaningful label in UIs.
Optional(Box<TypeExpr>)
List(Box<TypeExpr>)
Map(Box<TypeExpr>, Box<TypeExpr>)
Tuple(Vec<TypeExpr>)
Struct(Vec<StructField>)
Enum(Vec<EnumVariant>)
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TypeExpr
impl<'de> Deserialize<'de> for TypeExpr
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 Ord for TypeExpr
impl Ord for TypeExpr
Source§impl PartialOrd for TypeExpr
impl PartialOrd for TypeExpr
impl Eq for TypeExpr
impl StructuralPartialEq for TypeExpr
Auto Trait Implementations§
impl Freeze for TypeExpr
impl RefUnwindSafe for TypeExpr
impl Send for TypeExpr
impl Sync for TypeExpr
impl Unpin for TypeExpr
impl UnwindSafe for TypeExpr
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