cursive_core/views/dummy.rs
1use crate::view::View;
2use crate::Printer;
3
4/// Dummy view.
5///
6/// Doesn't print anything. Minimal size is (1,1).
7#[derive(Default, Debug, Clone, Copy)]
8pub struct DummyView;
9
10impl DummyView {
11 /// Create a new `DummyView`.
12 pub fn new() -> Self {
13 DummyView
14 }
15}
16
17impl View for DummyView {
18 fn draw(&self, _: &Printer) {}
19
20 fn needs_relayout(&self) -> bool {
21 false
22 }
23}
24
25#[crate::blueprint(DummyView::new())]
26struct Blueprint;
27
28// crate::manual_blueprint!(DummyView, |_config, _context| { Ok(DummyView) });