pub fn read_one_from_slice(input: &[u8]) -> Result<Option<(Item, &[u8])>, Error>
Expand description

Extract and decode the next 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((Item::..., remainder))) where remainder is the part of the input that follows the returned section