Enum slint_interpreter::Value
source · pub enum Value {
Void,
Number(f64),
String(SharedString),
Bool(bool),
Image(Image),
Model(ModelRc<Value>),
Struct(Struct),
Brush(Brush),
// some variants omitted
}
Expand description
This is a dynamically typed value used in the Slint interpreter.
It can hold a value of different types, and you should use the
From
or TryFrom
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§
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 .slint
Bool(bool)
Correspond to the bool
type in .slint
Image(Image)
Correspond to the image
type in .slint
Model(ModelRc<Value>)
A model (that includes array in .slint)
Struct(Struct)
An object
Brush(Brush)
Correspond to brush
or color
type in .slint. For color, this is then a Brush::SolidColor
Implementations§
Trait Implementations§
source§impl From<AccessibleRole> for Value
impl From<AccessibleRole> for Value
source§fn from(v: AccessibleRole) -> Self
fn from(v: AccessibleRole) -> Self
Converts to this type from the input type.
source§impl From<DialogButtonRole> for Value
impl From<DialogButtonRole> for Value
source§fn from(v: DialogButtonRole) -> Self
fn from(v: DialogButtonRole) -> Self
Converts to this type from the input type.
source§impl From<EasingCurve> for Value
impl From<EasingCurve> for Value
source§fn from(v: EasingCurve) -> Self
fn from(v: EasingCurve) -> Self
Converts to this type from the input type.
source§impl From<EventResult> for Value
impl From<EventResult> for Value
source§fn from(v: EventResult) -> Self
fn from(v: EventResult) -> Self
Converts to this type from the input type.
source§impl From<ImageRendering> for Value
impl From<ImageRendering> for Value
source§fn from(v: ImageRendering) -> Self
fn from(v: ImageRendering) -> Self
Converts to this type from the input type.
source§impl From<KeyboardModifiers> for Value
impl From<KeyboardModifiers> for Value
source§fn from(_: KeyboardModifiers) -> Self
fn from(_: KeyboardModifiers) -> Self
Converts to this type from the input type.
source§impl From<LayoutAlignment> for Value
impl From<LayoutAlignment> for Value
source§fn from(v: LayoutAlignment) -> Self
fn from(v: LayoutAlignment) -> Self
Converts to this type from the input type.
source§impl From<LayoutInfo> for Value
impl From<LayoutInfo> for Value
source§fn from(_: LayoutInfo) -> Self
fn from(_: LayoutInfo) -> Self
Converts to this type from the input type.
source§impl From<Length<f32, LogicalPx>> for Value
impl From<Length<f32, LogicalPx>> for Value
source§fn from(l: LogicalLength) -> Self
fn from(l: LogicalLength) -> Self
Converts to this type from the input type.
source§impl From<MouseCursor> for Value
impl From<MouseCursor> for Value
source§fn from(v: MouseCursor) -> Self
fn from(v: MouseCursor) -> Self
Converts to this type from the input type.
source§impl From<PointerEvent> for Value
impl From<PointerEvent> for Value
source§fn from(_: PointerEvent) -> Self
fn from(_: PointerEvent) -> Self
Converts to this type from the input type.
source§impl From<PointerEventButton> for Value
impl From<PointerEventButton> for Value
source§fn from(v: PointerEventButton) -> Self
fn from(v: PointerEventButton) -> Self
Converts to this type from the input type.
source§impl From<PointerEventKind> for Value
impl From<PointerEventKind> for Value
source§fn from(v: PointerEventKind) -> Self
fn from(v: PointerEventKind) -> Self
Converts to this type from the input type.
source§fn from(v: SharedString) -> Self
fn from(v: SharedString) -> Self
Converts to this type from the input type.
source§fn from(v: SharedVector<f32>) -> Self
fn from(v: SharedVector<f32>) -> Self
Converts to this type from the input type.
source§impl From<StandardButtonKind> for Value
impl From<StandardButtonKind> for Value
source§fn from(v: StandardButtonKind) -> Self
fn from(v: StandardButtonKind) -> Self
Converts to this type from the input type.
source§impl From<StandardListViewItem> for Value
impl From<StandardListViewItem> for Value
source§fn from(_: StandardListViewItem) -> Self
fn from(_: StandardListViewItem) -> Self
Converts to this type from the input type.
source§impl From<TableColumn> for Value
impl From<TableColumn> for Value
source§fn from(_: TableColumn) -> Self
fn from(_: TableColumn) -> Self
Converts to this type from the input type.
source§impl From<TextHorizontalAlignment> for Value
impl From<TextHorizontalAlignment> for Value
source§fn from(v: TextHorizontalAlignment) -> Self
fn from(v: TextHorizontalAlignment) -> Self
Converts to this type from the input type.
source§impl From<TextOverflow> for Value
impl From<TextOverflow> for Value
source§fn from(v: TextOverflow) -> Self
fn from(v: TextOverflow) -> Self
Converts to this type from the input type.
source§impl From<TextVerticalAlignment> for Value
impl From<TextVerticalAlignment> for Value
source§fn from(v: TextVerticalAlignment) -> Self
fn from(v: TextVerticalAlignment) -> Self
Converts to this type from the input type.
source§impl PartialEq<Value> for Value
impl PartialEq<Value> for Value
source§impl TryFrom<Value> for AccessibleRole
impl TryFrom<Value> for AccessibleRole
source§impl TryFrom<Value> for DialogButtonRole
impl TryFrom<Value> for DialogButtonRole
source§impl TryFrom<Value> for EasingCurve
impl TryFrom<Value> for EasingCurve
source§impl TryFrom<Value> for EventResult
impl TryFrom<Value> for EventResult
source§impl TryFrom<Value> for ImageRendering
impl TryFrom<Value> for ImageRendering
source§impl TryFrom<Value> for KeyboardModifiers
impl TryFrom<Value> for KeyboardModifiers
source§impl TryFrom<Value> for LayoutAlignment
impl TryFrom<Value> for LayoutAlignment
source§impl TryFrom<Value> for LayoutInfo
impl TryFrom<Value> for LayoutInfo
source§impl TryFrom<Value> for LogicalLength
impl TryFrom<Value> for LogicalLength
source§impl TryFrom<Value> for MouseCursor
impl TryFrom<Value> for MouseCursor
source§impl TryFrom<Value> for PointerEvent
impl TryFrom<Value> for PointerEvent
source§impl TryFrom<Value> for PointerEventButton
impl TryFrom<Value> for PointerEventButton
source§impl TryFrom<Value> for PointerEventKind
impl TryFrom<Value> for PointerEventKind
source§impl TryFrom<Value> for StandardButtonKind
impl TryFrom<Value> for StandardButtonKind
source§impl TryFrom<Value> for StandardListViewItem
impl TryFrom<Value> for StandardListViewItem
source§impl TryFrom<Value> for TableColumn
impl TryFrom<Value> for TableColumn
source§impl TryFrom<Value> for TextHorizontalAlignment
impl TryFrom<Value> for TextHorizontalAlignment
source§impl TryFrom<Value> for TextOverflow
impl TryFrom<Value> for TextOverflow
source§impl TryFrom<Value> for TextVerticalAlignment
impl TryFrom<Value> for TextVerticalAlignment
impl ValueType for Value
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§
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
Mutably borrows from an owned value. Read more