pub struct IcsItem { /* private fields */ }
Expand description
Immutable wrapper around a VCALENDAR
or VCARD
.
Note that this is not a proper validating parser for icalendar or vcard; it’s a very simple one with the sole purpose of extracing a UID. Proper parsing of components is out of scope, since supporting potentially invalid items is required.
Trait Implementations§
source§impl Item for IcsItem
impl Item for IcsItem
source§type Property = CalendarProperty
type Property = CalendarProperty
Calendar properties defined by CalDav
.
source§fn ident(&self) -> String
fn ident(&self) -> String
A unique identifier for this item. Is either the UID (if any), or the hash of its contents.
source§impl<C> Storage<IcsItem> for CalDavStorage<C>
impl<C> Storage<IcsItem> for CalDavStorage<C>
source§fn discover_collections<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Discovery, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn discover_collections<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Discovery, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Finds existing collections for this storage.
Will only return collections stored under the principal’s home set. In most common scenarios, this implies that only collections owned by the current user are found and not other collections.
Collections outside the principal’s home set can be referenced by using an absolute path.
source§fn destroy_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn destroy_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes a caldav collection.
This method does multiple network calls to ensure that the collection is empty. If the
server property supports Etag
(it MUST as per the spec), this method guarantees that the
collection is empty when deleting it.
If the server is not compliant and does not support Etags, possible race conditions could occur and if calendar components are added to the collection at the same time, they may be deleted.
source§fn set_property<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
href: &'life1 str,
prop: CalendarProperty,
value: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set_property<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
href: &'life1 str,
prop: CalendarProperty,
value: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
§Errors
Only DisplayName
and Colour
are implemented.
source§fn unset_property<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
prop: CalendarProperty,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unset_property<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
prop: CalendarProperty,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
§Errors
Only DisplayName
and Colour
are implemented.
source§fn get_property<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
prop: CalendarProperty,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_property<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
prop: CalendarProperty,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read metadata from a collection.
Metadata is fetched using the PROPFIND
method under the hood. Some servers may not
support some properties.
§Errors
If the underlying HTTP connection fails or if the server returns invalid data.
Only DisplayName
and Colour
are implemented.
source§fn collection_id(&self, collection_href: &str) -> Result<CollectionId, Error>
fn collection_id(&self, collection_href: &str) -> Result<CollectionId, Error>
The id of a caldav collection is the last component of the path.
source§fn href_for_collection_id(&self, id: &CollectionId) -> Result<Href, Error>
fn href_for_collection_id(&self, id: &CollectionId) -> Result<Href, Error>
§Errors
Returns ErrorKind::PreconditionFailed
if a home set was not found in the carddav
server.
source§fn check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
source§fn create_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Collection, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Collection, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
href
.source§fn list_items<'life0, 'life1, 'async_trait>(
&'life0 self,
collection_href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ItemRef>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_items<'life0, 'life1, 'async_trait>(
&'life0 self,
collection_href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ItemRef>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§fn get_item<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(IcsItem, Etag), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_item<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(IcsItem, Etag), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§fn get_many_items<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
hrefs: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<FetchedItem<IcsItem>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_many_items<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
hrefs: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<FetchedItem<IcsItem>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
source§fn get_all_items<'life0, 'life1, 'async_trait>(
&'life0 self,
collection: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<FetchedItem<IcsItem>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_all_items<'life0, 'life1, 'async_trait>(
&'life0 self,
collection: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<FetchedItem<IcsItem>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§fn add_item<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection_href: &'life1 str,
item: &'life2 IcsItem,
) -> Pin<Box<dyn Future<Output = Result<ItemRef, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn add_item<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection_href: &'life1 str,
item: &'life2 IcsItem,
) -> Pin<Box<dyn Future<Output = Result<ItemRef, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
source§fn update_item<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
href: &'life1 str,
etag: &'life2 Etag,
item: &'life3 IcsItem,
) -> Pin<Box<dyn Future<Output = Result<Etag, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn update_item<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
href: &'life1 str,
etag: &'life2 Etag,
item: &'life3 IcsItem,
) -> Pin<Box<dyn Future<Output = Result<Etag, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
source§fn delete_item<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
href: &'life1 str,
etag: &'life2 Etag,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_item<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
href: &'life1 str,
etag: &'life2 Etag,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
source§fn list_properties<'life0, 'life1, 'async_trait>(
&'life0 self,
collection_href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ListedProperty<CalendarProperty>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_properties<'life0, 'life1, 'async_trait>(
&'life0 self,
collection_href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ListedProperty<CalendarProperty>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§impl Storage<IcsItem> for WebCalStorage
impl Storage<IcsItem> for WebCalStorage
source§fn check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks that the remove resource exists and whether it looks like an icalendar resource.
source§fn discover_collections<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Discovery, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn discover_collections<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Discovery, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a single collection with the name originally specified.
source§fn create_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
_: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Collection, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
_: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Collection, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unsupported for this storage type.
source§fn destroy_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
_: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn destroy_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
_: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unsupported for this storage type.
source§fn list_items<'life0, 'life1, 'async_trait>(
&'life0 self,
_collection: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ItemRef>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_items<'life0, 'life1, 'async_trait>(
&'life0 self,
_collection: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ItemRef>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Enumerates items in this collection.
Note that, due to the nature of webcal, the whole collection needs to be retrieved. If some
items need to be read as well, it is generally best to use
WebCalStorage::get_all_items
instead.
source§fn get_item<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(IcsItem, Etag), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_item<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(IcsItem, Etag), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns a single item from the collection.
Note that, due to the nature of webcal, the whole collection needs to be retrieved. It is
strongly recommended to use WebCalStorage::get_all_items
instead.
source§fn get_many_items<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
hrefs: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<FetchedItem<IcsItem>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_many_items<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
hrefs: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<FetchedItem<IcsItem>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Returns multiple items from the collection.
Note that, due to the nature of webcal, the whole collection needs to be retrieved. It is
generally best to use WebCalStorage::get_all_items
instead.
source§fn get_all_items<'life0, 'life1, 'async_trait>(
&'life0 self,
_collection: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<FetchedItem<IcsItem>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_all_items<'life0, 'life1, 'async_trait>(
&'life0 self,
_collection: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<FetchedItem<IcsItem>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch all items in the collection.
Performs a single HTTP(s) request to fetch all items.
source§fn add_item<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_collection: &'life1 str,
_: &'life2 IcsItem,
) -> Pin<Box<dyn Future<Output = Result<ItemRef, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn add_item<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_collection: &'life1 str,
_: &'life2 IcsItem,
) -> Pin<Box<dyn Future<Output = Result<ItemRef, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Unsupported for this storage type.
source§fn update_item<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_: &'life1 str,
_: &'life2 Etag,
_: &'life3 IcsItem,
) -> Pin<Box<dyn Future<Output = Result<Etag, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn update_item<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_: &'life1 str,
_: &'life2 Etag,
_: &'life3 IcsItem,
) -> Pin<Box<dyn Future<Output = Result<Etag, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Unsupported for this storage type.
source§fn set_property<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_: &'life1 str,
__arg2: CalendarProperty,
_: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set_property<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_: &'life1 str,
__arg2: CalendarProperty,
_: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Unsupported for this storage type.
source§fn unset_property<'life0, 'life1, 'async_trait>(
&'life0 self,
_: &'life1 str,
__arg2: CalendarProperty,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unset_property<'life0, 'life1, 'async_trait>(
&'life0 self,
_: &'life1 str,
__arg2: CalendarProperty,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unsupported for this storage type.
source§fn get_property<'life0, 'life1, 'async_trait>(
&'life0 self,
_: &'life1 str,
__arg2: CalendarProperty,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_property<'life0, 'life1, 'async_trait>(
&'life0 self,
_: &'life1 str,
__arg2: CalendarProperty,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unsupported for this storage type.
source§fn delete_item<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_: &'life1 str,
_: &'life2 Etag,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_item<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_: &'life1 str,
_: &'life2 Etag,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
source§fn collection_id(&self, collection_href: &str) -> Result<CollectionId, Error>
fn collection_id(&self, collection_href: &str) -> Result<CollectionId, Error>
href
. Read more