Create build system (#1)
This commit is contained in:
@@ -158,6 +158,14 @@ impl HeaderValue {
|
||||
self.inner.push(val);
|
||||
}
|
||||
|
||||
/// Create a new unchecked value.
|
||||
/// This is faster, but can cause protocol violation.
|
||||
/// Please avoid putting unchecked content here.
|
||||
#[inline]
|
||||
pub fn new_unchecked(inner: String) -> Self {
|
||||
Self { inner: vec![inner] }
|
||||
}
|
||||
|
||||
/// Query the first entry for this header key.
|
||||
///
|
||||
/// See the documentation of [`HeaderValue`] for more information.
|
||||
|
@@ -1,3 +1,5 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
pub mod settings;
|
||||
|
||||
mod io;
|
||||
|
@@ -322,6 +322,28 @@ pub enum Request<'a, T> {
|
||||
WithChunkedBody((RequestHead, Incoming<'a, ChunkedIn<'a, PrependableStream<T>>>)),
|
||||
}
|
||||
|
||||
impl<T> Response<'_, T> {
|
||||
#[inline]
|
||||
pub fn head(&self) -> &ResponseHead {
|
||||
match self {
|
||||
Self::HeadersOnly(h) => h,
|
||||
Self::WithSizedBody((h, _)) => h,
|
||||
Self::WithChunkedBody((h, _)) => h,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Request<'_, T> {
|
||||
#[inline]
|
||||
pub fn head(&self) -> &RequestHead {
|
||||
match self {
|
||||
Self::HeadersOnly(h) => h,
|
||||
Self::WithSizedBody((h, _)) => h,
|
||||
Self::WithChunkedBody((h, _)) => h,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn get_outgoing_req_content_length(head: &RequestHead) -> Result<Option<usize>, ClientSendError> {
|
||||
let Some(l) = head.headers.get(&HeaderKey::CONTENT_LENGTH) else {
|
||||
return Ok(None);
|
||||
|
Reference in New Issue
Block a user