pub struct ProviderRequest {
pub url: String,
pub headers: Headers,
pub body: Value,
pub timeout: Option<Duration>,
}Expand description
Opaque provider-specific request.
This type encapsulates all information needed to make an HTTP request to a provider, without committing to a specific HTTP client library.
Headers use Cow<'static, str> to avoid allocations for common headers.
Fields§
§url: StringFull URL to send request to
headers: HeadersHTTP headers (name, value pairs) using Cow to avoid allocations for static strings
body: ValueRequest body (JSON)
timeout: Option<Duration>Optional request timeout override
Implementations§
Source§impl ProviderRequest
impl ProviderRequest
Sourcepub fn with_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Add a header with owned strings.
Sourcepub fn with_static_header(self, name: &'static str, value: &'static str) -> Self
pub fn with_static_header(self, name: &'static str, value: &'static str) -> Self
Add a header with static strings (zero allocation).
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set the timeout.
Trait Implementations§
Source§impl Clone for ProviderRequest
impl Clone for ProviderRequest
Source§fn clone(&self) -> ProviderRequest
fn clone(&self) -> ProviderRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProviderRequest
impl Debug for ProviderRequest
Source§impl<'de> Deserialize<'de> for ProviderRequest
impl<'de> Deserialize<'de> for ProviderRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ProviderRequest
impl PartialEq for ProviderRequest
Source§impl Serialize for ProviderRequest
impl Serialize for ProviderRequest
impl StructuralPartialEq for ProviderRequest
Auto Trait Implementations§
impl Freeze for ProviderRequest
impl RefUnwindSafe for ProviderRequest
impl Send for ProviderRequest
impl Sync for ProviderRequest
impl Unpin for ProviderRequest
impl UnwindSafe for ProviderRequest
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