Struct graph_rs_sdk::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,
/* private fields */
}Fields
url: GraphUrlmethod: Methodbody: Option<Body>headers: HeaderMap<HeaderValue>upload_session_file: Option<PathBuf>download_dir: Option<PathBuf>form: Option<Form>req_type: RequestTypeImplementations
pub fn download(
&mut self
) -> DownloadClient<HttpClient<Arc<Mutex<GraphRequest<Client, Body, Form>>>>, Arc<Mutex<DownloadRequest>>>
pub async fn upload_session(
&'_ mut self
) -> Result<UploadSessionClient<HttpClient<Arc<Mutex<GraphRequest<Client, Body, Form>>>>>, GraphFailure>
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.
pub async fn execute<T>(&'_ mut self) -> Result<GraphResponse<T>, GraphFailure> where
T: for<'de> Deserialize<'de>,
pub async fn execute<T>(&'_ mut self) -> Result<GraphResponse<T>, GraphFailure> where
T: for<'de> Deserialize<'de>,
Builds the requests and sends it, converting to a GraphResponse and deserializing the body.
pub fn download(
&mut self
) -> DownloadClient<HttpClient<RefCell<GraphRequest<Client, Body, Form>>>, RefCell<DownloadRequest>>
pub fn upload_session(
&mut self
) -> Result<UploadSessionClient<HttpClient<RefCell<GraphRequest<Client, Body, Form>>>>, GraphFailure>
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.
pub fn execute<T>(&mut self) -> Result<GraphResponse<T>, GraphFailure> where
T: for<'de> Deserialize<'de>,
pub fn execute<T>(&mut self) -> Result<GraphResponse<T>, GraphFailure> where
T: for<'de> Deserialize<'de>,
Builds the requests and sends it, converting to a GraphResponse and deserializing the body.
Trait Implementations
impl From<GraphRequest<Client, Body, Form>> for HttpClient<Arc<Mutex<GraphRequest<Client, Body, Form>>>>
impl From<GraphRequest<Client, Body, Form>> for HttpClient<Arc<Mutex<GraphRequest<Client, Body, Form>>>>
pub fn from(
client: GraphRequest<Client, Body, Form>
) -> HttpClient<Arc<Mutex<GraphRequest<Client, Body, Form>>>>
pub fn from(
client: GraphRequest<Client, Body, Form>
) -> HttpClient<Arc<Mutex<GraphRequest<Client, Body, Form>>>>
Performs the conversion.
impl From<GraphRequest<Client, Body, Form>> for HttpClient<RefCell<GraphRequest<Client, Body, Form>>>
impl From<GraphRequest<Client, Body, Form>> for HttpClient<RefCell<GraphRequest<Client, Body, Form>>>
pub fn from(
client: GraphRequest<Client, Body, Form>
) -> HttpClient<RefCell<GraphRequest<Client, Body, Form>>>
pub fn from(
client: GraphRequest<Client, Body, Form>
) -> HttpClient<RefCell<GraphRequest<Client, Body, Form>>>
Performs the conversion.
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
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more