fn header(&self) -> Result<Vec<u8>, Error> {
        let schema_bytes = serde_json::to_string(self.schema)?.into_bytes();

        let mut metadata = HashMap::with_capacity(2);
        metadata.insert("avro.schema", Value::Bytes(schema_bytes));
        metadata.insert("avro.codec", self.codec.avro());

        let mut header = Vec::new();
        header.extend_from_slice(AVRO_OBJECT_HEADER);
        encode(
            &metadata.avro(),
            &Schema::Map(Box::new(Schema::Bytes)),
            &mut header,
        );
        header.extend_from_slice(&self.marker);

        Ok(header)
    }
/// Create an Avro header based on schema, codec and sync marker.
Create an Avro header based on schema, codec and sync marker.
Create an Avro header based on schema codec and sync marker .
fn header(&self) -> Result<Vec<u8>, Error> {
        let schema_bytes = serde_json::to_string(self.schema)?.into_bytes();
        let mut metadata = HashMap::with_capacity(2);
        metadata.insert("avro.schema", Value::Bytes(schema_bytes));
        metadata.insert("avro.codec", self.codec.avro());
        let mut header = Vec::new();
        header.extend_from_slice(AVRO_OBJECT_HEADER);
        encode(
            &metadata.avro(),
            &Schema::Map(Box::new(Schema::Bytes)),
            &mut header,
        );
        header.extend_from_slice(&self.marker);
        Ok(header)
    }
fn header ( & self ) -> Result < Vec < u8 > , Error > { let schema_bytes = serde_json :: to_string ( self . schema ) ? . into_bytes ( ) ; let mut metadata = HashMap :: with_capacity ( 2 ) ; metadata . insert ( " " , Value :: Bytes ( schema_bytes ) ) ; metadata . insert ( " " , self . codec . avro ( ) ) ; let mut header = Vec :: new ( ) ; header . extend_from_slice ( AVRO_OBJECT_HEADER ) ; encode ( & metadata . avro ( ) , & Schema :: Map ( Box :: new ( Schema :: Bytes ) ) , & mut header , ) ; header . extend_from_slice ( & self . marker ) ; Ok ( header ) }
Create an Avro header based on schema, codec and sync marker.
Create an Avro header based on schema codec and sync marker .
&self