Skip to main content

StateValue

Trait StateValue 

Source
pub trait StateValue: StoredValue {
    // Required method
    fn state_field_type() -> &'static [u8] ⓘ;
}
Expand description

A type @State can hold.

State<V> is the value followed by the location box SwiftUI installs, so its width follows V: sixteen bytes for the three scalars, twenty-four for a String. The box is therefore the last word rather than the one at offset eight, which is what an earlier Int-only reading of it assumed.

Required Methods§

Source

fn state_field_type() -> &'static [u8] ⓘ

The mangled State<Self>, NUL-terminated, for the field record.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl StateValue for String

Source§

fn state_field_type() -> &'static [u8] ⓘ

Source§

impl StateValue for bool

Source§

fn state_field_type() -> &'static [u8] ⓘ

Source§

impl StateValue for f64

Source§

fn state_field_type() -> &'static [u8] ⓘ

Source§

impl StateValue for i64

Source§

fn state_field_type() -> &'static [u8] ⓘ

Implementors§