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
fn as_any(&self) -> &Any
Downcast self to a Any.
fn as_any_mut(&mut self) -> &mut Any
Downcast self to a mutable Any.
ⓘImportant traits for Box<R>
fn as_boxed_any(self: Box<Self>) -> Box<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();
Implementors
impl<T: View> AnyView for T