pub struct Todo { /* private fields */ }Expand description
Implementations§
Source§impl Todo
impl Todo
Sourcepub fn percent_complete(&mut self, percent: u8) -> &mut Self
pub fn percent_complete(&mut self, percent: u8) -> &mut Self
Set the PERCENT-COMPLETE property
Ranges between 0 - 100
Sourcepub fn remove_percent_complete(&mut self) -> &mut Self
pub fn remove_percent_complete(&mut self) -> &mut Self
Removes the PERCENT-COMPLETE property.
Sourcepub fn get_percent_complete(&self) -> Option<u8>
pub fn get_percent_complete(&self) -> Option<u8>
Gets the PERCENT-COMPLETE property.
Ranges between 0 - 100.
Sourcepub fn due<T: Into<DatePerhapsTime>>(&mut self, dt: T) -> &mut Self
pub fn due<T: Into<DatePerhapsTime>>(&mut self, dt: T) -> &mut Self
Set the DUE property
See CalendarDateTime for info how are different chrono types converted automatically.
Sourcepub fn remove_due(&mut self) -> &mut Self
pub fn remove_due(&mut self) -> &mut Self
Removes the DUE property
Sourcepub fn get_due(&self) -> Option<DatePerhapsTime>
pub fn get_due(&self) -> Option<DatePerhapsTime>
Gets the DUE property
Sourcepub fn completed(&mut self, dt: DateTime<Utc>) -> &mut Self
pub fn completed(&mut self, dt: DateTime<Utc>) -> &mut Self
Set the COMPLETED property
Per RFC 5545, Section 3.8.2.1, this must be a date-time in UTC format.
Sourcepub fn remove_completed(&mut self) -> &mut Self
pub fn remove_completed(&mut self) -> &mut Self
Removes the COMPLETED property
Sourcepub fn get_completed(&self) -> Option<DateTime<Utc>>
pub fn get_completed(&self) -> Option<DateTime<Utc>>
Gets the COMPLETED property
Per RFC 5545, Section 3.8.2.1, this must be a date-time in UTC format.
Sourcepub fn status(&mut self, status: TodoStatus) -> &mut Self
pub fn status(&mut self, status: TodoStatus) -> &mut Self
Defines the overall status or confirmation
Sourcepub fn remove_status(&mut self) -> &mut Self
pub fn remove_status(&mut self) -> &mut Self
Removes the overall status
Sourcepub fn get_status(&self) -> Option<TodoStatus>
pub fn get_status(&self) -> Option<TodoStatus>
Gets the overall status.
Sourcepub fn mark_uncompleted(&mut self) -> &mut Self
pub fn mark_uncompleted(&mut self) -> &mut Self
Mark a todo as uncompleted by removing completion-related properties.
This removes the following properties:
- COMPLETED: The timestamp when the task was completed
- PERCENT-COMPLETE: The percentage of the task that has been completed
- STATUS: The task status, if it was set to “COMPLETED”
§Example
use icalendar::{Todo, Component, TodoStatus};
use chrono::Utc;
let mut todo = Todo::new()
.completed(Utc::now())
.percent_complete(100)
.status(TodoStatus::Completed)
.done();
// Later, when marking the task as uncompleted:
todo.mark_uncompleted();Trait Implementations§
Source§impl Component for Todo
impl Component for Todo
Source§fn component_kind(&self) -> String
fn component_kind(&self) -> String
Source§fn components(&self) -> &[Other]
fn components(&self) -> &[Other]
Read-only access to properties
Source§fn multi_properties(&self) -> &BTreeMap<String, Vec<Property>>
fn multi_properties(&self) -> &BTreeMap<String, Vec<Property>>
Read-only access to multi_properties
Source§fn append_component(&mut self, child: impl Into<Other>) -> &mut Self
fn append_component(&mut self, child: impl Into<Other>) -> &mut Self
Appends a Component
Source§fn append_multi_property(&mut self, property: impl Into<Property>) -> &mut Self
fn append_multi_property(&mut self, property: impl Into<Property>) -> &mut Self
Adds a Property of which there may be many
Source§fn remove_property(&mut self, key: &str) -> &mut Self
fn remove_property(&mut self, key: &str) -> &mut Self
Removes a Property by its key if it exists
Source§fn remove_multi_property(&mut self, key: &str) -> &mut Self
fn remove_multi_property(&mut self, key: &str) -> &mut Self
Removes a multi-property by its key if it exists
Source§fn try_into_string(&self) -> Result<String, Error>
fn try_into_string(&self) -> Result<String, Error>
rfc5545 againSource§fn add_property(
&mut self,
key: impl Into<String>,
val: impl Into<String>,
) -> &mut Self
fn add_property( &mut self, key: impl Into<String>, val: impl Into<String>, ) -> &mut Self
PropertySource§fn add_property_pre_alloc(&mut self, key: String, val: String) -> &mut Self
fn add_property_pre_alloc(&mut self, key: String, val: String) -> &mut Self
PropertySource§fn add_multi_property(&mut self, key: &str, val: &str) -> &mut Self
fn add_multi_property(&mut self, key: &str, val: &str) -> &mut Self
PropertySource§fn remove_timestamp(&mut self) -> &mut Self
fn remove_timestamp(&mut self) -> &mut Self
Source§fn get_recurrence_id(&self) -> Option<DatePerhapsTime>
fn get_recurrence_id(&self) -> Option<DatePerhapsTime>
RECURRENCE-ID property.Source§fn remove_priority(&mut self) -> &mut Self
fn remove_priority(&mut self) -> &mut Self
Source§fn remove_summary(&mut self) -> &mut Self
fn remove_summary(&mut self) -> &mut Self
Source§fn get_summary(&self) -> Option<&str>
fn get_summary(&self) -> Option<&str>
Source§fn description(&mut self, desc: &str) -> &mut Self
fn description(&mut self, desc: &str) -> &mut Self
Source§fn remove_description(&mut self) -> &mut Self
fn remove_description(&mut self) -> &mut Self
Source§fn get_description(&self) -> Option<&str>
fn get_description(&self) -> Option<&str>
Source§fn remove_sequence(&mut self) -> &mut Self
fn remove_sequence(&mut self) -> &mut Self
Source§fn get_sequence(&self) -> Option<u32>
fn get_sequence(&self) -> Option<u32>
Source§fn remove_class(&mut self) -> &mut Self
fn remove_class(&mut self) -> &mut Self
Source§fn remove_url(&mut self) -> &mut Self
fn remove_url(&mut self) -> &mut Self
Source§fn last_modified(&mut self, dt: DateTime<Utc>) -> &mut Self
fn last_modified(&mut self, dt: DateTime<Utc>) -> &mut Self
Source§fn remove_last_modified(&mut self) -> &mut Self
fn remove_last_modified(&mut self) -> &mut Self
LAST-MODIFIED PropertySource§fn get_last_modified(&self) -> Option<DateTime<Utc>>
fn get_last_modified(&self) -> Option<DateTime<Utc>>
LAST-MODIFIED property.Source§fn remove_created(&mut self) -> &mut Self
fn remove_created(&mut self) -> &mut Self
Source§impl EventLike for Todo
impl EventLike for Todo
Source§fn starts<T: Into<DatePerhapsTime>>(&mut self, dt: T) -> &mut Self
fn starts<T: Into<DatePerhapsTime>>(&mut self, dt: T) -> &mut Self
Source§fn remove_starts(&mut self) -> &mut Self
fn remove_starts(&mut self) -> &mut Self
Source§fn ends<T: Into<DatePerhapsTime>>(&mut self, dt: T) -> &mut Self
fn ends<T: Into<DatePerhapsTime>>(&mut self, dt: T) -> &mut Self
Source§fn remove_ends(&mut self) -> &mut Self
fn remove_ends(&mut self) -> &mut Self
Source§fn recurrence_id<T: Into<DatePerhapsTime>>(&mut self, dt: T) -> &mut Self
fn recurrence_id<T: Into<DatePerhapsTime>>(&mut self, dt: T) -> &mut Self
RECURRENCE-ID
property. Read moreSource§fn remove_recurrence_id(&mut self) -> &mut Self
fn remove_recurrence_id(&mut self) -> &mut Self
RECURRENCE-ID