pub struct StateProp<T> { /* private fields */ }Expand description
A @State property of a composed view.
Handed out by ComposedBuilder::state and passed back to read or write
it. Carrying the type makes the index unspellable and the kind a matter for
the compiler: p.state(count) cannot name a property that is not there,
cannot read an @AppStorage as @State, and cannot read an i64 one as a
String. All three were runtime assertions when properties were addressed
by number.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for StateProp<T>
impl<T> RefUnwindSafe for StateProp<T>
impl<T> Send for StateProp<T>
impl<T> Sync for StateProp<T>
impl<T> Unpin for StateProp<T>
impl<T> UnsafeUnpin for StateProp<T>
impl<T> UnwindSafe for StateProp<T>
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