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§
Structs§
- Calendar
- Calendar is a single calendar.
- Calendar
List - Calendar
List Client - CalendarListClient is the method of accessing the calendar list. You must provide it with a Google Calendar client.
- Calendar
List Item - CalendarListItem is a single calendar returned by CalendarList, do not confuse this with Calendar.
- Conference
Properties - Default
Reminder - Event
- Event is a single event.
- Event
Client - 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.
- GCal
Client - 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.
- Notification
Setting - Notification
Settings
Enums§
- Allowed
Solution Type - Calendar
Access Role - Client
Error - ClientError provides a mechanism to determine when the access token has expired. All other errors will be encapsulated by UnknownError.
- Notification
Setting Method - Notification
Setting Type - Reminder
Method
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.