pub fn insert_many<B: AsRef<[u8]>>(
        &self,
        iter: impl IntoIterator<Item = (K, B)>,
    ) -> Result<(), BTreeStoreError> {
        let mut offsets: Vec<(K, u64)> = vec![];
        for (key, blob) in iter {
            let offset = self.flatfile.append(blob.as_ref())?;
            offsets.push((key, offset.into()));
        }

        self.index.insert_many(offsets.drain(..))?;

        self.flatfile.sync()?;
        self.index.checkpoint()?;
        Ok(())
    }
/// insert many values in one transaction (with only one fsync)
insert many values in one transaction (with only one fsync)
insert many values in one transaction ( with only one fsync )
pub fn insert_many<B: AsRef<[u8]>>(
        &self,
        iter: impl IntoIterator<Item = (K, B)>,
    ) -> Result<(), BTreeStoreError> {
        let mut offsets: Vec<(K, u64)> = vec![];
        for (key, blob) in iter {
            let offset = self.flatfile.append(blob.as_ref())?;
            offsets.push((key, offset.into()));
        }
        self.index.insert_many(offsets.drain(..))?;
        self.flatfile.sync()?;
        self.index.checkpoint()?;
        Ok(())
    }
pub fn insert_many < B : AsRef < [ u8 ] > > ( & self , iter : impl IntoIterator < Item = ( K , B ) > , ) -> Result < ( ) , BTreeStoreError > { let mut offsets : Vec < ( K , u64 ) > = vec ! [ ] ; for ( key , blob ) in iter { let offset = self . flatfile . append ( blob . as_ref ( ) ) ? ; offsets . push ( ( key , offset . into ( ) ) ) ; } self . index . insert_many ( offsets . drain ( .. ) ) ? ; self . flatfile . sync ( ) ? ; self . index . checkpoint ( ) ? ; Ok ( ( ) ) }
insert many values in one transaction (with only one fsync)
insert many values in one transaction ( with only one fsync )
&self
iter
impl IntoIterator<Item = (K, B)>
&self
iter
impl IntoIterator<Item = (K, B)>