Skip to main content

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) -> Box<dyn View> { ... }
}
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) -> Box<dyn View>

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".

Implementations on Foreign Types§

Source§

impl IntoView for &str

Source§

impl IntoView for ()

Source§

impl IntoView for String

Source§

impl IntoView for i32

Source§

impl IntoView for usize

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§

Source§

impl IntoView for LazyView<&str>

Source§

impl IntoView for LazyView<()>

Source§

impl IntoView for LazyView<String>

Source§

impl IntoView for LazyView<i32>

Source§

impl IntoView for LazyView<usize>

Source§

impl IntoView for RichSpanOwned

Source§

impl<'a> IntoView for RichSpan<'a>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T> IntoView for NavigationStackBuilder<T, AutoNavigationKey, CustomNavigationView<T>>
where T: Eq + Hash + Clone + 'static,

Source§

impl<T> IntoView for NavigationStackBuilder<T, CustomNavigationKey<T>, CustomNavigationView<T>>
where T: 'static,

Source§

impl<T> IntoView for NavigationStackBuilder<T, CustomNavigationKey<T>>
where T: IntoView + 'static,

Source§

impl<T> IntoView for NavigationStackBuilder<T>
where T: Eq + Hash + Clone + IntoView + 'static,

Source§

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

Source§

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

Source§

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

Source§

type V = VW

Source§

type Intermediate = VW