pub struct Request {
pub method: Method,
pub url: String,
pub headers: Vec<(String, String)>,
pub body: Vec<u8>,
}Fields§
§method: Method§url: String§headers: Vec<(String, String)>§body: Vec<u8>Implementations§
Source§impl Request
impl Request
pub fn get(url: impl Into<String>) -> Request
Sourcepub fn post_json(url: impl Into<String>, body: String) -> Request
pub fn post_json(url: impl Into<String>, body: String) -> Request
A JSON body, posted as application/json.
Sourcepub fn with_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Request
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Request
The same request with one more header.
Sourcepub fn header(&self, name: &str) -> Option<&str>
pub fn header(&self, name: &str) -> Option<&str>
A header’s value, its name matched whatever its case.
Sourcepub fn is_signed(&self) -> bool
pub fn is_signed(&self) -> bool
Whether it carries a signature: a post to /exchange, or a raw HyperEVM transaction.
Sourcepub fn refuse_if_offline(&self) -> Result<(), TransportError>
pub fn refuse_if_offline(&self) -> Result<(), TransportError>
TransportError::Offline for a signed request in an offline build; otherwise nothing.
Trait Implementations§
impl Eq for Request
impl StructuralPartialEq for Request
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl UnwindSafe for Request
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.