Struct nadeo_api::request::request_builder::NadeoRequestBuilder
source · pub struct NadeoRequestBuilder { /* private fields */ }Expand description
Used for creating NadeoRequests.
The URL, HttpMethod and AuthType must be provided to successfully build a request.
Implementations§
source§impl NadeoRequestBuilder
impl NadeoRequestBuilder
pub fn url(self, url: &str) -> Self
pub fn method(self, method: HttpMethod) -> Self
pub fn auth_type(self, auth_type: AuthType) -> Self
sourcepub fn add_header<K>(self, key: K, val: &str) -> Selfwhere
K: IntoHeaderName,
pub fn add_header<K>(self, key: K, val: &str) -> Selfwhere
K: IntoHeaderName,
Adds a header to the request. Adding a header should not be required in most cases.
§Panics
Panics if there is an error parsing the value.
sourcepub fn build(self) -> Result<NadeoRequest>
pub fn build(self) -> Result<NadeoRequest>
Converts the NadeoRequestBuilder into a NadeoRequest.
The URL, HttpMethod and AuthType are required for a request.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NadeoRequestBuilder
impl RefUnwindSafe for NadeoRequestBuilder
impl Send for NadeoRequestBuilder
impl Sync for NadeoRequestBuilder
impl Unpin for NadeoRequestBuilder
impl UnwindSafe for NadeoRequestBuilder
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