fn btree_to_string(&self) -> String {
        match self {
            SafasCell::BTree(key_values, child_nodes) => {
                // Start with the empty string
                let mut result = String::from("");

                if child_nodes.len() > 0 {
                    // Left values, median value, right values
                    for idx in 0..=key_values.len() {
                        write!(result, "{}", child_nodes[idx].btree_to_string()).ok();

                        if idx < key_values.len() {
                            write!(result, "\n  {} -> {}", key_values[idx].0.to_string(), key_values[idx].1.to_string()).ok();
                        }
                    }
                } else {
                    // Just the values from the leaf node
                    for (key, value) in key_values.iter() {
                        write!(result, "\n  {} -> {}", key.to_string(), value.to_string()).ok();
                    }
                }

                result
            },
            _ => "?? -> ??".to_string()
        }
    }
///
/// Creates a 'a -> b' type string for displaying the contents of a B-Tree
///
Creates a 'a -> b' type string for displaying the contents of a B-Tree
Creates a ' a - > b ' type string for displaying the contents of a B - Tree
fn btree_to_string(&self) -> String {
        match self {
            SafasCell::BTree(key_values, child_nodes) => {
                // Start with the empty string
                let mut result = String::from("");
                if child_nodes.len() > 0 {
                    // Left values, median value, right values
                    for idx in 0..=key_values.len() {
                        write!(result, "{}", child_nodes[idx].btree_to_string()).ok();
                        if idx < key_values.len() {
                            write!(result, "\n  {} -> {}", key_values[idx].0.to_string(), key_values[idx].1.to_string()).ok();
                        }
                    }
                } else {
                    // Just the values from the leaf node
                    for (key, value) in key_values.iter() {
                        write!(result, "\n  {} -> {}", key.to_string(), value.to_string()).ok();
                    }
                }
                result
            },
            _ => "?? -> ??".to_string()
        }
    }
fn btree_to_string ( & self ) -> String { match self { SafasCell :: BTree ( key_values , child_nodes ) => { // Start with the empty string let mut result = String :: from ( " " ) ; if child_nodes . len ( ) > 0 { // Left values, median value, right values for idx in 0 ..= key_values . len ( ) { write ! ( result " " child_nodes [ idx ] btree_to_string ( ) ) . ok ( ) ; if idx < key_values . len ( ) { write ! ( result " \n " key_values [ idx ] 0 to_string ( ) key_values [ idx ] 1 to_string ( ) ) . ok ( ) ; } } } else { // Just the values from the leaf node for ( key , value ) in key_values . iter ( ) { write ! ( result " \n " key to_string ( ) value to_string ( ) ) . ok ( ) ; } } result } , _ => " " . to_string ( ) } }
Creates a 'a -> b' type string for displaying the contents of a B-Tree
Creates a ' a - > b ' type string for displaying the contents of a B - Tree
&self
&self