pub trait IntoView: Sized {
type V: View + 'static;
// Required method
fn into_view(self) -> Self::V;
// Provided method
fn into_any(self) -> AnyView { ... }
}
Expand description
Converts a value into a View
.
This trait can be implemented on types which can be built into another type that implements the View
trait.
For example, &str
implements IntoView
by building a text
view and can therefore be used directly in a View tuple.
fn app_view() -> impl IntoView {
v_stack(("Item One", "Item Two"))
}
Check out the other types that IntoView
is implemented for.
Required Associated Types§
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.