pub fn serialize(&self, binary: &mut Vec<u8>) -> Result<()> {
        let mut binary_data = BinaryData::from(binary.clone());
        let mut ser = ScriptSerializer::new(VERSION_MAX);
        let mut temp = BinaryData::new();

        ser.common.serialize_common_tables(&mut temp, self)?;
        if temp.len() > TABLE_CONTENT_SIZE_MAX as usize {
            bail!(
                "table content size ({}) cannot exceed ({})",
                temp.len(),
                TABLE_CONTENT_SIZE_MAX
            );
        }
        ser.common.serialize_header(&mut binary_data)?;
        ser.common.serialize_table_indices(&mut binary_data)?;

        binary_data.extend(temp.as_inner())?;

        ser.serialize_main(&mut binary_data, self)?;

        *binary = binary_data.into_inner();
        Ok(())
    }
/// Serializes a `CompiledScript` into a binary. The mutable `Vec<u8>` will contain the
/// binary blob on return.
Serializes a `CompiledScript` into a binary. The mutable `Vec` will contain the
binary blob on return.
Serializes a ` CompiledScript ` into a binary . The mutable ` Vec ` will contain the binary blob on return .
pub fn serialize(&self, binary: &mut Vec<u8>) -> Result<()> {
        let mut binary_data = BinaryData::from(binary.clone());
        let mut ser = ScriptSerializer::new(VERSION_MAX);
        let mut temp = BinaryData::new();
        ser.common.serialize_common_tables(&mut temp, self)?;
        if temp.len() > TABLE_CONTENT_SIZE_MAX as usize {
            bail!(
                "table content size ({}) cannot exceed ({})",
                temp.len(),
                TABLE_CONTENT_SIZE_MAX
            );
        }
        ser.common.serialize_header(&mut binary_data)?;
        ser.common.serialize_table_indices(&mut binary_data)?;
        binary_data.extend(temp.as_inner())?;
        ser.serialize_main(&mut binary_data, self)?;
        *binary = binary_data.into_inner();
        Ok(())
    }
pub fn serialize ( & self , binary : & mut Vec < u8 > ) -> Result < ( ) > { let mut binary_data = BinaryData :: from ( binary . clone ( ) ) ; let mut ser = ScriptSerializer :: new ( VERSION_MAX ) ; let mut temp = BinaryData :: new ( ) ; ser . common . serialize_common_tables ( & mut temp , self ) ? ; if temp . len ( ) > TABLE_CONTENT_SIZE_MAX as usize { bail ! ( " " temp len ( ) TABLE_CONTENT_SIZE_MAX ) ; } ser . common . serialize_header ( & mut binary_data ) ? ; ser . common . serialize_table_indices ( & mut binary_data ) ? ; binary_data . extend ( temp . as_inner ( ) ) ? ; ser . serialize_main ( & mut binary_data , self ) ? ; * binary = binary_data . into_inner ( ) ; Ok ( ( ) ) }
Serializes a `CompiledScript` into a binary.
Serializes a ` CompiledScript ` into a binary .
&self
binary
&mut Vec<u8>