Enum sixtyfps_compilerlib::langtype::Type [−][src]
pub enum Type {
Show 30 variants
Invalid,
Void,
InferredProperty,
InferredCallback,
Component(Rc<Component>),
Builtin(Rc<BuiltinElement>),
Native(Rc<NativeClass>),
Callback {
return_type: Option<Box<Type>>,
args: Vec<Type>,
},
Function {
return_type: Box<Type>,
args: Vec<Type>,
},
Float32,
Int32,
String,
Color,
Duration,
PhysicalLength,
LogicalLength,
Angle,
Percent,
Image,
Bool,
Model,
PathElements,
Easing,
Brush,
Array(Box<Type>),
Struct {
fields: BTreeMap<String, Type>,
name: Option<String>,
node: Option<ObjectType>,
},
Enumeration(Rc<Enumeration>),
UnitProduct(Vec<(Unit, i8)>),
ElementReference,
LayoutCache,
}
Variants
Invalid
Correspond to an uninitialized type, or an error
Void
The type of an expression that return nothing
InferredProperty
The type of a property two way binding whose type was not yet inferred
InferredCallback
The type of a callback alias whose type was not yet inferred
Component(Rc<Component>)
Builtin(Rc<BuiltinElement>)
Tuple Fields
0: Rc<BuiltinElement>
Native(Rc<NativeClass>)
Tuple Fields
0: Rc<NativeClass>
Callback
Function
Float32
Int32
String
Color
Duration
PhysicalLength
LogicalLength
Angle
Percent
Image
Bool
Model
PathElements
Easing
Brush
Array(Box<Type>)
This is usually a model
Struct
Enumeration(Rc<Enumeration>)
Tuple Fields
0: Rc<Enumeration>
UnitProduct(Vec<(Unit, i8)>)
A type made up of the product of several “unit” types. The first parameter is the unit, and the second parameter is the power. The vector should be sorted by 1) the power, 2) the unit.
ElementReference
LayoutCache
This is a SharedArray<f32>
Implementations
valid type for properties
List of sub properties valid for the auto completion
pub fn lookup_type_for_child_element(
&self,
name: &str,
tr: &TypeRegister
) -> Result<Type, String>
Assume this is a builtin type, panic if it isn’t
Assume this is a builtin type, panic if it isn’t
Assume it is a Component, panic if it isn’t
Assume it is an enumeration, panic if it isn’t
Return true if the type can be converted to the other type
pub fn collect_contextual_types(
&self,
context_restricted_types: &mut HashMap<String, HashSet<String>>
)
If this is a number type which should be used with an unit, this returns the default unit otherwise, returns None
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Type
impl !UnwindSafe for Type
Blanket Implementations
Mutably borrows from an owned value. Read more