pub struct JsonRequestBuilder<'a, T> { /* private fields */ }Expand description
A request builder that will send a JSON-serialised body.
Obtained from RequestBuilder::json. Finalise with send
(async) or send_sync (sync).
§Example
// Async PUT
let updated: Item = client
.put("/items/42")
.json(UpdateItem { name: "new name".to_string() })
.send()
.await?;
// Sync PATCH
let patched: Item = client
.patch("/items/42")
.json(UpdateItem { name: "new name".to_string() })
.send_sync()?;Implementations§
Source§impl<'a, T: Serialize> JsonRequestBuilder<'a, T>
impl<'a, T: Serialize> JsonRequestBuilder<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for JsonRequestBuilder<'a, T>where
T: Freeze,
impl<'a, T> !RefUnwindSafe for JsonRequestBuilder<'a, T>
impl<'a, T> Send for JsonRequestBuilder<'a, T>where
T: Send,
impl<'a, T> Sync for JsonRequestBuilder<'a, T>where
T: Sync,
impl<'a, T> Unpin for JsonRequestBuilder<'a, T>where
T: Unpin,
impl<'a, T> UnsafeUnpin for JsonRequestBuilder<'a, T>where
T: UnsafeUnpin,
impl<'a, T> !UnwindSafe for JsonRequestBuilder<'a, T>
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