Skip to main content

ViewExt

Trait ViewExt 

Source
pub trait ViewExt: View {
    // Provided methods
    fn first(self) -> impl Future<Output = Result<ViewHandle>> + Send
       where Self: Sized { ... }
    fn single(self) -> impl Future<Output = Result<ViewHandle>> + Send
       where Self: Sized { ... }
    fn boxed<'a>(self) -> BoxView<'a>
       where Self: Sized + 'a { ... }
}
Expand description

Methods available on every View.

Provided Methods§

Source

fn first(self) -> impl Future<Output = Result<ViewHandle>> + Send
where Self: Sized,

Resolves the view’s first content and discards the view.

Later updates from a live view are discarded.

Source

fn single(self) -> impl Future<Output = Result<ViewHandle>> + Send
where Self: Sized,

Resolves the content of a view that has no live updates.

§Panics

Panics if the view’s first content is live.

Source

fn boxed<'a>(self) -> BoxView<'a>
where Self: Sized + 'a,

Boxes the view to give different view types a common return type.

Use this when a function returns different view! expressions, or when a recursive component needs a view type with a known size.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<V: View + ?Sized> ViewExt for V