IntoView

Trait IntoView 

Source
pub trait IntoView: Sized {
    type V: View + 'static;
    type Intermediate: HasViewId + IntoView<V = Self::V>;

    // Required method
    fn into_intermediate(self) -> Self::Intermediate;

    // Provided methods
    fn into_view(self) -> Self::V { ... }
    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

The final View type this converts to.

Source

type Intermediate: HasViewId + IntoView<V = Self::V>

Intermediate type that has a ViewId before full view construction.

For View types, this is Self (already has ViewId). For primitives, this is LazyView<Self> (creates ViewId, defers view construction). For tuples/vecs, this is the converted view type (eager conversion).

Required Methods§

Source

fn into_intermediate(self) -> Self::Intermediate

Converts to the intermediate form which has a ViewId.

This is used by Decorators to get a ViewId for applying styles before the final view is constructed.

Provided Methods§

Source

fn into_view(self) -> Self::V

Converts the value into a View.

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§

impl IntoView for i32

Source§

impl IntoView for ()

Source§

impl IntoView for usize

Source§

impl IntoView for String

Source§

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

Source§

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

Source§

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

Source§

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

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§

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§

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§

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§

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§

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§

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§

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§

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§

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§

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§

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§

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

Source§

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

Source§

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

Implementors§

Source§

impl IntoView for RichSpan<'_>

Source§

impl IntoView for RichSpanOwned

Source§

impl IntoView for LazyView<&str>

Source§

impl IntoView for LazyView<i32>

Source§

impl IntoView for LazyView<()>

Source§

impl IntoView for LazyView<usize>

Source§

impl IntoView for LazyView<String>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

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 LazyView<(A, B, C, D, E, F, G)>

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 LazyView<(A, B, C, D, E, F, G, H)>

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 LazyView<(A, B, C, D, E, F, G, H, I)>

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 LazyView<(A, B, C, D, E, F, G, H, I, J)>

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 LazyView<(A, B, C, D, E, F, G, H, I, J, K)>

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 LazyView<(A, B, C, D, E, F, G, H, I, J, K, L)>

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 LazyView<(A, B, C, D, E, F, G, H, I, J, K, L, M)>

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 LazyView<(A, B, C, D, E, F, G, H, I, J, K, L, M, N)>

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 LazyView<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)>

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 LazyView<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)>

Source§

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

Source§

impl<T: 'static> IntoView for VirtualList<T>

Source§

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

Source§

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

Source§

type V = VW

Source§

type Intermediate = VW