Skip to main content

scan_inline_yencode

Function scan_inline_yencode 

Source
pub fn scan_inline_yencode(
    raw: &[u8],
    part: &ParsedPart,
) -> Vec<InlineYEncBlock>
Expand description

Scan a MIME part’s body for inline yEnc-encoded blocks.

Slices raw using part.body_range to obtain the body bytes, then finds every =ybegin=yend block within the body, decoding each one via yencoding::decode. Returns one InlineYEncBlock per block found.

§Parameters

  • raw — the full raw message bytes (same buffer passed to parse()).
  • part — a ParsedPart from the parsed tree. Only part.body_range is used.

§Return value

An empty Vec when:

  • the body contains no =ybegin blocks, or
  • part.body_range is out of bounds for raw.

Otherwise one entry per block, in order of appearance.

§Multiple blocks

A single body part may contain more than one yEnc article (though this is unusual in practice). All blocks are decoded and returned.

§Notes

  • Byte offsets in the returned blocks are absolute — relative to the start of raw, matching the coordinate space of part.body_range.
  • No panic on any input.