pub struct GmailSend<T> { /* private fields */ }Expand description
I/O-free coroutine sending one authorized HTTP request and parsing
the JSON response into T.
Implementations§
Source§impl<T: DeserializeOwned> GmailSend<T>
impl<T: DeserializeOwned> GmailSend<T>
Sourcepub fn get(auth: &HttpAuthBearer, url: Url) -> Self
pub fn get(auth: &HttpAuthBearer, url: Url) -> Self
Builds a GET request against the given URL.
Sourcepub fn delete(auth: &HttpAuthBearer, url: Url) -> Self
pub fn delete(auth: &HttpAuthBearer, url: Url) -> Self
Builds a DELETE request against the given URL.
Sourcepub fn post_json<B: Serialize>(
auth: &HttpAuthBearer,
url: Url,
body: &B,
) -> Result<Self, GmailSendError>
pub fn post_json<B: Serialize>( auth: &HttpAuthBearer, url: Url, body: &B, ) -> Result<Self, GmailSendError>
Builds a POST request with the given value as JSON body.
Sourcepub fn put_json<B: Serialize>(
auth: &HttpAuthBearer,
url: Url,
body: &B,
) -> Result<Self, GmailSendError>
pub fn put_json<B: Serialize>( auth: &HttpAuthBearer, url: Url, body: &B, ) -> Result<Self, GmailSendError>
Builds a PUT request with the given value as JSON body.
Sourcepub fn patch_json<B: Serialize>(
auth: &HttpAuthBearer,
url: Url,
body: &B,
) -> Result<Self, GmailSendError>
pub fn patch_json<B: Serialize>( auth: &HttpAuthBearer, url: Url, body: &B, ) -> Result<Self, GmailSendError>
Builds a PATCH request with the given value as JSON body.
Sourcepub fn with_method(
auth: &HttpAuthBearer,
method: &str,
url: Url,
content_type: Option<&str>,
body: Vec<u8>,
) -> Self
pub fn with_method( auth: &HttpAuthBearer, method: &str, url: Url, content_type: Option<&str>, body: Vec<u8>, ) -> Self
Builds a request with an arbitrary method, content type and body.
Trait Implementations§
Source§impl<T: DeserializeOwned> GmailCoroutine for GmailSend<T>
impl<T: DeserializeOwned> GmailCoroutine for GmailSend<T>
Source§type Yield = GmailYield
type Yield = GmailYield
The I/O request type yielded while the exchange is in progress.
Source§type Return = Result<GmailSendOutput<T>, GmailSendError>
type Return = Result<GmailSendOutput<T>, GmailSendError>
The terminal value type produced when the exchange completes.
Auto Trait Implementations§
impl<T> Freeze for GmailSend<T>
impl<T> RefUnwindSafe for GmailSend<T>where
T: RefUnwindSafe,
impl<T> Send for GmailSend<T>where
T: Send,
impl<T> Sync for GmailSend<T>where
T: Sync,
impl<T> Unpin for GmailSend<T>where
T: Unpin,
impl<T> UnsafeUnpin for GmailSend<T>
impl<T> UnwindSafe for GmailSend<T>where
T: UnwindSafe,
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