Struct vstorage::webcal::WebCalStorage
source · pub struct WebCalStorage { /* private fields */ }
Expand description
A storage which exposes items in remote icalendar resource.
A webcal storage contains exactly one collection, which contains all the entires found in the
remote resource. The name of this single collection is specified via the collection_id
argument.
This storage is a bit of an odd one (since in reality, there’s no concept of collections in webcal). The extra abstraction layer is here merely to match the format of other storages.
§Href
The href
for this meaningless. A string matching the collection_id
property is used to
describe the only available collection.
Implementations§
source§impl WebCalStorage
impl WebCalStorage
sourcepub fn new(
url: Uri,
collection_id: CollectionId,
) -> Result<WebCalStorage, Error>
pub fn new( url: Uri, collection_id: CollectionId, ) -> Result<WebCalStorage, Error>
Trait Implementations§
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