Enum sixtyfps_compilerlib::langtype::Type[][src]

pub enum Type {
Show variants Invalid, Void, 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,
}

Variants

Invalid

Correspond to an uninitialized type, or an error

Void

The type of an expression that return nothing

Component(Rc<Component>)
Builtin(Rc<BuiltinElement>)
Native(Rc<NativeClass>)
Callback
Show fields

Fields of Callback

return_type: Option<Box<Type>>args: Vec<Type>
Function
Show fields

Fields of 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
Show fields

Fields of Struct

fields: BTreeMap<String, Type>name: Option<String>node: Option<ObjectType>
Enumeration(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

Implementations

impl Type[src]

pub fn is_object_type(&self) -> bool[src]

pub fn is_property_type(&self) -> bool[src]

valid type for properties

pub fn ok_for_public_api(&self) -> bool[src]

pub fn lookup_property<'a>(&self, name: &'a str) -> PropertyLookupResult<'a>[src]

pub fn property_list(&self) -> Vec<(String, Type)>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

List of sub properties valid for the auto completion

pub fn lookup_type_for_child_element(
    &self,
    name: &str,
    tr: &TypeRegister
) -> Result<Type, String>
[src]

pub fn lookup_member_function(&self, name: &str) -> Expression[src]

pub fn as_builtin(&self) -> &BuiltinElement[src]

Assume this is a builtin type, panic if it isn’t

pub fn as_native(&self) -> &NativeClass[src]

Assume this is a builtin type, panic if it isn’t

pub fn as_component(&self) -> &Rc<Component>[src]

Assime it is a Component, panic if it isn’t

pub fn as_enum(&self) -> &Rc<Enumeration>[src]

Assume it is an enumeration, panic if it isn’t

pub fn can_convert(&self, other: &Self) -> bool[src]

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>>
)
[src]

pub fn default_unit(&self) -> Option<Unit>[src]

If this is a number type which should be used with an unit, this returns the default unit otherwise, returns None

pub fn as_unit_product(&self) -> Option<Vec<(Unit, i8)>>[src]

Return a unit product vector even for single scalar

Trait Implementations

impl Clone for Type[src]

impl Debug for Type[src]

impl Default for Type[src]

impl Display for Type[src]

impl From<Type> for PropertyDeclaration[src]

impl PartialEq<Type> for Type[src]

Auto Trait Implementations

impl !RefUnwindSafe for Type

impl !Send for Type

impl !Sync for Type

impl Unpin for Type

impl !UnwindSafe for Type

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.