Skip to main content

cursive_tree/backend/
simple.rs

1use super::{
2    super::{model::*, view::*},
3    backend::*,
4};
5
6//
7// SimpleTreeBackend
8//
9
10/// Simple tree view backend.
11///
12/// Nodes can only be populated manually.
13pub struct SimpleTreeBackend;
14
15impl SimpleTreeBackend {
16    /// Create a tree view with this backend.
17    pub fn tree_view() -> TreeView<Self> {
18        Self::tree_model().into()
19    }
20
21    /// Create a tree model with this backend.
22    pub fn tree_model() -> TreeModel<Self> {
23        TreeModel::new(())
24    }
25}
26
27impl TreeBackend for SimpleTreeBackend {
28    type Context = ();
29    type Error = ();
30    type ID = ();
31    type Data = ();
32}