cursive/src/view/view_path.rs
Alexandre Bury e17ca97136 Add ViewPath and Cursive::find
Callbacks now include a path to the triggering view.
The Cursive root can find the View corresponding to a ViewPath.
In the future, ViewPaths may be returned when creating the layout.
2015-05-15 17:56:38 -07:00

16 lines
385 B
Rust

/// Represents a path to a single view in the layout.
pub struct ViewPath {
/// List of turns to make on decision nodes when descending the view tree.
/// Simple nodes (with one fixed child) are skipped.
pub path: Vec<usize>,
}
impl ViewPath {
/// Creates a new empty path.
pub fn new() -> Self {
ViewPath {
path: Vec::new(),
}
}
}