minicaldav/lib.rs
1// minicaldav: Small and easy CalDAV client.
2// Copyright (C) 2022 Florian Loers
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17//! minicaldav
18//!
19//! minicaldav is a caldav client and basic ical parser with as little dependencies as possible (but practical).
20//!
21//! minicaldav should be
22//! - Simple: Few dependencies, no async, the code is simple
23//!
24//! minicaldav is work in progress
25//! - The code is not feature complete
26//! - The code is not correct
27//!
28//! # Quick Start
29//!
30//! ```rust,no_run
31//! let agent = ureq::Agent::new();
32//! let url = url::Url::parse("http://mycaldav.com/").unwrap();
33//! let username = "foo";
34//! let password = "s3cret!";
35//! let credentials = minicaldav::Credentials::Basic(username.into(), password.into());
36//! let calendars = minicaldav::get_calendars(agent.clone(), &credentials, &url).unwrap();
37//! for calendar in calendars {
38//! println!("{:?}", calendar);
39//! let credentials = minicaldav::Credentials::Basic(username.into(), password.into());
40//! let (events, errors) = minicaldav::get_events(agent.clone(), &credentials, &calendar).unwrap();
41//! for event in events {
42//! println!("{:?}", event);
43//! }
44//! for error in errors {
45//! println!("Error: {:?}", error);
46//! }
47//! }
48//! ```
49
50#[cfg(any(feature = "caldav", feature = "ical"))]
51#[macro_use]
52extern crate log;
53
54#[cfg(feature = "caldav")]
55mod api;
56#[cfg(feature = "caldav")]
57pub mod caldav;
58#[cfg(feature = "caldav")]
59pub use api::*;
60
61#[cfg(feature = "ical")]
62pub mod ical;
63
64mod credentials;