summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
blob: d0fc0561c9e343588d08137ce7deed14b6f9ac70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! libical high level interface
//!
//! This library offers a high-level interface for the widely used libical. It relies upon the
//! libical-sys crate, which is a thin rust layer over the libical C API.
//! It provides a safe interface to libical that is rather lower-level, as well as convenience
//! functionality build on this low-level interface for easy handling of icalendar data.
//!

#![warn(unused_extern_crates)]
#![allow(clippy::redundant_closure)] // disable "redundant closure" lint

#[cfg(test)]
#[macro_use]
extern crate pretty_assertions;

#[cfg(test)]
#[macro_use]
extern crate indoc;

#[macro_use]
extern crate log;
#[macro_use]
extern crate lazy_static;
use ical; // extern crate

// libical does some weird, non-threadsafe things in timezone methods, notably
// icaltime_convert_to_zone (which is also called in icaltime_as_timet_with_zone)
// see these two (independent!) bugs:
// https://github.com/libical/libical/issues/86
// https://github.com/libical/libical/commit/0ebf2d9a7183be94991c2681c6e3f009c64cf7cc
use std::sync::Mutex;
lazy_static! {
    static ref TZ_MUTEX: Mutex<i32> = Mutex::new(0);
}

pub mod component;
pub mod duration;
pub mod property;
pub mod time;
pub mod timezone;
pub mod utils;
pub mod vcalendar;
pub mod vevent;

#[cfg(test)]
pub mod testdata;

#[cfg(test)]
pub mod testutils;

pub use crate::component::IcalComponent;
pub use crate::duration::IcalDuration;
pub use crate::property::IcalProperty;
pub use crate::time::IcalTime;
pub use crate::timezone::IcalTimeZone;
pub use crate::vcalendar::IcalEventIter;
pub use crate::vcalendar::IcalVCalendar;
pub use crate::vevent::IcalVEvent;