After some discussion with PVH I realise that the repo structure in the last reorg was very rust-centric. In an attempt to put each language on a level footing move the rust code and project files into ./rust
21 lines
445 B
Rust
21 lines
445 B
Rust
use crate::op_tree::OpTreeNode;
|
|
use crate::query::{QueryResult, TreeQuery};
|
|
use std::fmt::Debug;
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
pub(crate) struct Len {
|
|
pub(crate) len: usize,
|
|
}
|
|
|
|
impl Len {
|
|
pub(crate) fn new() -> Self {
|
|
Len { len: 0 }
|
|
}
|
|
}
|
|
|
|
impl<'a> TreeQuery<'a> for Len {
|
|
fn query_node(&mut self, child: &OpTreeNode) -> QueryResult {
|
|
self.len = child.index.visible_len();
|
|
QueryResult::Finish
|
|
}
|
|
}
|