pub enum Type {
Show 29 variants
Invalid,
Void,
InferredProperty,
InferredCallback,
Callback(Rc<Function>),
Function(Rc<Function>),
ComponentFactory,
Float32,
Int32,
String,
Color,
Duration,
PhysicalLength,
LogicalLength,
Rem,
Angle,
Percent,
Image,
Bool,
Model,
PathData,
Easing,
Brush,
Array(Rc<Type>),
Struct(Rc<Struct>),
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
Callback(Rc<Function>)
Function(Rc<Function>)
ComponentFactory
Float32
Int32
String
Color
Duration
PhysicalLength
LogicalLength
Rem
Angle
Percent
Image
Bool
Model
Fake type that can represent anything that can be converted into a model.
PathData
Easing
Brush
Array(Rc<Type>)
This is usually a model
Struct(Rc<Struct>)
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
LayoutCache
This is a SharedArray<f32>
Implementations§
Source§impl Type
impl Type
Sourcepub fn is_property_type(&self) -> bool
pub fn is_property_type(&self) -> bool
valid type for properties
pub fn ok_for_public_api(&self) -> bool
Sourcepub fn as_enum(&self) -> &Rc<Enumeration>
pub fn as_enum(&self) -> &Rc<Enumeration>
Assume it is an enumeration, panic if it isn’t
Sourcepub fn can_convert(&self, other: &Self) -> bool
pub fn can_convert(&self, other: &Self) -> bool
Return true if the type can be converted to the other type
Sourcepub fn default_unit(&self) -> Option<Unit>
pub fn default_unit(&self) -> Option<Unit>
If this is a number type which should be used with an unit, this returns the default unit otherwise, returns None
Trait Implementations§
Source§impl From<Type> for PropertyDeclaration
impl From<Type> for PropertyDeclaration
Auto Trait Implementations§
impl Freeze for Type
impl !RefUnwindSafe for Type
impl !Send for Type
impl !Sync for Type
impl Unpin for Type
impl !UnwindSafe for Type
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more