pub fn codepoint_to_string(
        &mut self,
        name: &str,
        map: &BTreeMap<u32, String>,
    ) -> 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 {
                let v = pack_str(v)?;
                builder.insert(u32_key(k), v)?;
            }
            let map = builder.into_map();
            self.fst(&name, map.as_fst(), true)?;
        } else {
            let table: Vec<(u32, &str)> =
                map.iter().map(|(&k, v)| (k, &**v)).collect();
            self.codepoint_to_string_slice(&name, &table)?;
        }
        self.wtr.flush()?;
        Ok(())
    }
/// Write a map that associates codepoints to strings.
///
/// When the output format is an FST, then the FST map emitted is from
/// codepoint to u64, where the string is encoded into the u64. The least
/// significant byte of the u64 corresponds to the first byte in the
/// string. The end of a string is delimited by the zero byte. If a string
/// is more than 8 bytes or contains a `NUL` byte, then an error is
/// returned.
Write a map that associates codepoints to strings.
When the output format is an FST, then the FST map emitted is from
codepoint to u64, where the string is encoded into the u64. The least
significant byte of the u64 corresponds to the first byte in the
string. The end of a string is delimited by the zero byte. If a string
is more than 8 bytes or contains a `NUL` byte, then an error is
returned.
Write a map that associates codepoints to strings . When the output format is an FST then the FST map emitted is from codepoint to u64 where the string is encoded into the u64 . The least significant byte of the u64 corresponds to the first byte in the string . The end of a string is delimited by the zero byte . If a string is more than 8 bytes or contains a ` NUL ` byte then an error is returned .
pub fn codepoint_to_string(
        &mut self,
        name: &str,
        map: &BTreeMap<u32, String>,
    ) -> 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 {
                let v = pack_str(v)?;
                builder.insert(u32_key(k), v)?;
            }
            let map = builder.into_map();
            self.fst(&name, map.as_fst(), true)?;
        } else {
            let table: Vec<(u32, &str)> =
                map.iter().map(|(&k, v)| (k, &**v)).collect();
            self.codepoint_to_string_slice(&name, &table)?;
        }
        self.wtr.flush()?;
        Ok(())
    }
pub fn codepoint_to_string ( & mut self , name : & str , map : & BTreeMap < u32 , String > , ) -> 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 { let v = pack_str ( v ) ? ; builder . insert ( u32_key ( k ) , v ) ? ; } let map = builder . into_map ( ) ; self . fst ( & name , map . as_fst ( ) , true ) ? ; } else { let table : Vec < ( u32 , & str ) > = map . iter ( ) . map ( | ( & k , v ) | ( k , & * * v ) ) . collect ( ) ; self . codepoint_to_string_slice ( & name , & table ) ? ; } self . wtr . flush ( ) ? ; Ok ( ( ) ) }
Write a map that associates codepoints to strings.
Write a map that associates codepoints to strings .
&mut self
name
&str
map
&BTreeMap<u32, String>
&mut self
name
&str
map
&BTreeMap<u32, String>