/// Encode this struct into it's [persistent message encoding].
///
/// [persistent message encoding]: https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0120_standalone_use_of_fidl_wire_format
Encode this struct into it's [persistent message encoding].
Encode this struct into it ' s [ persistent message encoding ] .
pub fn encode_persistent(&self) -> Vec<u8> {
        // TODO(https://fxbug.dev/86328) we should have our own implementation of this header
        let mut header = create_persistent_header();
        let mut buf = encode_persistent_header(&mut header).unwrap();
        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.
            Field::UInt8(0).encode_inline(&mut buf);
        } else {
            // encode primary objects first
            for field in &self.fields {
                field.encode_inline(&mut 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);
        buf
    }
pub fn encode_persistent ( & self ) -> Vec < u8 > { // TODO(https://fxbug.dev/86328) we should have our own implementation of this header let mut header = create_persistent_header ( ) ; let mut buf = encode_persistent_header ( & mut header ) . unwrap ( ) ; 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. Field :: UInt8 ( 0 ) . encode_inline ( & mut buf ) ; } else { // encode primary objects first for field in & self . fields { field . encode_inline ( & mut 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 ) ; buf }
Encode this struct into it's [persistent message encoding].
Encode this struct into it ' s [ persistent message encoding ] .
&self