pub struct Request<'a> {
pub if_none_match: Option<&'a str>,
pub if_modified_since: Option<&'a str>,
pub cache_control: Option<&'a str>,
}Expand description
The request-side headers that drive a freshness check.
Build one with Request::new and the chainable setters, or construct it directly
(all fields are public). A field left None — or set to an empty string — is treated
as absent, mirroring the npm package’s falsy-header handling.
use http_fresh::Request;
let req = Request::new()
.if_none_match("\"v1\"")
.cache_control("max-age=0");
assert_eq!(req.if_none_match, Some("\"v1\""));Fields§
§if_none_match: Option<&'a str>The If-None-Match header value (an ETag list or *).
if_modified_since: Option<&'a str>The If-Modified-Since header value (an HTTP date).
cache_control: Option<&'a str>The Cache-Control header value.
Implementations§
Source§impl<'a> Request<'a>
impl<'a> Request<'a>
Sourcepub fn if_none_match(self, value: &'a str) -> Self
pub fn if_none_match(self, value: &'a str) -> Self
Set the If-None-Match header.
Sourcepub fn if_modified_since(self, value: &'a str) -> Self
pub fn if_modified_since(self, value: &'a str) -> Self
Set the If-Modified-Since header.
Sourcepub fn cache_control(self, value: &'a str) -> Self
pub fn cache_control(self, value: &'a str) -> Self
Set the Cache-Control header.
Trait Implementations§
impl<'a> Copy for Request<'a>
impl<'a> Eq for Request<'a>
Source§impl<'a> PartialEq for Request<'a>
impl<'a> PartialEq for Request<'a>
impl<'a> StructuralPartialEq for Request<'a>
Auto Trait Implementations§
impl<'a> Freeze for Request<'a>
impl<'a> RefUnwindSafe for Request<'a>
impl<'a> Send for Request<'a>
impl<'a> Sync for Request<'a>
impl<'a> Unpin for Request<'a>
impl<'a> UnsafeUnpin for Request<'a>
impl<'a> UnwindSafe for Request<'a>
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