pub fn to_bytes(self) -> Vec<u8> {
        match self {
            Data::Opaque(d) => d,
            _ => {
                let mut buf = Vec::with_capacity(self.serialized_length());
                self.encode(&mut buf);
                buf
            }
        }
    }
/// Converts the Data item into a vector of bytes.
/// Opaque item is converted without extra allocations,
/// non-opaque item is encoded to a newly allocated buffer.
Converts the Data item into a vector of bytes.
Opaque item is converted without extra allocations,
non-opaque item is encoded to a newly allocated buffer.
Converts the Data item into a vector of bytes . Opaque item is converted without extra allocations non - opaque item is encoded to a newly allocated buffer .
pub fn to_bytes(self) -> Vec<u8> {
        match self {
            Data::Opaque(d) => d,
            _ => {
                let mut buf = Vec::with_capacity(self.serialized_length());
                self.encode(&mut buf);
                buf
            }
        }
    }
pub fn to_bytes ( self ) -> Vec < u8 > { match self { Data :: Opaque ( d ) => d , _ => { let mut buf = Vec :: with_capacity ( self . serialized_length ( ) ) ; self . encode ( & mut buf ) ; buf } } }
Converts the Data item into a vector of bytes.
Converts the Data item into a vector of bytes .
self
self