seg_tree/nodes/
persistent_node.rs

1use super::Node;
2/// Required trait by nodes of persistent segment trees. It's essentially a trait needed for the internals of the persistent segment trees, unless you have special requirements just use [`PersistentWrapper`](crate::utils::PersistentWrapper).
3pub trait PersistentNode: Node {
4    /// Gives index of left child.
5    fn left_child(&self) -> usize;
6    /// Gives index of right child.
7    fn right_child(&self) -> usize;
8    /// Sets saved index of both left and right children. (It's assumed that before a call to this, the node has invalid indices.)
9    fn set_children(&mut self, left: usize, right: usize);
10}