Skip to main content

IntoView

Trait IntoView 

Source
pub trait IntoView {
    // Required method
    fn into_view(self) -> View;
}
Expand description

Anything that can become a View.

Required Methods§

Source

fn into_view(self) -> View

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoView for &String

Source§

impl IntoView for &str

Source§

impl IntoView for String

Source§

impl IntoView for bool

Source§

impl IntoView for f32

Source§

impl IntoView for f64

Source§

impl IntoView for i32

Source§

impl IntoView for i64

Source§

impl IntoView for u32

Source§

impl IntoView for u64

Source§

impl IntoView for usize

Source§

impl<T: IntoView> IntoView for Option<T>

Optional is a view in SwiftUI: nil renders as nothing.

So Some(v) is v and None is an EmptyView, which is what lets a children.iter().map(...) that sometimes yields nothing be passed straight into a container.

Implementors§