Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,18 @@ impl<'h, 'b> Response<'h, 'b> {
self.parse_with_config(buf, &ParserConfig::default())
}

/// Try to parse a buffer of bytes into the Response,
/// except use an uninitialized slice of `Header`s.
///
/// For more information, see `parse`
pub fn parse_with_uninit_headers(
&mut self,
buf: &'b [u8],
headers: &'h mut [MaybeUninit<Header<'b>>],
) -> Result<usize> {
self.parse_with_config_and_uninit_headers(buf, &Default::default(), headers)
}

fn parse_with_config(&mut self, buf: &'b [u8], config: &ParserConfig) -> Result<usize> {
let headers = core::mem::replace(&mut self.headers, &mut []);

Expand Down