Expand description
§onedrive-api
onedrive-api
crate provides middle-level HTTP APIs OneDrive
to the
OneDrive API through Microsoft Graph, and also Auth
with utilities for OAuth2.
§Example
use onedrive_api::{OneDrive, FileName, DriveLocation, ItemLocation};
use reqwest::Client;
let client = Client::new();
let drive = OneDrive::new(
"<...TOKEN...>", // Login token to Microsoft Graph.
DriveLocation::me(),
);
let folder_item = drive
.create_folder(
ItemLocation::root(),
FileName::new("test_folder").unwrap(),
)
.await?;
drive
.upload_small(
folder_item.id.as_ref().unwrap(),
&b"Hello, world"[..],
)
.await?;
§Features
-
beta
Most of Microsoft APIs used in this crate are stable. But there are also some beta APIs, which are subject to change and is not suggested to be used in production application. Microsoft references of beta APIs usually contain a
(beta)
suffix in title.To avoid breakage, we put beta APIs and related resources under feature gate
beta
. They may change to follow Microsoft API references ANYTIME, and do NOT follow the semantic version of this crate.Be carefully using it and do NOT use it in production.
Re-exports§
Modules§
- option
- Configurable options which can be used to customize API behaviors or responses.
- resource
- Resource Objects defined in the OneDrive API.
Structs§
- Auth
- OAuth2 authentication and authorization basics for Microsoft Graph.
- Copy
Progress - The progress of a asynchronous
copy
operation. (Beta) - Copy
Progress Monitor - The monitor for checking the progress of a asynchronous
copy
operation. - Drive
Location - Specify the location of a
Drive
resource. - Error
- Error of API request
- Expect
Range - A half-open byte range
start..end
orstart..
. - File
Name - An valid file name str (unsized).
- Item
Location - Reference to a
DriveItem
in a drive. It does not contains the drive information. - List
Children Fetcher - The page fetcher for listing children
- OneDrive
- The authorized client to access OneDrive resources in a specified Drive.
- Permission
- A list of the Microsoft Graph permissions that you want the user to consent to.
- Token
Response - Tokens and some additional data returned by a successful authorization.
- Track
Change Fetcher - The page fetcher for tracking operations with
Iterator
interface. - Upload
Session - An upload session for resumable file uploading process.
- Upload
Session Meta - Metadata of an in-progress upload session
Enums§
- Client
Credential - Credential of client for code redeemption.
- Conflict
Behavior - The conflict resolution behavior for actions that create a new item.
- Copy
Status - The status of a
copy
operation. (Beta) - Tenant
- Control who can sign into the application.