pub struct LinkingService { /* private fields */ }Expand description
Service for linking local-only items to network identities
Implementations§
Source§impl LinkingService
impl LinkingService
Sourcepub fn new(
entity_service: Arc<RwLock<EntityService>>,
contact_store: Arc<ContactStore>,
) -> Self
pub fn new( entity_service: Arc<RwLock<EntityService>>, contact_store: Arc<ContactStore>, ) -> Self
Create a new linking service
Sourcepub fn validate_four_words(&self, four_words: &str) -> LinkingResult<String>
pub fn validate_four_words(&self, four_words: &str) -> LinkingResult<String>
Sourcepub fn is_valid_four_words(&self, four_words: &str) -> bool
pub fn is_valid_four_words(&self, four_words: &str) -> bool
Check if a four-word address is valid
Sourcepub async fn link_entity(
&self,
entity_id: &str,
four_words: &str,
) -> LinkingResult<Entity>
pub async fn link_entity( &self, entity_id: &str, four_words: &str, ) -> LinkingResult<Entity>
Sourcepub async fn link_contact(
&self,
contact_id: &str,
four_words: &str,
) -> LinkingResult<ContactRecord>
pub async fn link_contact( &self, contact_id: &str, four_words: &str, ) -> LinkingResult<ContactRecord>
Sourcepub async fn get_local_only_entities(&self) -> LinkingResult<Vec<Entity>>
pub async fn get_local_only_entities(&self) -> LinkingResult<Vec<Entity>>
Get all local-only entities
Sourcepub async fn get_linked_entities(&self) -> LinkingResult<Vec<Entity>>
pub async fn get_linked_entities(&self) -> LinkingResult<Vec<Entity>>
Get all network-linked entities
Sourcepub async fn get_local_only_contacts(&self) -> Vec<ContactRecord>
pub async fn get_local_only_contacts(&self) -> Vec<ContactRecord>
Get all local-only contacts
Sourcepub async fn get_linked_contacts(&self) -> Vec<ContactRecord>
pub async fn get_linked_contacts(&self) -> Vec<ContactRecord>
Get all network-linked contacts
Sourcepub async fn mark_entity_synced(&self, entity_id: &str) -> LinkingResult<Entity>
pub async fn mark_entity_synced(&self, entity_id: &str) -> LinkingResult<Entity>
Mark an entity as synced
Sourcepub async fn mark_contact_synced(
&self,
contact_id: &str,
) -> LinkingResult<ContactRecord>
pub async fn mark_contact_synced( &self, contact_id: &str, ) -> LinkingResult<ContactRecord>
Mark a contact as synced
Sourcepub async fn create_local_entity(
&self,
name: String,
entity_type: EntityType,
description: Option<String>,
created_by: String,
) -> LinkingResult<Entity>
pub async fn create_local_entity( &self, name: String, entity_type: EntityType, description: Option<String>, created_by: String, ) -> LinkingResult<Entity>
Create a local-only entity
Sourcepub async fn create_local_contact(
&self,
display_name: String,
) -> ContactResult<ContactRecord>
pub async fn create_local_contact( &self, display_name: String, ) -> ContactResult<ContactRecord>
Create a local-only contact
Auto Trait Implementations§
impl Freeze for LinkingService
impl !RefUnwindSafe for LinkingService
impl Send for LinkingService
impl Sync for LinkingService
impl Unpin for LinkingService
impl !UnwindSafe for LinkingService
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more