[][src]Crate rememberthemilk

Interface to the remember the milk to-do app via the REST API.

This crate is unofficial and not not supported by remember the milk. To use it, you will need a free for non-commercial use API key, which is not included with the crate.

Before doing anything else, you need to get an API object which needs your API key and secret, and authenticate with the API - this means both your application key and the user's account.

// Create the API object
let mut rtm_api = API::new("my key".to_string(), "my secret".to_string());
// Begin authentication using your API key
let auth = rtm_api.start_auth(Perms::Read).await?;
// auth.url is a URL which the user should visit to authorise the application
// using their rememberthemilk.com account.  The user needs to visit this URL
// and sign in before continuing below.
if rtm_api.check_auth(&auth).await? {
   // Successful authentication!  Can continue to use the API now.
}

If the authentication is successful, the API object will have an authentication token which can be re-used later. See to_config and from_config which can be used to save the token and API keys (so they should be stored somewhere relatively secure).

The rest of the API can then be used:

let tasks = api.get_all_tasks().await?;
for list in tasks.list {
   if let Some(v) = list.taskseries {
       for ts in v {
           println!("  {}", ts.name);
       }
   }
}

Structs

API

The rememberthemilk API object. All rememberthemilk operations are done using methods on here.

AuthState

The state of an ongoing user authentication attempt.

RRule

A recurrence rule for a repeating task.

RTMConfig

rememberthemilk API and authentication configuration. This holds the persistent state for the app authentication and possibly user authentication.

RTMError

Error type for Remember the Milk API calls.

RTMList

The details of a list of to-do items.

RTMLists

A container for a list of task series.

RTMTasks

The response from fetching a list of tasks.

RTMTimeline

Handle to a rememberthemilk timeline.

Task

A rememberthemilk Task. In rememberthemilk a task is a specific instance of a possibly repeating item. For example, a weekly task to take out the bins is represented as a single TaskSeries with a different Task every week. A Task's main characteristic is a due date.

TaskSeries

A rememberthemilk Task Series. This corresponds to a single to-do item, and has the fields such as name and tags. It also may contain some Tasks, each of which is an instance of a possibly recurring or repeating task.

User

Information about a rememberthemilk user.

Enums

Perms

rememberthemilk API permissions.

TimeLeft

Describes how much time is left to complete this task, or perhaps that it is overdue or has been deleted.