icentral-node-stack 0.1.0

icentral-node-stack is a Rust crate designed to facilitate stack-based operations on NodeId structures. It offers efficient node management with capabilities for accessing, modifying, and manipulating node stacks, enabling advanced data structure handling and simulation scenarios.
Documentation
crate::ix!();

#[macro_export] macro_rules! delegate_to_bfs_stack {
    ($ty:ty) => {

        impl $ty {
            delegate! {
                to self.stack {

                    #[call(push)]
                    pub fn stack_push(&mut self, n: NodeId);

                    #[call(pop)]
                    pub fn stack_pop(&mut self) -> Option<NodeId>;

                    #[call(len)]
                    pub fn stack_len(&self) -> usize;

                    #[call(node_at_index)]
                    pub fn stack_node_at_index(&self, idx: usize) -> NodeId;

                    #[call(set_node_at_index)]
                    pub fn stack_set_node_at_index(&mut self, idx: usize, n: NodeId);
                }
            }
        }
    }
}