MCPcopy Create free account
hub / github.com/RustCrypto/formats / decode

Method decode

der/src/document.rs:152–161  ·  view source on GitHub ↗
(reader: &mut R)

Source from the content-addressed store, hash-verified

150
151impl<'a> Decode<'a> for Document {
152 fn decode<R: Reader<'a>>(reader: &mut R) -> Result<Document> {
153 let header = reader.peek_header()?;
154 let length = (header.encoded_len()? + header.length)?;
155 let bytes = reader.read_slice(length)?;
156
157 Ok(Self {
158 der_bytes: bytes.into(),
159 length,
160 })
161 }
162}
163
164impl Encode for Document {

Callers

nothing calls this directly

Calls 3

peek_headerMethod · 0.45
encoded_lenMethod · 0.45
read_sliceMethod · 0.45

Tested by

no test coverage detected