Encode the frame into a byte vector.
(&self)
| 197 | |
| 198 | /// Encode the frame into a byte vector. |
| 199 | pub fn encode(&self) -> Vec<u8> { |
| 200 | let mut encoded = Vec::with_capacity(self.encoded_len()); |
| 201 | self.encode_into(&mut encoded); |
| 202 | encoded |
| 203 | } |
| 204 | |
| 205 | /// Returns the encoded length of the frame. |
| 206 | pub const fn encoded_len(&self) -> usize { |