[][src]Enum sixtyfps_compilerlib::typeregister::Type

pub enum Type {
    Invalid,
    Void,
    Component(Rc<Component>),
    Builtin(Rc<BuiltinElement>),
    Native(Rc<NativeClass>),
    Signal {
        args: Vec<Type>,
    },
    Function {
        return_type: Box<Type>,
        args: Vec<Type>,
    },
    Float32,
    Int32,
    String,
    Color,
    Duration,
    Length,
    LogicalLength,
    Resource,
    Bool,
    Model,
    PathElements,
    Easing,
    Array(Box<Type>),
    Object(BTreeMap<String, Type>),
    Enumeration(Rc<Enumeration>),
    EnumerationValue(EnumerationValue),
    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>)
Signal

Fields of Signal

args: Vec<Type>
Function

Fields of Function

return_type: Box<Type>args: Vec<Type>
Float32
Int32
String
Color
Duration
Length
LogicalLength
Resource
Bool
Model
PathElements
Easing
Array(Box<Type>)
Object(BTreeMap<String, Type>)
Enumeration(Rc<Enumeration>)
EnumerationValue(EnumerationValue)
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(&self, name: &str) -> Type[src]

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 can_convert(&self, other: &Self) -> bool[src]

Return true if the type can be converted to the other type

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

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.