Skip to main content

ContactsProvider

Trait ContactsProvider 

Source
pub trait ContactsProvider: Send {
    // Required methods
    fn search(
        &self,
        query: &ContactQuery,
    ) -> impl Future<Output = Result<ContactList, CoreError>> + Send;
    fn get(
        &self,
        path: &ResourcePath,
    ) -> impl Future<Output = Result<Contact, CoreError>> + Send;
    fn create(
        &self,
        draft: &ContactDraft,
    ) -> impl Future<Output = Result<ResourcePath, CoreError>> + Send;
    fn update(
        &self,
        path: &ResourcePath,
        etag: &ETag,
        update: &ContactUpdate,
    ) -> impl Future<Output = Result<ETag, CoreError>> + Send;
    fn delete(
        &self,
        path: &ResourcePath,
        etag: &ETag,
    ) -> impl Future<Output = Result<(), CoreError>> + Send;
    fn set_group_membership(
        &self,
        group: &ResourcePath,
        contact: &ResourcePath,
        change: GroupChange,
    ) -> impl Future<Output = Result<(), CoreError>> + Send;
}
Expand description

Contacts read and write operations.

Required Methods§

Source

fn search( &self, query: &ContactQuery, ) -> impl Future<Output = Result<ContactList, CoreError>> + Send

Searches contacts.

§Errors

Returns CoreError when the search cannot be run.

Source

fn get( &self, path: &ResourcePath, ) -> impl Future<Output = Result<Contact, CoreError>> + Send

Fetches one contact.

§Errors

Returns CoreError when the contact cannot be read.

Source

fn create( &self, draft: &ContactDraft, ) -> impl Future<Output = Result<ResourcePath, CoreError>> + Send

Creates a contact.

§Errors

Returns CoreError when the contact cannot be written.

Source

fn update( &self, path: &ResourcePath, etag: &ETag, update: &ContactUpdate, ) -> impl Future<Output = Result<ETag, CoreError>> + Send

Replaces a contact when the ETag still matches.

§Errors

Returns CoreError::Conflict when the ETag does not match.

Source

fn delete( &self, path: &ResourcePath, etag: &ETag, ) -> impl Future<Output = Result<(), CoreError>> + Send

Deletes a contact.

§Errors

Returns CoreError when the contact cannot be deleted.

Source

fn set_group_membership( &self, group: &ResourcePath, contact: &ResourcePath, change: GroupChange, ) -> impl Future<Output = Result<(), CoreError>> + Send

Adds or removes a contact in an existing group.

§Errors

Returns CoreError when the group card cannot be rewritten.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§