Struct vertigo::RequestBuilder
source · pub struct RequestBuilder { /* private fields */ }
Expand description
Builder for typed requests.
Implementations§
source§impl RequestBuilder
impl RequestBuilder
pub fn new(method: FetchMethod, url: impl Into<String>) -> Self
pub fn get(url: impl Into<String>) -> Self
pub fn post(url: impl Into<String>) -> Self
pub fn body(self, body: RequestBody) -> Self
pub fn bearer_auth(self, token: impl Into<String>) -> Self
pub fn set_header( self, name: impl Into<String>, value: impl Into<String> ) -> Self
pub fn body_json(self, body: impl JsJsonSerialize) -> Self
pub fn headers(self, headers: HashMap<String, String>) -> Self
pub fn ttl_seconds(self, seconds: u64) -> Self
pub fn ttl_minutes(self, minutes: u64) -> Self
pub fn ttl_hours(self, hours: u64) -> Self
pub fn ttl_days(self, days: u64) -> Self
pub fn get_ttl(&self) -> Option<Duration>
pub async fn call(&self) -> RequestResponse
pub fn lazy_cache<T>( self, map_response: impl Fn(u32, RequestBody) -> Option<Result<T, String>> + 'static ) -> LazyCache<T>
Trait Implementations§
source§impl Clone for RequestBuilder
impl Clone for RequestBuilder
source§fn clone(&self) -> RequestBuilder
fn clone(&self) -> RequestBuilder
Returns a copy 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 moreAuto Trait Implementations§
impl RefUnwindSafe for RequestBuilder
impl Send for RequestBuilder
impl Sync for RequestBuilder
impl Unpin for RequestBuilder
impl UnwindSafe for RequestBuilder
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