cursive 0.2.0

A TUI (Text User Interface) library focused on ease-of-use.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use views::IdView;
use view::View;

/// Makes a view wrappable in an [`IdView`].
///
/// [`IdView`]: ../views/struct.IdView.html
pub trait Identifiable: View + Sized {
    /// Wraps this view into an IdView with the given id.
    fn with_id(self, id: &str) -> IdView<Self> {
        IdView::new(id, self)
    }
}

impl<T: View> Identifiable for T {}