Skip to main content

rewrite_html_stream

Function rewrite_html_stream 

Source
pub async fn rewrite_html_stream<S, B, E>(
    stream: S,
    commonmark: bool,
) -> Result<String, StreamConvertError<E>>
where S: Stream<Item = Result<B, E>> + Unpin, B: AsRef<[u8]>,
Expand description

Convert an async stream of HTML byte chunks into markdown.

Genuinely async — yields to the executor while waiting for each input chunk. Accepts any Stream<Item = Result<B, E>> where B: AsRef<[u8]>, so it works with Vec<u8>, bytes::Bytes, &[u8], etc.

§Arguments

  • stream - an async stream of byte chunks (e.g. from an HTTP response body)
  • commonmark - adjust output to CommonMark spec