pub struct RequestBuilder<'a, C, R>where
C: HttpClient,
R: OutgoingRequest,{ /* private fields */ }
Expand description
A builder for a request to the Matrix homeserver.
Implementations§
Source§impl<'a, C, R> RequestBuilder<'a, C, R>where
C: HttpClient,
R: OutgoingRequest,
impl<'a, C, R> RequestBuilder<'a, C, R>where
C: HttpClient,
R: OutgoingRequest,
Sourcepub fn new(client: &'a Client<C>, request: R) -> Self
pub fn new(client: &'a Client<C>, request: R) -> Self
Create a new RequestBuilder
, with the given Client
and the given request
.
Sourcepub fn user_id(&mut self, user_id: &UserId) -> &mut Self
pub fn user_id(&mut self, user_id: &UserId) -> &mut Self
Set the user_id
url parameter, returning the current builder to allow method chaining.
Sourcepub fn timestamp(&mut self, timestamp: i64) -> &mut Self
pub fn timestamp(&mut self, timestamp: i64) -> &mut Self
Set the ts
url parameter, returning the current builder to allow method chaining.
Sourcepub fn access_token(&mut self, access_token: String) -> &mut Self
pub fn access_token(&mut self, access_token: String) -> &mut Self
Set the access_token
url parameter, returning the current builder to allow method
chaining.
Sourcepub async fn request(self) -> ResponseResult<C, R>
pub async fn request(self) -> ResponseResult<C, R>
Submit the request, waiting on the response. This will consume the current builder.
Trait Implementations§
Source§impl<'a, C, R> Clone for RequestBuilder<'a, C, R>
impl<'a, C, R> Clone for RequestBuilder<'a, C, R>
Source§fn clone(&self) -> RequestBuilder<'a, C, R>
fn clone(&self) -> RequestBuilder<'a, C, R>
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<'a, C, R> Debug for RequestBuilder<'a, C, R>
impl<'a, C, R> Debug for RequestBuilder<'a, C, R>
Auto Trait Implementations§
impl<'a, C, R> Freeze for RequestBuilder<'a, C, R>where
R: Freeze,
impl<'a, C, R> RefUnwindSafe for RequestBuilder<'a, C, R>where
R: RefUnwindSafe,
C: RefUnwindSafe,
impl<'a, C, R> Send for RequestBuilder<'a, C, R>
impl<'a, C, R> Sync for RequestBuilder<'a, C, R>
impl<'a, C, R> Unpin for RequestBuilder<'a, C, R>where
R: Unpin,
impl<'a, C, R> UnwindSafe for RequestBuilder<'a, C, R>where
R: UnwindSafe,
C: RefUnwindSafe,
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