Trait cursive::view::AnyView[][src]

pub trait AnyView {
    fn as_any(&self) -> &Any;
fn as_any_mut(&mut self) -> &mut Any;
fn as_boxed_any(self: Box<Self>) -> Box<Any>; }

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.

Important traits for Box<R>

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();

Implementors