/// Adds additional repetitions of the provided value to the encoded data.
/// It is the caller's responsibility to ensure that the dictionary remains
/// sorted. `push_additional` will panic if that invariant is broken.
Adds additional repetitions of the provided value to the encoded data.
It is the caller's responsibility to ensure that the dictionary remains
sorted. `push_additional` will panic if that invariant is broken.
Adds additional repetitions of the provided value to the encoded data . It is the caller ' s responsibility to ensure that the dictionary remains sorted . ` push_additional ` will panic if that invariant is broken .
pub fn push_additional(&mut self, v: Option<String>, additional: u32) {
        if v.is_none() {
            self.contains_null = true;
            self.push_encoded_values(NULL_ID, additional);
            return;
        }
        match self.encoded_id(v.as_deref()) {
            Ok(id) => self.push_encoded_values(id, additional),
            Err(idx) => {
                // check this value can be inserted into the dictionary whilst
                // maintaining order.
                assert_eq!(
                    idx,
                    self.entries.len() as u32,
                    "out of order insertion for {:?}",
                    v
                );
                self.entries.push(v);
                self.push_encoded_values(idx, additional);
            }
        }
    }
pub fn push_additional ( & mut self , v : Option < String > , additional : u32 ) { if v . is_none ( ) { self . contains_null = true ; self . push_encoded_values ( NULL_ID , additional ) ; return ; } match self . encoded_id ( v . as_deref ( ) ) { Ok ( id ) => self . push_encoded_values ( id , additional ) , Err ( idx ) => { // check this value can be inserted into the dictionary whilst // maintaining order. assert_eq ! ( idx self entries len ( ) as u32 " " v ) ; self . entries . push ( v ) ; self . push_encoded_values ( idx , additional ) ; } } }
Adds additional repetitions of the provided value to the encoded data.
Adds additional repetitions of the provided value to the encoded data .
&mut self
v
Option<String>
additional
u32