[−][src]Struct cursive_core::views::NamedView
Wrapper around a view to make it identifiable.
This lets other views refer to this one using a string identifier.
See Identifiable
for an easy way to wrap any view with it.
Implementations
impl<V> NamedView<V>
[src]
pub fn new<S: Into<String>>(name: S, view: V) -> Self
[src]
Wraps view
in a new NamedView
.
pub fn get_mut(&mut self) -> ViewRef<V>
[src]
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.
pub fn name(&self) -> &str
[src]
Returns the name attached to this view.
pub fn set_name<S: Into<String>>(&mut self, name: S)
[src]
Changes the name attached to this view.
Trait Implementations
impl<T: View + 'static> ViewWrapper for NamedView<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,
[src]
F: FnOnce(&Self::V) -> R,
fn with_view_mut<F, R>(&mut self, f: F) -> Option<R> where
F: FnOnce(&mut Self::V) -> R,
[src]
F: FnOnce(&mut Self::V) -> R,
fn into_inner(self) -> Result<Self::V, Self> where
Self::V: Sized,
[src]
Self::V: Sized,
fn wrap_call_on_any<'a>(&mut self, selector: &Selector, callback: AnyCb<'a>)
[src]
fn wrap_focus_view(&mut self, selector: &Selector) -> Result<(), ()>
[src]
fn wrap_draw(&self, printer: &Printer)
[src]
fn wrap_required_size(&mut self, req: Vec2) -> Vec2
[src]
fn wrap_on_event(&mut self, ch: Event) -> EventResult
[src]
fn wrap_layout(&mut self, size: Vec2)
[src]
fn wrap_take_focus(&mut self, source: Direction) -> bool
[src]
fn wrap_needs_relayout(&self) -> bool
[src]
fn wrap_important_area(&self, size: Vec2) -> Rect
[src]
Auto Trait Implementations
impl<V> !RefUnwindSafe for NamedView<V>
impl<V> !Send for NamedView<V>
impl<V> !Sync for NamedView<V>
impl<V> Unpin for NamedView<V>
impl<V> !UnwindSafe for NamedView<V>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,