pub struct Props { /* private fields */ }Expand description
The properties of a composed view, read inside its body.
Indices are the order the properties were added. Reading the wrong type at an index is a programming error the same way an out-of-range index is, and is caught the same way — by an assertion, not by a fault inside SwiftUI.
Implementations§
Source§impl Props
impl Props
Sourcepub fn state<T: StateValue + Default>(&self, prop: StateProp<T>) -> T
pub fn state<T: StateValue + Default>(&self, prop: StateProp<T>) -> T
The @State at index i.
Returns T’s default before SwiftUI has installed the property — the
box is the last word of a State<V>, and a zero one means reading
would fault rather than answer.
Sourcepub fn stored<T: StoredValue>(&self, prop: StoredProp<T>) -> T
pub fn stored<T: StoredValue>(&self, prop: StoredProp<T>) -> T
The @AppStorage at index i.
Sourcepub fn focus(&self, prop: FocusProp) -> bool
pub fn focus(&self, prop: FocusProp) -> bool
Whether the @FocusState at index i currently has focus.
Sourcepub fn focus_projection(&self, prop: FocusProp) -> [u64; 3]
pub fn focus_projection(&self, prop: FocusProp) -> [u64; 3]
The three words .focused(_:) wants, for the @FocusState at index
i. Pass it to crate::views::focused_on on the field it belongs to.
Auto Trait Implementations§
impl !Send for Props
impl !Sync for Props
impl Freeze for Props
impl RefUnwindSafe for Props
impl Unpin for Props
impl UnsafeUnpin for Props
impl UnwindSafe for Props
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