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§
Sourcefn search(
&self,
query: &ContactQuery,
) -> impl Future<Output = Result<ContactList, CoreError>> + Send
fn search( &self, query: &ContactQuery, ) -> impl Future<Output = Result<ContactList, CoreError>> + Send
Sourcefn get(
&self,
path: &ResourcePath,
) -> impl Future<Output = Result<Contact, CoreError>> + Send
fn get( &self, path: &ResourcePath, ) -> impl Future<Output = Result<Contact, CoreError>> + Send
Sourcefn create(
&self,
draft: &ContactDraft,
) -> impl Future<Output = Result<ResourcePath, CoreError>> + Send
fn create( &self, draft: &ContactDraft, ) -> impl Future<Output = Result<ResourcePath, CoreError>> + Send
Sourcefn update(
&self,
path: &ResourcePath,
etag: &ETag,
update: &ContactUpdate,
) -> impl Future<Output = Result<ETag, CoreError>> + Send
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.
Sourcefn delete(
&self,
path: &ResourcePath,
etag: &ETag,
) -> impl Future<Output = Result<(), CoreError>> + Send
fn delete( &self, path: &ResourcePath, etag: &ETag, ) -> impl Future<Output = Result<(), CoreError>> + Send
Sourcefn set_group_membership(
&self,
group: &ResourcePath,
contact: &ResourcePath,
change: GroupChange,
) -> impl Future<Output = Result<(), CoreError>> + Send
fn set_group_membership( &self, group: &ResourcePath, contact: &ResourcePath, change: GroupChange, ) -> impl Future<Output = Result<(), CoreError>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".