rustls_pki_types::pem

Function from_slice

source
fn from_slice(
    input: &[u8],
) -> Result<Option<((SectionKind, Vec<u8>), &[u8])>, Error>
Expand description

Extract and decode the next supported PEM section from input

  • Ok(None) is returned if there is no PEM section to read from input
  • Syntax errors and decoding errors produce a Err(...)
  • Otherwise each decoded section is returned with a Ok(Some((..., remainder))) where remainder is the part of the input that follows the returned section