rustls_pki_types::pem

Function from_buf

source
pub fn from_buf(
    rd: &mut dyn BufRead,
) -> Result<Option<(SectionKind, Vec<u8>)>, Error>
Available on crate features alloc and std only.
Expand description

Extract and decode the next supported PEM section from rd.

  • Ok(None) is returned if there is no PEM section read from rd.
  • Underlying IO errors produce a Err(...)
  • Otherwise each decoded section is returned with a Ok(Some(...))