pub struct SdkRequest {
pub body: Option<Vec<u8>>,
pub requires_auth: bool,
pub headers: BTreeMap<String, String>,
pub method: String,
pub path: String,
}Expand description
Canonical SDK request passed to a transport implementation.
§Type Safety
The builder pattern ensures required fields are set at compile time.
Use SdkRequest::builder() to construct requests with guaranteed validity.
Fields§
§body: Option<Vec<u8>>Raw request body bytes.
requires_auth: boolWhether the request requires bearer authentication.
headers: BTreeMap<String, String>Header values to attach to the outgoing request.
method: StringHTTP method to execute.
path: StringAbsolute or relative path for the request.
Implementations§
Source§impl SdkRequest
impl SdkRequest
Sourcepub fn builder(
method: impl Into<String>,
path: impl Into<String>,
) -> SdkRequestBuilder<MethodSet, PathSet>
pub fn builder( method: impl Into<String>, path: impl Into<String>, ) -> SdkRequestBuilder<MethodSet, PathSet>
Create a typed builder for constructing requests.
§Examples
use ferriskey_sdk::SdkRequest;
let request = SdkRequest::builder("GET", "/api/users")
.header("accept", "application/json")
.auth_required(true)
.build();Trait Implementations§
Source§impl Clone for SdkRequest
impl Clone for SdkRequest
Source§fn clone(&self) -> SdkRequest
fn clone(&self) -> SdkRequest
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 SdkRequest
impl Debug for SdkRequest
Source§impl PartialEq for SdkRequest
impl PartialEq for SdkRequest
Source§impl Service<SdkRequest> for HpxTransport
Implement tower::Service for HpxTransport.
impl Service<SdkRequest> for HpxTransport
Implement tower::Service for HpxTransport.
This makes HpxTransport composable with any tower middleware.
Source§type Response = SdkResponse
type Response = SdkResponse
Responses given by the service.
Source§type Error = TransportError
type Error = TransportError
Errors produced by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<SdkResponse, TransportError>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<SdkResponse, TransportError>> + Send>>
The future response value.
impl Eq for SdkRequest
impl StructuralPartialEq for SdkRequest
Auto Trait Implementations§
impl Freeze for SdkRequest
impl RefUnwindSafe for SdkRequest
impl Send for SdkRequest
impl Sync for SdkRequest
impl Unpin for SdkRequest
impl UnsafeUnpin for SdkRequest
impl UnwindSafe for SdkRequest
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
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.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
Compares
self with key and returns true if they are equal.