Encode this value to the provided byte slice, returning a sub-slice containing the encoded message.
(&self, buf: &'a mut [u8])
| 29 | /// Encode this value to the provided byte slice, returning a sub-slice |
| 30 | /// containing the encoded message. |
| 31 | fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]> { |
| 32 | let mut writer = SliceWriter::new(buf); |
| 33 | self.encode(&mut writer)?; |
| 34 | writer.finish() |
| 35 | } |
| 36 | |
| 37 | /// Encode this message as ASN.1 DER, appending it to the provided |
| 38 | /// byte vector. |