pub struct VcardItem { /* private fields */ }
Expand description
Immutable wrapper around a VCARD
.
Note that this is not a proper validating parser for vcard; it’s a very simple one with the sole purpose of extracing a UID. Proper parsing of components is out of scope, since we want to enable operating on potentially invalid items too.
Trait Implementations§
source§impl<C> Definition<VcardItem> for CardDavDefinition<C>where
C: Connect + Send + Sync + Clone + 'static + Debug,
impl<C> Definition<VcardItem> for CardDavDefinition<C>where C: Connect + Send + Sync + Clone + 'static + Debug,
source§impl Item for VcardItem
impl Item for VcardItem
source§fn uid(&self) -> Option<String>
fn uid(&self) -> Option<String>
Returns a unique identifier for this item.
The UID does not change when the item is modified. The UID must remain the same when the item is copied across storages and storage types.
source§fn hash(&self) -> String
fn hash(&self) -> String
Returns the hash of the raw content.
This is used as a fallback when a storage backend doesn’t provide Etag
values, or when
an item is missing its UID
.
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.
§type CollectionProperty = AddressBookProperty
type CollectionProperty = AddressBookProperty
source§impl<C> Storage<VcardItem> for CardDavStorage<C>where
C: Connect + Clone + Sync + Send,
impl<C> Storage<VcardItem> for CardDavStorage<C>where C: Connect + Clone + Sync + Send,
source§fn discover_collections<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Collection>, 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<Vec<Collection>, 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. 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 can still be found by providing an absolute path
to CardDavStorage::open_collection
.
source§fn create_collection_with_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId
) -> Pin<Box<dyn Future<Output = Result<Collection, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_collection_with_id<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 CollectionId ) -> Pin<Box<dyn Future<Output = Result<Collection, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Create a new address book such that its collection_id
matches the given input.
Errors
Returns ErrorKind::PreconditionFailed
if a home set was not found in the carddav
server.
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 carddav 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 address book components are added to the collection at the same time, they may be deleted.
source§fn set_collection_property<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 Collection,
meta: AddressBookProperty,
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_collection_property<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, collection: &'life1 Collection, meta: AddressBookProperty, 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,
Panics
Only DisplayName
is implemented.
source§fn get_collection_property<'life0, 'life1, 'async_trait>(
&'life0 self,
collection: &'life1 Collection,
meta: AddressBookProperty
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_collection_property<'life0, 'life1, 'async_trait>( &'life0 self, collection: &'life1 Collection, meta: AddressBookProperty ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
source§fn collection_id(&self, collection: &Collection) -> Result<CollectionId, Error>
fn collection_id(&self, collection: &Collection) -> Result<CollectionId, Error>
The collection_id
of a carddav collection is the last component of the path.
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
. Read more