Struct cursive::views::IdView
[−]
[src]
pub struct IdView<V: View> { /* fields omitted */ }
Wrapper around a view to provide interior mutability.
Methods
impl<V: View> IdView<V>
[src]
fn new<S: Into<String>>(id: S, view: V) -> Self
Wraps view
in a new IdView
.
fn get_mut(&mut self) -> ViewRef<V>
Gets mutable access to the inner view.
This returns a ViewRef<V>
, which implement DerefMut<Target = V>
.
Panics
Panics if another reference for this view already exists.
Trait Implementations
impl<T: View + 'static> ViewWrapper for IdView<T>
[src]
type V = T
Type that this view wraps.
fn with_view<F, R>(&self, f: F) -> Option<R> where
F: FnOnce(&Self::V) -> R,
F: FnOnce(&Self::V) -> R,
Get an immutable reference to the wrapped view.
fn with_view_mut<F, R>(&mut self, f: F) -> Option<R> where
F: FnOnce(&mut Self::V) -> R,
F: FnOnce(&mut Self::V) -> R,
Get a mutable reference to the wrapped view.
fn wrap_call_on_any<'a>(
&mut self,
selector: &Selector,
callback: Box<FnMut(&'b mut Any) + 'a>
)
&mut self,
selector: &Selector,
callback: Box<FnMut(&'b mut Any) + 'a>
)
Wraps the find
method.
fn wrap_focus_view(&mut self, selector: &Selector) -> Result<(), ()>
Wraps the focus_view
method.
fn wrap_draw(&self, printer: &Printer)
Wraps the draw
method.
fn wrap_required_size(&mut self, req: Vec2) -> Vec2
Wraps the required_size
method.
fn wrap_on_event(&mut self, ch: Event) -> EventResult
Wraps the on_event
method.
fn wrap_layout(&mut self, size: Vec2)
Wraps the layout
method.
fn wrap_take_focus(&mut self, source: Direction) -> bool
Wraps the take_focus
method.
fn wrap_needs_relayout(&self) -> bool
Wraps the needs_relayout
method.