pub struct AppHandle { /* private fields */ }Implementations§
Source§impl AppHandle
impl AppHandle
pub async fn start() -> Result<Self>
pub async fn start_with_options( mode: NetworkMode, port: u16, master_key: Option<&[u8; 32]>, ) -> Result<Self>
pub async fn start_with_db(db: Db) -> Result<Self>
pub async fn start_with_db_and_options( db: Db, mode: NetworkMode, port: u16, ) -> Result<Self>
pub fn mode(&self) -> NetworkMode
pub fn subscribe(&self) -> Receiver<AppEvent>
pub fn fingerprint(&self) -> &str
pub fn peer_id(&self) -> PeerId
pub fn discovered_rooms(&self) -> Vec<DiscoveredRoom>
pub fn active_room_ids(&self) -> Vec<String>
pub fn active_room_info(&self, room_id: &str) -> Option<StoredRoom>
pub fn room_members(&self, room_id: &str) -> Vec<String>
pub fn room_messages( &self, room_id: &str, limit: i64, ) -> Result<Vec<StoredRoomMessage>>
pub fn search_room_messages( &self, room_id: &str, query: &str, limit: i64, ) -> Result<Vec<StoredRoomMessage>>
Sourcepub async fn start_room(
&self,
name: &str,
encrypted: bool,
passphrase: Option<&str>,
) -> Result<String>
pub async fn start_room( &self, name: &str, encrypted: bool, passphrase: Option<&str>, ) -> Result<String>
Create a new room. Returns its room_id.
Sourcepub async fn join_room(
&self,
room_id: &str,
passphrase: Option<&str>,
) -> Result<()>
pub async fn join_room( &self, room_id: &str, passphrase: Option<&str>, ) -> Result<()>
Join an existing room. The room may come from a live announcement
(preferred), our restorable set, or the DB directly — whichever has
the freshest copy. For encrypted rooms passphrase is required.
pub async fn leave_room(&self, room_id: &str) -> Result<()>
pub async fn send_room_message(&self, room_id: &str, body: &str) -> Result<()>
pub async fn shutdown(&self)
Sourcepub async fn dial(&self, input: &str) -> Result<()>
pub async fn dial(&self, input: &str) -> Result<()>
Dial a peer by a user-entered address. Accepts:
1.2.3.4:9000[fe80::1]:9000/ip4/.../tcp/...[/p2p/<peer>](raw multiaddr)
pub fn known_peers(&self) -> Vec<KnownPeerStatus>
pub async fn forget_peer(&self, address: &str) -> Result<()>
Sourcepub async fn redial(&self, address: &str) -> Result<()>
pub async fn redial(&self, address: &str) -> Result<()>
Re-dial a stored address — used by the lobby’s “reconnect” action.
Sourcepub async fn send_file(&self, room_id: &str, path: &Path) -> Result<String>
pub async fn send_file(&self, room_id: &str, path: &Path) -> Result<String>
Send a local file to a room. Reads the file, optionally encrypts it for encrypted rooms, chunks it, broadcasts a FileOffer then each FileChunk. Returns the file_id once all chunks are queued.
Sourcepub async fn save_to_downloads(
&self,
room_id: &str,
file_id: &str,
) -> Result<PathBuf>
pub async fn save_to_downloads( &self, room_id: &str, file_id: &str, ) -> Result<PathBuf>
Save a completed/ready attachment to the user’s Downloads folder. Decrypts encrypted attachments on the way out.
Sourcepub async fn cancel_transfer(&self, room_id: &str, file_id: &str) -> Result<()>
pub async fn cancel_transfer(&self, room_id: &str, file_id: &str) -> Result<()>
Drop any in-flight chunks and remove the attachment row.
Sourcepub fn open_saved(&self, room_id: &str, file_id: &str) -> Result<()>
pub fn open_saved(&self, room_id: &str, file_id: &str) -> Result<()>
Launch the system’s default opener on a saved file.
pub fn list_room_attachments( &self, room_id: &str, ) -> Result<Vec<StoredAttachment>>
Sourcepub fn set_member_verified(
&self,
room_id: &str,
fingerprint: &str,
verified: bool,
) -> Result<()>
pub fn set_member_verified( &self, room_id: &str, fingerprint: &str, verified: bool, ) -> Result<()>
Mark a peer’s fingerprint as verified in the given room. Used by
the ^V verification modal after the user has compared the
fingerprint out-of-band.
pub fn verified_fingerprints(&self, room_id: &str) -> Vec<String>
pub fn display_name(&self) -> Option<String>
pub fn set_display_name(&self, name: Option<&str>) -> Result<()>
Sourcepub fn lookup_member_display_name(&self, fingerprint: &str) -> Option<String>
pub fn lookup_member_display_name(&self, fingerprint: &str) -> Option<String>
Look up the display name we’ve seen for a peer in any room.
pub fn is_room_muted(&self, room_id: &str) -> bool
pub fn set_room_muted(&self, room_id: &str, muted: bool) -> Result<()>
Sourcepub async fn broadcast_typing(&self, room_id: &str)
pub async fn broadcast_typing(&self, room_id: &str)
Broadcast a “I’m typing” pulse to the given room. Caller is responsible for debouncing (don’t fire more than every ~500ms).
Sourcepub fn typers_in_room(&self, room_id: &str) -> Vec<String>
pub fn typers_in_room(&self, room_id: &str) -> Vec<String>
Returns the fingerprints of peers currently typing in room_id,
pruning entries past their TTL.
Sourcepub async fn rotate_room(
&self,
room_id: &str,
new_passphrase: &str,
) -> Result<()>
pub async fn rotate_room( &self, room_id: &str, new_passphrase: &str, ) -> Result<()>
Rotate this room’s outbound Megolm session under a fresh
passphrase. Broadcasts RotateRoomKey (so other members know to
expect a new passphrase) and a fresh MemberAnnounce with the
new wrapped session key. Old inbound sessions stay in storage
for decrypting historic messages.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppHandle
impl !RefUnwindSafe for AppHandle
impl Send for AppHandle
impl Sync for AppHandle
impl Unpin for AppHandle
impl UnsafeUnpin for AppHandle
impl !UnwindSafe for AppHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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