pub struct Request<'a> { /* private fields */ }Expand description
Fluent request builder. Terminal: send().
Implementations§
Source§impl Request<'_>
impl Request<'_>
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn bearer(self, token: impl AsRef<str>) -> Self
pub fn json<T: Serialize>(self, value: &T) -> Self
pub fn body_bytes(self, bytes: Vec<u8>) -> Self
pub fn timeout_ms(self, ms: u64) -> Self
pub fn send(self) -> Result<Response, String>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Request<'a>
impl<'a> !Send for Request<'a>
impl<'a> !Sync for Request<'a>
impl<'a> !UnwindSafe for Request<'a>
impl<'a> Freeze for Request<'a>
impl<'a> Unpin for Request<'a>
impl<'a> UnsafeUnpin 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