[][src]Crate onedrive_api

onedrive-api

The onedrive-api crate provides a middle-level HTTP Client to the OneDrive API through Microsoft Graph, and also AuthClient with utilities for authorization to it.

The onedrive_api::DriveClient and onedrive_api::AuthClient are synchronous by using reqwest::Client. Async support is TODO.

Example

use onedrive_api::{DriveClient, FileName, DriveLocation, ItemLocation};

let client = DriveClient::new(
    "<...TOKEN...>".to_owned(), // Login token to Microsoft Graph.
    DriveLocation::me(),
);
let folder_item = client.create_folder(
    ItemLocation::root(),
    FileName::new("test_folder").unwrap(),
)?;
client.upload_small(
    folder_item.id.as_ref().unwrap(),
    b"Hello, world",
)?;

Ok(())

Re-exports

pub use self::resource::DriveId;
pub use self::resource::ItemId;
pub use self::resource::Tag;

Modules

option

Configurable options which can be used to customize behaviors or responses.

resource

Resource Objects defined in the OneDrive API.

Structs

AuthClient

The client for requests relative to authentication.

CopyProgress

The progress of a asynchronous copy operation.

CopyProgressMonitor

The monitor for checking the progress of a asynchronous copy operation.

DriveClient

The authorized client to access OneDrive resources in a specified Drive.

DriveLocation

Specify the location of a Drive resource.

Error

The error may occur when processing requests.

ExpectRange

A half-open byte range start..end or start...

FileName

An valid file name str (unsized).

ItemLocation

Reference to a DriveItem in a drive. It does not contains the drive information.

ListChildrenFetcher

The page fetcher for children listing operation with Iterator interface.

Permission

A list of the Microsoft Graph permissions that you want the user to consent to.

Token

Access tokens from AuthClient.

TrackChangeFetcher

The page fetcher for tracking operations with Iterator interface.

UploadSession

An upload session for resumable file uploading process.

Enums

ConflictBehavior

The conflict resolution behavior for actions that create a new item.

CopyStatus

The status of a copy operation.

Type Definitions

Result

An alias to Result with Err of onedrive_api::Error.