pub struct AsyncParser<R> { /* private fields */ }Available on crate feature
async-tokio only.Expand description
An async HTML parser that reads from a tokio::io::AsyncRead source.
§Example
use fhp_tree::async_parser::AsyncParser;
let html = b"<div><p>Hello</p></div>";
let reader = &html[..];
let doc = AsyncParser::new(reader).parse().await?;
assert_eq!(doc.root().text_content(), "Hello");Implementations§
Source§impl<R> AsyncParser<R>
impl<R> AsyncParser<R>
Sourcepub fn new(reader: R) -> AsyncParser<R>
pub fn new(reader: R) -> AsyncParser<R>
Create a new async parser reading from reader.
Sourcepub fn with_buf_size(self, size: usize) -> AsyncParser<R>
pub fn with_buf_size(self, size: usize) -> AsyncParser<R>
Set a custom buffer size for chunk reads.
Auto Trait Implementations§
impl<R> Freeze for AsyncParser<R>where
R: Freeze,
impl<R> RefUnwindSafe for AsyncParser<R>where
R: RefUnwindSafe,
impl<R> Send for AsyncParser<R>where
R: Send,
impl<R> Sync for AsyncParser<R>where
R: Sync,
impl<R> Unpin for AsyncParser<R>where
R: Unpin,
impl<R> UnsafeUnpin for AsyncParser<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for AsyncParser<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more