pub trait AnyView {
    fn as_any(&self) -> &(dyn Any + 'static);
    fn as_any_mut(&mut self) -> &mut (dyn Any + 'static);
    fn as_boxed_any(self: Box<Self, Global>) -> Box<dyn Any + 'static, Global>Notable traits for Box<F, A>impl<F, A> Future for Box<F, A>where
    F: Future + Unpin + ?Sized,
    A: Allocator + 'static,
type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A>where
    I: Iterator + ?Sized,
    A: Allocator,
type Item = <I as Iterator>::Item;
; }
Expand description

A view that can be downcasted to its concrete type.

This trait is automatically implemented for any T: View.

Required Methods

Downcast self to a Any.

Downcast self to a mutable Any.

Returns a boxed any from a boxed self.

Can be used before Box::downcast().

Examples
let boxed: Box<View> = Box::new(TextView::new("text"));
let text: Box<TextView> = boxed.as_boxed_any().downcast().unwrap();

Implementations

Attempts to downcast self to a concrete type.

Attempts to downcast self to a concrete type.

Attempts to downcast Box<Self> to a concrete type.

Checks if this view is of type T.

Implementors