Skip to main content

text_binding

Function text_binding 

Source
pub fn text_binding(state: &BoundState<String>) -> Vec<u8> ⓘ
Expand description

Build a Binding<Bool> over Rust state, for direct write-back testing. Build a Binding<String> backed by Rust state.

Named for the binding rather than the type: string_binding already means something else here — the four words of a LocalizedStringKey.

The getter hands SwiftUI a freshly built Swift String each time it asks; the setter copies the incoming one out without touching its storage, since the value arrives borrowed.