[−][src]Struct web_ical::Calendar
store the iCalendar and add events from struct Events
.
Fields
prodid: String
version: String
calscale: String
method: String
x_wr_calname: String
x_wr_timezone: String
events: Vec<Events>
Methods
impl Calendar
[src]
pub fn new(url: &'static str) -> Calendar
[src]
Request HTTP or HTTPS to iCalendar url.
pub fn create(
prodid: &'static str,
version: &'static str,
calscale: &'static str,
method: &'static str,
x_wr_calname: &'static str,
x_wr_timezone: &'static str
) -> Calendar
[src]
prodid: &'static str,
version: &'static str,
calscale: &'static str,
method: &'static str,
x_wr_calname: &'static str,
x_wr_timezone: &'static str
) -> Calendar
Create your own iCalendar instance
Create an iCalendar
let mut ical = Calendar::create( "-//My Business Inc//My Calendar 70.9054//EN", "2.0", "GREGORIAN", "PUBLISH", "example@gmail.com", "America/New_York");
pub fn add_event(&mut self, event: Events)
[src]
Add events to the calendar.
Add events
let mut start_cal: DateTime<Utc> = Utc::now(); let start = date_tz.checked_add_signed(Duration::days(2)); match start { Some(x) => { start_cal = x; }, None => () } let own_event = Events{ dtsart: start_cal, dtend: start_cal, dtstamp: date_tz, uid: "786566jhjh5546@google.com".to_string(), created: date_tz, description: "The description".to_string(), last_modified: date_tz, location: "Homestead FL".to_string(), sequence: 0, status: "CONFIRMED".to_string(), summary: "My business (Not available)".to_string(), transp: "OPAQUE".to_string() }; let mut ical = Calendar::create( "-//My Business Inc//My Calendar 70.9054//EN", "2.0", "GREGORIAN", "PUBLISH", "example@gmail.com", "America/New_York"); ical.add_event(own_event); println!("{}", ical.events[0].summary);
pub fn export_ics(&self, path: &str) -> Result<bool>
[src]
Export iCalendar to a file.
iCalendar to a file
match ical.export_ics("ical.ics"){ Ok(_) => println!("OK"), Err(_) => panic!("Err") };
Trait Implementations
Auto Trait Implementations
impl Unpin for Calendar
impl Sync for Calendar
impl Send for Calendar
impl RefUnwindSafe for Calendar
impl UnwindSafe for Calendar
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,