pub fn insert(&mut self, key: K, value: V) -> Result<(), Box<Error>> {
        let record = KeyValuePair{key: key, value: value};

        // should wrap this in a read-write lock
        try!(self.wal_file.insert_record(&record));

        let KeyValuePair{key, value} = record;

        let size = self.mem_tree.insert(key, value);

        if size > MAX_MEMORY_ITEMS {
            try!(self.compact());
        }

        return Ok( () );
    }
/// Inserts a key into the BTree
Inserts a key into the BTree
Inserts a key into the BTree
pub fn insert(&mut self, key: K, value: V) -> Result<(), Box<Error>> {
        let record = KeyValuePair{key: key, value: value};
        // should wrap this in a read-write lock
        try!(self.wal_file.insert_record(&record));
        let KeyValuePair{key, value} = record;
        let size = self.mem_tree.insert(key, value);
        if size > MAX_MEMORY_ITEMS {
            try!(self.compact());
        }
        return Ok( () );
    }
pub fn insert ( & mut self , key : K , value : V ) -> Result < ( ) , Box < Error > > { let record = KeyValuePair { key : key , value : value } ; // should wrap this in a read-write lock try ! ( self wal_file insert_record ( record ) ) ; let KeyValuePair { key , value } = record ; let size = self . mem_tree . insert ( key , value ) ; if size > MAX_MEMORY_ITEMS { try ! ( self compact ( ) ) ; } return Ok ( ( ) ) ; }
Inserts a key into the BTree
Inserts a key into the BTree
&mut self
key
K
value
V