Crate gcal_rs

Source
Expand description

gcal_rs: Another Google Calendar API library for rust-lang

I wrote this by hand because I found other clients hard to use for my use-cases. This provides an API layer into the Google Calendar API that is very minimal but also mostly complete. Types are fully represented.

§Example

use gcal_rs::*;

#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
    let access_key = std::env::args().nth(1).expect("Provide an access key");
    let now = chrono::Local::now();
    let client = Client::new(access_key);
    let client = EventClient::new(client);
    let list = client.list(now - chrono::Duration::days(1), now).await?;

    for event in &list {
        eprintln!("{} {}", event.id, event.summary);
    }
}

Re-exports§

pub use oauth::*;

Modules§

list
Calendar List, the normal way to get at the list of calendars available.
oauth
types

Structs§

Calendar
Calendar is a single calendar.
CalendarList
CalendarListClient
CalendarListClient is the method of accessing the calendar list. You must provide it with a Google Calendar client.
CalendarListItem
CalendarListItem is a single calendar returned by CalendarList, do not confuse this with Calendar.
ConferenceProperties
DefaultReminder
Event
Event is a single event.
EventClient
EventClient is the method of managing events from a specific calendar. Requires a Google Calendar client.
Events
Events is a listing of events on a per-page basis.
GCalClient
Client is a Google Calendar client. The access key must have already been fetched and the oauth negotiation should have already been completed. The client itself only implements HTTP verbs that accept Sendable implementations. You must use the decorated clients such as EventClient and CalendarListClient to do transactional work.
NotificationSetting
NotificationSettings

Enums§

AllowedSolutionType
CalendarAccessRole
ClientError
ClientError provides a mechanism to determine when the access token has expired. All other errors will be encapsulated by UnknownError.
NotificationSettingMethod
NotificationSettingType
ReminderMethod

Traits§

Sendable
Sendable is the trait you must implement to interact with the Client. This object is received by the client and is used to construct the request URL as well as manage the (de)serialization of the object.

Type Aliases§

AdditionalProperties
ClientResult
QueryParams