#[non_exhaustive]pub struct FetchResponse {
pub status: u16,
pub location: Option<String>,
pub cache_control: Option<String>,
pub body: Vec<u8>,
}Expand description
What one GET answered.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.status: u16The HTTP status.
location: Option<String>The Location header, for a redirect.
cache_control: Option<String>The Cache-Control header.
body: Vec<u8>The body, no longer than MAX_JWKS_BYTES.
Implementations§
Source§impl FetchResponse
impl FetchResponse
Sourcepub fn new(status: u16, body: Vec<u8>) -> Self
pub fn new(status: u16, body: Vec<u8>) -> Self
A response with this status and body, and no headers.
Sourcepub fn with_location(self, location: Option<String>) -> Self
pub fn with_location(self, location: Option<String>) -> Self
With a Location header.
Sourcepub fn with_cache_control(self, cache_control: Option<String>) -> Self
pub fn with_cache_control(self, cache_control: Option<String>) -> Self
With a Cache-Control header.
Trait Implementations§
Source§impl Clone for FetchResponse
impl Clone for FetchResponse
Auto Trait Implementations§
impl Freeze for FetchResponse
impl RefUnwindSafe for FetchResponse
impl Send for FetchResponse
impl Sync for FetchResponse
impl Unpin for FetchResponse
impl UnsafeUnpin for FetchResponse
impl UnwindSafe for FetchResponse
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