pub struct ContactManager { /* private fields */ }Expand description
Manages contact database operations separate from Signal Protocol
Implementations§
Source§impl ContactManager
impl ContactManager
Sourcepub fn new(storage_connection: Arc<Mutex<Connection>>) -> Self
pub fn new(storage_connection: Arc<Mutex<Connection>>) -> Self
Creates a new contact manager with the given database connection
Sourcepub async fn add_contact_from_identity_key(
&mut self,
identity_key: &IdentityKey,
) -> Result<String, SignalBridgeError>
pub async fn add_contact_from_identity_key( &mut self, identity_key: &IdentityKey, ) -> Result<String, SignalBridgeError>
Sourcepub async fn add_contact_from_bundle(
&mut self,
bundle_bytes: &[u8],
user_alias: Option<&str>,
_session_store: &mut impl SessionStore,
) -> Result<String, SignalBridgeError>
pub async fn add_contact_from_bundle( &mut self, bundle_bytes: &[u8], user_alias: Option<&str>, _session_store: &mut impl SessionStore, ) -> Result<String, SignalBridgeError>
Sourcepub async fn lookup_contact(
&mut self,
identifier: &str,
session_store: &mut impl SessionStore,
) -> Result<ContactInfo, SignalBridgeError>
pub async fn lookup_contact( &mut self, identifier: &str, session_store: &mut impl SessionStore, ) -> Result<ContactInfo, SignalBridgeError>
Looks up a contact by RDX fingerprint, Nostr pubkey, or alias
§Arguments
identifier- RDX fingerprint, Nostr pubkey, or user aliassession_store- Session store to check for active sessions
Sourcepub async fn assign_contact_alias(
&mut self,
identifier: &str,
new_alias: &str,
session_store: &mut impl SessionStore,
) -> Result<(), SignalBridgeError>
pub async fn assign_contact_alias( &mut self, identifier: &str, new_alias: &str, session_store: &mut impl SessionStore, ) -> Result<(), SignalBridgeError>
Assigns or updates an alias for a contact
§Arguments
identifier- RDX fingerprint, Nostr pubkey, or current aliasnew_alias- New alias to assignsession_store- Session store for contact lookup
Sourcepub async fn list_contacts(
&mut self,
session_store: &mut impl SessionStore,
) -> Result<Vec<ContactInfo>, SignalBridgeError>
pub async fn list_contacts( &mut self, session_store: &mut impl SessionStore, ) -> Result<Vec<ContactInfo>, SignalBridgeError>
Returns all known contacts ordered by last update
§Arguments
session_store- Session store to check for active sessions
Sourcepub fn generate_identity_fingerprint_from_key(
identity_key: &IdentityKey,
) -> String
pub fn generate_identity_fingerprint_from_key( identity_key: &IdentityKey, ) -> String
Auto Trait Implementations§
impl Freeze for ContactManager
impl RefUnwindSafe for ContactManager
impl Send for ContactManager
impl Sync for ContactManager
impl Unpin for ContactManager
impl UnwindSafe for ContactManager
Blanket Implementations§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more