Trait BuildStrategy

Source
pub trait BuildStrategy {
    // Required method
    fn build<Request>(
        &self,
        request: Request,
        builder: RequestBuilder,
    ) -> Result<Request, SocketError>
       where Request: RestRequest;
}
Expand description

RestRequest build strategy for the API being interacted with.

An API that requires authenticated RestRequests will likely utilise the configurable RequestSigner to sign the requests before building.

An API that requires no authentication may just add mandatory reqwest headers to the RestRequest before building.

Required Methods§

Source

fn build<Request>( &self, request: Request, builder: RequestBuilder, ) -> Result<Request, SocketError>
where Request: RestRequest,

Use a RestRequest and reqwest::RequestBuilder to construct a reqwest::Request that is ready for executing.

It is expected that any signing or performed during this method, or the addition of any reqwest headers.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl BuildStrategy for PublicNoHeaders

Source§

impl<Sig, Hmac, SigEncoder> BuildStrategy for RequestSigner<Sig, Hmac, SigEncoder>
where Sig: Signer, Hmac: Mac + Clone, SigEncoder: Encoder,