Enum sixtyfps_interpreter::Value[][src]

#[non_exhaustive]
#[repr(C)]
pub enum Value {
    Void,
    Number(f64),
    String(SharedString),
    Bool(bool),
    Array(SharedVector<Value>),
    Model(Rc<dyn Model<Data = Value>>),
    Struct(Struct),
    Brush(Brush),
    // some variants omitted
}

This is a dynamically typed value used in the SixtyFPS interpreter. It can hold a value of different types, and you should use the From or TryInto traits to access the value.

use core::convert::TryInto;
// create a value containing an integer
let v = Value::from(100u32);
assert_eq!(v.try_into(), Ok(100u32));

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Void

There is nothing in this value. That’s the default. For example, a function that do not return a result would return a Value::Void

Number(f64)

An int or a float (this is also used for unit based type such as length or angle)

String(SharedString)

Correspond to the string type in .60

Bool(bool)

Correspond to the bool type in .60

An Array in the .60 language.

Model(Rc<dyn Model<Data = Value>>)

A more complex model which is not created by the interpreter itself (Value::Array can also be used for model)

Struct(Struct)

An object

Brush(Brush)

Correspond to brush or color type in .60. For color, this is then a Brush::SolidColor

Implementations

impl Value[src]

pub fn value_type(&self) -> ValueType[src]

Returns the type variant that this value holds without the containing value.

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl Default for Value[src]

impl From<()> for Value[src]

impl From<Brush> for Value[src]

impl From<Color> for Value[src]

impl From<EasingCurve> for Value[src]

impl From<EventResult> for Value[src]

impl From<FillRule> for Value[src]

impl From<ImageFit> for Value[src]

impl From<ImageReference> for Value[src]

impl From<Instant> for Value[src]

impl From<KeyEvent> for Value[src]

impl From<KeyEventType> for Value[src]

impl From<KeyboardModifiers> for Value[src]

impl From<LayoutAlignment> for Value[src]

impl From<PathData> for Value[src]

impl From<SharedString> for Value[src]

impl From<StandardListViewItem> for Value[src]

impl From<StateInfo> for Value[src]

impl From<Struct> for Value[src]

impl From<TextHorizontalAlignment> for Value[src]

impl From<TextOverflow> for Value[src]

impl From<TextVerticalAlignment> for Value[src]

impl From<TextWrap> for Value[src]

impl From<Vec<Value, Global>> for Value[src]

FIXME: use SharedArray instead?

impl From<bool> for Value[src]

impl From<f32> for Value[src]

impl From<f64> for Value[src]

impl From<i32> for Value[src]

impl From<i64> for Value[src]

impl From<isize> for Value[src]

impl From<u32> for Value[src]

impl From<u64> for Value[src]

impl From<usize> for Value[src]

impl PartialEq<Value> for Value[src]

impl TryInto<()> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<Brush> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<Color> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<EasingCurve> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<EventResult> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<FillRule> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<ImageFit> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<ImageReference> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<Instant> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<KeyEvent> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<KeyEventType> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<KeyboardModifiers> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<LayoutAlignment> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<PathData> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<SharedString> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<StandardListViewItem> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<StateInfo> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<Struct> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<TextHorizontalAlignment> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<TextOverflow> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<TextVerticalAlignment> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<TextWrap> for Value[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryInto<Vec<Value, Global>> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<bool> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<f32> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<f64> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<i32> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<i64> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<isize> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<u32> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<u64> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl TryInto<usize> for Value[src]

type Error = Value

The type returned in the event of a conversion error.

impl ValueType for Value[src]

Auto Trait Implementations

impl !RefUnwindSafe for Value

impl !Send for Value

impl !Sync for Value

impl Unpin for Value

impl !UnwindSafe for Value

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, 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.