Struct graph_http::HttpClient
source · [−]pub struct HttpClient<Client> { /* private fields */ }
Implementations
sourceimpl HttpClient<Arc<Mutex<RawMutex, GraphRequest<Client, Body, Form>>>>
impl HttpClient<Arc<Mutex<RawMutex, GraphRequest<Client, Body, Form>>>>
pub fn new(url: GraphUrl) -> AsyncHttpClient
pub fn clone_inner(&self) -> Arc<Mutex<GraphRequest<Client, Body, Form>>>
pub async fn download(&self) -> AsyncDownload
pub async fn upload_session(
&self
) -> GraphResult<UploadSessionClient<AsyncHttpClient>>
pub async fn build_upload_session(&self) -> (Option<PathBuf>, RequestBuilder)
pub async fn build(&self) -> RequestBuilder
pub async fn response(&self) -> GraphResult<Response>
pub async fn execute<T>(&self) -> GraphResult<GraphResponse<T>> where
for<'de> T: Deserialize<'de>,
sourceimpl HttpClient<RefCell<BlockingClient>>
impl HttpClient<RefCell<BlockingClient>>
pub fn new(url: GraphUrl) -> HttpClient<RefCell<BlockingClient>>
pub fn download(&self) -> BlockingDownload
pub fn upload_session(
&self
) -> GraphResult<UploadSessionClient<BlockingHttpClient>>
pub fn build_upload_session(&self) -> (Option<PathBuf>, RequestBuilder)
pub fn build(&self) -> RequestBuilder
pub fn response(&self) -> GraphResult<Response>
pub fn execute<T>(&self) -> GraphResult<GraphResponse<T>> where
for<'de> T: Deserialize<'de>,
pub fn inner_url_ref<F>(&self, f: F) where
F: Fn(&GraphUrl),
Trait Implementations
sourceimpl Debug for HttpClient<RefCell<BlockingClient>>
impl Debug for HttpClient<RefCell<BlockingClient>>
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.
sourceimpl RequestClient for HttpClient<RefCell<BlockingClient>>
impl RequestClient for HttpClient<RefCell<BlockingClient>>
type Body = Body
type Form = Form
fn token(&self) -> String
fn set_token(&self, token: &str)
fn ident(&self) -> ResourceIdentity
fn set_ident(&self, ident: ResourceIdentity)
fn url(&self) -> GraphUrl
fn to_url(&self) -> Url
fn set_url(&self, url: GraphUrl)
fn method(&self) -> Method
fn set_method(&self, method: Method)
fn set_body<T: Into<Self::Body>>(&self, body: T)
fn set_body_with_file(&self, path: PathBuf) -> GraphResult<()>
fn header<T: IntoHeaderName>(&self, name: T, value: HeaderValue)
fn set_header_map(&self, header_map: HeaderMap)
fn clear_headers(&self)
fn set_download_dir(&self, dir: PathBuf)
fn set_upload_session(&self, file: PathBuf)
fn set_form(&self, form: Self::Form)
fn set_request_type(&self, req_type: RequestType)
fn request_type(&self) -> RequestType
fn url_ref<F>(&self, f: F) where
F: Fn(&GraphUrl) + Sync,
fn url_mut<F>(&self, f: F) where
F: Fn(&mut GraphUrl) + Sync,
fn registry<F>(&self, f: F) where
F: Fn(&mut Handlebars) + Sync,
fn render_template(&self, template: &str, json: &Value) -> String
fn register_ident_helper(&self, resource_identity: ResourceIdentity)
fn extend_path(&self, path: &[&str])
fn set_request(
&self,
req_att: Vec<RequestAttribute<Body, Form>>
) -> GraphResult<()>
fn set_timeout(&self, duration: Duration)
fn set_body_with_serialize<B: Serialize>(&self, body: &B) -> GraphResult<()>
Auto Trait Implementations
impl<Client> RefUnwindSafe for HttpClient<Client> where
Client: RefUnwindSafe,
impl<Client> Send for HttpClient<Client> where
Client: Send,
impl<Client> Sync for HttpClient<Client> where
Client: Sync,
impl<Client> Unpin for HttpClient<Client> where
Client: Unpin,
impl<Client> UnwindSafe for HttpClient<Client> where
Client: UnwindSafe,
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