floem

Trait IntoView

Source
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§

Source

type V: View + 'static

Required Methods§

Source

fn into_view(self) -> Self::V

Converts the value into a View.

Provided Methods§

Source

fn into_any(self) -> AnyView

Converts the value into a AnyView.

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.

Implementations on Foreign Types§

Source§

impl IntoView for &str

Source§

type V = Label

Source§

fn into_view(self) -> Self::V

Source§

impl IntoView for i32

Source§

type V = Label

Source§

fn into_view(self) -> Self::V

Source§

impl IntoView for usize

Source§

type V = Label

Source§

fn into_view(self) -> Self::V

Source§

impl IntoView for String

Source§

type V = Label

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static> IntoView for (A,)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static> IntoView for (A, B)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static> IntoView for (A, B, C)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static, D: IntoView + 'static> IntoView for (A, B, C, D)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static, D: IntoView + 'static, E: IntoView + 'static> IntoView for (A, B, C, D, E)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static, D: IntoView + 'static, E: IntoView + 'static, F: IntoView + 'static> IntoView for (A, B, C, D, E, F)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static, D: IntoView + 'static, E: IntoView + 'static, F: IntoView + 'static, G: IntoView + 'static> IntoView for (A, B, C, D, E, F, G)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static, D: IntoView + 'static, E: IntoView + 'static, F: IntoView + 'static, G: IntoView + 'static, H: IntoView + 'static> IntoView for (A, B, C, D, E, F, G, H)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static, D: IntoView + 'static, E: IntoView + 'static, F: IntoView + 'static, G: IntoView + 'static, H: IntoView + 'static, I: IntoView + 'static> IntoView for (A, B, C, D, E, F, G, H, I)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static, D: IntoView + 'static, E: IntoView + 'static, F: IntoView + 'static, G: IntoView + 'static, H: IntoView + 'static, I: IntoView + 'static, J: IntoView + 'static> IntoView for (A, B, C, D, E, F, G, H, I, J)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static, D: IntoView + 'static, E: IntoView + 'static, F: IntoView + 'static, G: IntoView + 'static, H: IntoView + 'static, I: IntoView + 'static, J: IntoView + 'static, K: IntoView + 'static> IntoView for (A, B, C, D, E, F, G, H, I, J, K)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static, D: IntoView + 'static, E: IntoView + 'static, F: IntoView + 'static, G: IntoView + 'static, H: IntoView + 'static, I: IntoView + 'static, J: IntoView + 'static, K: IntoView + 'static, L: IntoView + 'static> IntoView for (A, B, C, D, E, F, G, H, I, J, K, L)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static, D: IntoView + 'static, E: IntoView + 'static, F: IntoView + 'static, G: IntoView + 'static, H: IntoView + 'static, I: IntoView + 'static, J: IntoView + 'static, K: IntoView + 'static, L: IntoView + 'static, M: IntoView + 'static> IntoView for (A, B, C, D, E, F, G, H, I, J, K, L, M)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static, D: IntoView + 'static, E: IntoView + 'static, F: IntoView + 'static, G: IntoView + 'static, H: IntoView + 'static, I: IntoView + 'static, J: IntoView + 'static, K: IntoView + 'static, L: IntoView + 'static, M: IntoView + 'static, N: IntoView + 'static> IntoView for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static, D: IntoView + 'static, E: IntoView + 'static, F: IntoView + 'static, G: IntoView + 'static, H: IntoView + 'static, I: IntoView + 'static, J: IntoView + 'static, K: IntoView + 'static, L: IntoView + 'static, M: IntoView + 'static, N: IntoView + 'static, O: IntoView + 'static> IntoView for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<A: IntoView + 'static, B: IntoView + 'static, C: IntoView + 'static, D: IntoView + 'static, E: IntoView + 'static, F: IntoView + 'static, G: IntoView + 'static, H: IntoView + 'static, I: IntoView + 'static, J: IntoView + 'static, K: IntoView + 'static, L: IntoView + 'static, M: IntoView + 'static, N: IntoView + 'static, O: IntoView + 'static, P: IntoView + 'static> IntoView for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<IV: IntoView + 'static> IntoView for Box<dyn Fn() -> IV>

Source§

type V = DynamicView

Source§

fn into_view(self) -> Self::V

Source§

impl<IV: IntoView + 'static> IntoView for Vec<IV>

Source§

type V = Stack

Source§

fn into_view(self) -> Self::V

Source§

impl<T: IntoView + Clone + 'static> IntoView for ReadSignal<T>

Source§

type V = DynamicView

Source§

fn into_view(self) -> Self::V

Implementors§

Source§

impl IntoView for RichSpan<'_>

Source§

impl IntoView for RichSpanOwned

Source§

impl<T: IntoView + Clone + 'static> IntoView for RwSignal<T>

Source§

impl<VW: View + 'static> IntoView for VW

Source§

type V = VW