pub trait EnvironmentArg {
// Required method
fn environment(self, view: View) -> View;
}Expand description
A value .environment(_:_:) can write.
Swift’s is environment<V>(_ keyPath: WritableKeyPath<EnvironmentValues, V>, _ value: V), one modifier over every property. Each property is a separate
entry point here because each needs its own key path, so the trait puts
them back behind one spelling — the argument’s type choosing the property,
the way the key path does in Swift.
Required Methods§
Sourcefn environment(self, view: View) -> View
fn environment(self, view: View) -> View
Write this value into view’s environment.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".