Struct graph_http::GraphRequest
source · [−]pub struct GraphRequest<Client, Body, Form> {
pub url: GraphUrl,
pub method: Method,
pub body: Option<Body>,
pub headers: HeaderMap<HeaderValue>,
pub upload_session_file: Option<PathBuf>,
pub download_dir: Option<PathBuf>,
pub form: Option<Form>,
pub req_type: RequestType,
pub timeout: Duration,
/* private fields */
}
Fields
url: GraphUrl
method: Method
body: Option<Body>
headers: HeaderMap<HeaderValue>
upload_session_file: Option<PathBuf>
download_dir: Option<PathBuf>
form: Option<Form>
req_type: RequestType
timeout: Duration
Implementations
sourceimpl GraphRequest<Client, Body, Form>
impl GraphRequest<Client, Body, Form>
pub fn new_async(url: GraphUrl) -> GraphRequest<Client, Body, Form>
pub fn inner_client(&mut self) -> &mut Client
pub fn download(&mut self) -> AsyncDownload
pub async fn upload_session(
&mut self
) -> GraphResult<UploadSessionClient<AsyncHttpClient>>
pub fn build_upload_session(&mut self) -> (Option<PathBuf>, RequestBuilder)
pub fn build(&mut self) -> RequestBuilder
sourcepub async fn response(&mut self) -> GraphResult<Response>
pub async fn response(&mut self) -> GraphResult<Response>
Builds the request and sends it.
Requests that require a redirect are automatic so we don’t need to do anything special for these requests.
sourcepub async fn execute<T>(&mut self) -> GraphResult<GraphResponse<T>> where
for<'de> T: Deserialize<'de>,
pub async fn execute<T>(&mut self) -> GraphResult<GraphResponse<T>> where
for<'de> T: Deserialize<'de>,
Builds the requests and sends it, converting to a GraphResponse and deserializing the body.
pub fn clone(&mut self) -> Self
sourceimpl GraphRequest<Client, Body, Form>
impl GraphRequest<Client, Body, Form>
pub fn new_blocking(url: GraphUrl) -> BlockingClient
pub fn inner_client(&mut self) -> &mut Client
pub fn download(&mut self) -> BlockingDownload
pub fn upload_session(
&mut self
) -> GraphResult<UploadSessionClient<BlockingHttpClient>>
pub fn build_upload_session(&mut self) -> (Option<PathBuf>, RequestBuilder)
pub fn build(&mut self) -> RequestBuilder
sourcepub fn response(&mut self) -> GraphResult<Response>
pub fn response(&mut self) -> GraphResult<Response>
Builds the request and sends it.
Requests that require a redirect are automatic so we don’t need to do anything special for these requests.
sourcepub fn execute<T>(&mut self) -> GraphResult<GraphResponse<T>> where
for<'de> T: Deserialize<'de>,
pub fn execute<T>(&mut self) -> GraphResult<GraphResponse<T>> where
for<'de> T: Deserialize<'de>,
Builds the requests and sends it, converting to a GraphResponse and deserializing the body.
pub fn clone(&mut self) -> Self
Trait Implementations
sourceimpl<Client, Body, Form> AsMut<GraphUrl> for GraphRequest<Client, Body, Form>
impl<Client, Body, Form> AsMut<GraphUrl> for GraphRequest<Client, Body, Form>
sourceimpl<Client, Body, Form> AsRef<GraphUrl> for GraphRequest<Client, Body, Form>
impl<Client, Body, Form> AsRef<GraphUrl> for GraphRequest<Client, Body, Form>
sourceimpl<Client, Body, Form> Debug for GraphRequest<Client, Body, Form>
impl<Client, Body, Form> Debug for GraphRequest<Client, Body, Form>
sourceimpl From<GraphRequest<Client, Body, Form>> for AsyncHttpClient
impl From<GraphRequest<Client, Body, Form>> for AsyncHttpClient
sourceimpl From<GraphRequest<Client, Body, Form>> for HttpClient<RefCell<BlockingClient>>
impl From<GraphRequest<Client, Body, Form>> for HttpClient<RefCell<BlockingClient>>
sourcefn from(client: BlockingClient) -> Self
fn from(client: BlockingClient) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl<Client, Body, Form> !RefUnwindSafe for GraphRequest<Client, Body, Form>
impl<Client, Body, Form> Send for GraphRequest<Client, Body, Form> where
Body: Send,
Client: Send,
Form: Send,
impl<Client, Body, Form> Sync for GraphRequest<Client, Body, Form> where
Body: Sync,
Client: Sync,
Form: Sync,
impl<Client, Body, Form> Unpin for GraphRequest<Client, Body, Form> where
Body: Unpin,
Client: Unpin,
Form: Unpin,
impl<Client, Body, Form> !UnwindSafe for GraphRequest<Client, Body, Form>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more