[−][src]Struct graph_rs_sdk::client::Graph
The graph client.
The graph client supports blocking and asynchronous requests but you must declare which type of client you want to use beforehand.
Blocking - Most simple and easy to use
let _client = Graph::new("ACCESS_TOKEN");
Async
let _client = Graph::new_async("ACCESS_TOKEN");
Implementations
impl<'a, Client> Graph<Client> where
Client: RequestClient,
[src]
Client: RequestClient,
pub fn v1(&'a self) -> Identify<'a, Client>
[src]
Use the V1.0 api.
pub fn beta(&'a self) -> Identify<'a, Client>
[src]
Use the beta API.
pub fn is_v1(&self) -> bool
[src]
Check if the current host is v1.0.
pub fn is_beta(&self) -> bool
[src]
Check if the current host is beta.
pub fn set_token(&self, token: &str)
[src]
Set the access token used for requests.
pub fn ident(&self) -> ResourceIdentity
[src]
impl<'a> Graph<BlockingHttpClient>
[src]
pub fn new(token: &str) -> Graph<BlockingHttpClient>
[src]
Create a new client with an access token.
Example
use graph_rs_sdk::client::Graph; let client = Graph::new("ACCESS_TOKEN");
ⓘ
// Use the v1.0 API // Returns a response object with the body // converted to serde_json::Value. let response = client .v1() .me() .drive() .root_children() .send()?; println!("{:#?}", response.body()); // Use a custom data structure. The json method // will convert anything that implements serde deserialize. let drive_items: serde_json::Value = client .v1() .me() .drive() .root_children() .json()?;
pub fn url_ref<F>(&self, f: F) where
F: Fn(&GraphUrl),
[src]
F: Fn(&GraphUrl),
impl<'a> Graph<AsyncHttpClient>
[src]
pub fn new_async(token: &str) -> Graph<AsyncHttpClient>
[src]
Create a new client with an access token.
Example
use graph_rs_sdk::client::Graph; let client = Graph::new_async("ACCESS_TOKEN");
ⓘ
// Use the v1.0 API // Returns a response object with the body // converted to serde_json::Value. let response = client .v1() .me() .drive() .root_children() .await .send()?; println!("{:#?}", response.body()); // Use a custom data structure. The json method // will convert anything that implements serde deserialize. let drive_items: serde_json::Value = client .v1() .me() .drive() .root_children() .await .json()?;
pub fn url_ref<F>(&self, f: F) where
F: Fn(&GraphUrl) + Sync,
[src]
F: Fn(&GraphUrl) + Sync,
Trait Implementations
impl<Client> Debug for Graph<Client> where
Client: Debug,
[src]
Client: Debug,
impl From<&'_ AccessToken> for Graph<BlockingHttpClient>
[src]
pub fn from(token: &AccessToken) -> Self
[src]
impl From<&'_ AccessToken> for Graph<AsyncHttpClient>
[src]
pub fn from(token: &AccessToken) -> Self
[src]
impl From<&'_ str> for Graph<BlockingHttpClient>
[src]
impl From<&'_ str> for Graph<AsyncHttpClient>
[src]
impl From<String> for Graph<BlockingHttpClient>
[src]
impl From<String> for Graph<AsyncHttpClient>
[src]
impl TryFrom<&'_ OAuth> for Graph<BlockingHttpClient>
[src]
type Error = GraphFailure
The type returned in the event of a conversion error.
pub fn try_from(oauth: &OAuth) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ OAuth> for Graph<AsyncHttpClient>
[src]
Auto Trait Implementations
impl<Client> RefUnwindSafe for Graph<Client> where
Client: RefUnwindSafe,
[src]
Client: RefUnwindSafe,
impl<Client> Send for Graph<Client> where
Client: Send,
[src]
Client: Send,
impl<Client> Sync for Graph<Client> where
Client: Sync,
[src]
Client: Sync,
impl<Client> Unpin for Graph<Client> where
Client: Unpin,
[src]
Client: Unpin,
impl<Client> UnwindSafe for Graph<Client> where
Client: UnwindSafe,
[src]
Client: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,