pub fn string_to_u64(
        &mut self,
        name: &str,
        map: &BTreeMap<String, u64>,
    ) -> Result<()> {
        self.header()?;
        self.separator()?;

        let name = rust_const_name(name);
        if self.opts.fst_dir.is_some() {
            let mut builder = MapBuilder::memory();
            for (k, &v) in map {
                builder.insert(k.as_bytes(), v)?;
            }
            let map = builder.into_map();
            self.fst(&name, map.as_fst(), true)?;
        } else {
            let table: Vec<(&str, u64)> =
                map.iter().map(|(k, &v)| (&**k, v)).collect();
            self.string_to_u64_slice(&name, &table)?;
        }
        self.wtr.flush()?;
        Ok(())
    }
/// Write a map that associates strings to `u64` values.
Write a map that associates strings to `u64` values.
Write a map that associates strings to ` u64 ` values .
pub fn string_to_u64(
        &mut self,
        name: &str,
        map: &BTreeMap<String, u64>,
    ) -> Result<()> {
        self.header()?;
        self.separator()?;
        let name = rust_const_name(name);
        if self.opts.fst_dir.is_some() {
            let mut builder = MapBuilder::memory();
            for (k, &v) in map {
                builder.insert(k.as_bytes(), v)?;
            }
            let map = builder.into_map();
            self.fst(&name, map.as_fst(), true)?;
        } else {
            let table: Vec<(&str, u64)> =
                map.iter().map(|(k, &v)| (&**k, v)).collect();
            self.string_to_u64_slice(&name, &table)?;
        }
        self.wtr.flush()?;
        Ok(())
    }
pub fn string_to_u64 ( & mut self , name : & str , map : & BTreeMap < String , u64 > , ) -> Result < ( ) > { self . header ( ) ? ; self . separator ( ) ? ; let name = rust_const_name ( name ) ; if self . opts . fst_dir . is_some ( ) { let mut builder = MapBuilder :: memory ( ) ; for ( k , & v ) in map { builder . insert ( k . as_bytes ( ) , v ) ? ; } let map = builder . into_map ( ) ; self . fst ( & name , map . as_fst ( ) , true ) ? ; } else { let table : Vec < ( & str , u64 ) > = map . iter ( ) . map ( | ( k , & v ) | ( & * * k , v ) ) . collect ( ) ; self . string_to_u64_slice ( & name , & table ) ? ; } self . wtr . flush ( ) ? ; Ok ( ( ) ) }
Write a map that associates strings to `u64` values.
Write a map that associates strings to ` u64 ` values .
&mut self
name
&str
map
&BTreeMap<String, u64>
&mut self
name
&str
map
&BTreeMap<String, u64>