#[non_exhaustive]pub struct FetchRequest {
pub url: Url,
pub method: Method,
pub headers: HeaderMap,
pub body: Option<Bytes>,
}Expand description
A request, loosely https://fetch.spec.whatwg.org/#requests.
Narrower than Request on purpose: no form bodies,
because a guest that wants a multipart body can encode one, and no abort
signal, because nothing in the current scope cancels. Both are additive
later; see the README.
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.url: Url§method: Method§headers: HeaderMap§body: Option<Bytes>None is distinct from Some(empty): the first sends no body at all,
the second sends a zero-length one with a Content-Length: 0.
Implementations§
Trait Implementations§
Source§impl Clone for FetchRequest
impl Clone for FetchRequest
Auto Trait Implementations§
impl !Freeze for FetchRequest
impl RefUnwindSafe for FetchRequest
impl Send for FetchRequest
impl Sync for FetchRequest
impl Unpin for FetchRequest
impl UnsafeUnpin for FetchRequest
impl UnwindSafe for FetchRequest
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