pub fn encode(&self, buf: &mut Vec<u8>) {
        // encode the struct's fields:
        if self.fields.is_empty() {
            // A structure can be:
            //
            // * empty — it has no fields. Such a structure is 1 byte in size, with an alignment of
            // 1 byte, and is exactly equivalent to a structure containing a uint8 with the value
            // zero.
            BasicField::UInt8(0).encode_inline(buf);
        } else {
            // encode primary objects first
            for field in &self.fields {
                field.encode_inline(buf);
            }

            for field in &self.fields {
                field.encode_out_of_line(buf);
            }
        }

        // Externally, the structure is aligned on an 8-byte boundary, and may therefore contain
        // final padding to meet that requirement.
        buf.pad_to(8);
    }
/// Encode this struct without any header.
Encode this struct without any header.
Encode this struct without any header .
pub fn encode(&self, buf: &mut Vec<u8>) {
        // encode the struct's fields:
        if self.fields.is_empty() {
            // A structure can be:
            //
            // * empty — it has no fields. Such a structure is 1 byte in size, with an alignment of
            // 1 byte, and is exactly equivalent to a structure containing a uint8 with the value
            // zero.
            BasicField::UInt8(0).encode_inline(buf);
        } else {
            // encode primary objects first
            for field in &self.fields {
                field.encode_inline(buf);
            }
            for field in &self.fields {
                field.encode_out_of_line(buf);
            }
        }
        // Externally, the structure is aligned on an 8-byte boundary, and may therefore contain
        // final padding to meet that requirement.
        buf.pad_to(8);
    }
pub fn encode ( & self , buf : & mut Vec < u8 > ) { // encode the struct's fields: if self . fields . is_empty ( ) { // A structure can be: // // * empty — it has no fields. Such a structure is 1 byte in size, with an alignment of // 1 byte, and is exactly equivalent to a structure containing a uint8 with the value // zero. BasicField :: UInt8 ( 0 ) . encode_inline ( buf ) ; } else { // encode primary objects first for field in & self . fields { field . encode_inline ( buf ) ; } for field in & self . fields { field . encode_out_of_line ( buf ) ; } } // Externally, the structure is aligned on an 8-byte boundary, and may therefore contain // final padding to meet that requirement. buf . pad_to ( 8 ) ; }
Encode this struct without any header.
Encode this struct without any header .
&self
buf
&mut Vec<u8>
&self
buf
&mut Vec<u8>