[][src]Struct cursive::views::NamedView

pub struct NamedView<V> { /* fields omitted */ }

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>(name: S, view: V) -> NamedView<V> where
    S: Into<String>, 
[src]

Wraps view in a new NamedView.

pub fn get_mut(
    &mut self
) -> OwningHandle<OwningRef<Rc<RefCell<V>>, RefCell<V>>, RefMut<'static, 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>(&mut self, name: S) where
    S: Into<String>, 
[src]

Changes the name attached to this view.

Trait Implementations

impl<T> ViewWrapper for NamedView<T> where
    T: 'static + View
[src]

type V = T

Type that this view wraps.

Auto Trait Implementations

impl<V> !RefUnwindSafe for NamedView<V>[src]

impl<V> !Send for NamedView<V>[src]

impl<V> !Sync for NamedView<V>[src]

impl<V> Unpin for NamedView<V>[src]

impl<V> !UnwindSafe for NamedView<V>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AnyView for T where
    T: View
[src]

pub fn as_any(&self) -> &(dyn Any + 'static)[src]

Downcast self to a Any.

pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)[src]

Downcast self to a mutable Any.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> Finder for T where
    T: View
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoBoxedView for T where
    T: View
[src]

impl<T> Nameable for T where
    T: View
[src]

impl<T> Resizable for T where
    T: View
[src]

impl<T> Scrollable for T where
    T: View
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> View for T where
    T: ViewWrapper
[src]

impl<T> With for T[src]