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§

source§

impl GraphRequest<Client, Body, Form>

source

pub fn new_async(url: GraphUrl) -> GraphRequest<Client, Body, Form>

source

pub fn inner_client(&mut self) -> &mut Client

source

pub fn download(&mut self) -> AsyncDownload

source

pub async fn upload_session( &mut self ) -> GraphResult<UploadSessionClient<AsyncHttpClient>>

source

pub fn build_upload_session(&mut self) -> (Option<PathBuf>, RequestBuilder)

source

pub fn build(&mut self) -> RequestBuilder

source

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.

source

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.

source

pub fn clone(&mut self) -> Self

source§

impl GraphRequest<Client, Body, Form>

source

pub fn new_blocking(url: GraphUrl) -> BlockingClient

source

pub fn inner_client(&mut self) -> &mut Client

source

pub fn download(&mut self) -> BlockingDownload

source

pub fn upload_session( &mut self ) -> GraphResult<UploadSessionClient<BlockingHttpClient>>

source

pub fn build_upload_session(&mut self) -> (Option<PathBuf>, RequestBuilder)

source

pub fn build(&mut self) -> RequestBuilder

source

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.

source

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.

source

pub fn clone(&mut self) -> Self

Trait Implementations§

source§

impl<Client, Body, Form> AsMut<GraphUrl> for GraphRequest<Client, Body, Form>

source§

fn as_mut(&mut self) -> &mut GraphUrl

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<Client, Body, Form> AsRef<GraphUrl> for GraphRequest<Client, Body, Form>

source§

fn as_ref(&self) -> &GraphUrl

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<Client, Body, Form> Debug for GraphRequest<Client, Body, Form>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for GraphRequest<Client, Body, Form>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<GraphRequest<Client, Body, Form>> for AsyncHttpClient

source§

fn from(client: GraphRequest<Client, Body, Form>) -> Self

Converts to this type from the input type.
source§

impl From<GraphRequest<Client, Body, Form>> for HttpClient<RefCell<BlockingClient>>

source§

fn from(client: BlockingClient) -> Self

Converts to this type from the input type.
source§

impl From<Url> for GraphRequest<Client, Body, Form>

source§

fn from(url: Url) -> 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§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more