Skip to main content

AppEvent

Enum AppEvent 

Source
pub enum AppEvent {
Show 33 variants RoomDiscovered(DiscoveredRoom), RoomLost { room_id: String, }, RoomJoined { room_id: String, }, RoomLeft { room_id: String, }, MemberJoined { room_id: String, fingerprint: String, }, MemberLeft { room_id: String, fingerprint: String, }, MessageReceived { room_id: String, sender_fingerprint: String, body: String, sent_at: i64, }, MessageSent { room_id: String, body: String, message_id: i64, }, ListeningOn { address: String, }, PeerDiscovered { peer_id: PeerId, }, PeerExpired { peer_id: PeerId, }, Dialing { address: String, }, DialSucceeded { address: String, peer_id: PeerId, }, DialFailed { address: String, error: String, }, Error { description: String, }, FileOffered { room_id: String, file_id: String, name: String, size_bytes: u64, sender_fingerprint: String, }, FileProgress { file_id: String, bytes_received: u64, total_bytes: u64, }, FileReady { file_id: String, }, FileSaved { file_id: String, path: String, }, FileFailed { file_id: String, reason: String, }, RotationRequested { room_id: String, rotator_fingerprint: String, new_salt: Vec<u8>, }, TypingChanged { room_id: String, }, MentionReceived { room_id: String, body: String, }, InboundDial { peer_id: PeerId, fingerprint: String, address: String, }, SasCodeReady { room_id: String, partner_fingerprint: String, tx_id: String, emoji_labels: String, decimal: String, }, SasVerified { room_id: String, partner_fingerprint: String, }, CodeJoinTimedOut { room_id: String, reason: String, }, InviteFingerprintMismatch { address: String, claimed: String, actual: String, }, NatStatusChanged { label: String, reachable: bool, }, DcutrSucceeded { peer_label: String, }, PeerProfileUpdated { fingerprint: String, username: Option<String>, }, WentDark, AutoOpenDm { room_id: String, fingerprint: String, },
}

Variants§

§

RoomDiscovered(DiscoveredRoom)

A room was discovered (announced on the global topic).

§

RoomLost

A previously-discovered room hasn’t been re-announced — TTL expired.

Fields

§room_id: String
§

RoomJoined

We successfully joined a room (subscribed to its topic).

Fields

§room_id: String
§

RoomLeft

We left a room.

Fields

§room_id: String
§

MemberJoined

A new member appeared in a room we’re in.

Fields

§room_id: String
§fingerprint: String
§

MemberLeft

A member left a room we’re in.

Fields

§room_id: String
§fingerprint: String
§

MessageReceived

A message arrived in a room.

Fields

§room_id: String
§sender_fingerprint: String
§body: String
§sent_at: i64
§

MessageSent

Our own message was sent successfully.

Fields

§room_id: String
§body: String
§message_id: i64
§

ListeningOn

Listening on a network address.

Fields

§address: String
§

PeerDiscovered

A peer was discovered on the LAN.

Fields

§peer_id: PeerId
§

PeerExpired

A peer’s mDNS presence expired — they left the LAN or stopped announcing. The lobby refreshes its online/offline indicators.

Fields

§peer_id: PeerId
§

Dialing

We’ve fired a dial command — useful for the UI to show “dialing…”.

Fields

§address: String
§

DialSucceeded

A user-initiated dial completed successfully.

Fields

§address: String
§peer_id: PeerId
§

DialFailed

A user-initiated dial failed.

Fields

§address: String
§error: String
§

Error

Non-fatal error.

Fields

§description: String
§

FileOffered

Someone (us or a peer) offered a file in a room.

Fields

§room_id: String
§file_id: String
§name: String
§size_bytes: u64
§sender_fingerprint: String
§

FileProgress

A chunk of an incoming transfer arrived. total_bytes is the announced size from the offer.

Fields

§file_id: String
§bytes_received: u64
§total_bytes: u64
§

FileReady

All chunks of a transfer received and SHA-256 verified.

Fields

§file_id: String
§

FileSaved

User saved a ready file to Downloads.

Fields

§file_id: String
§path: String
§

FileFailed

A transfer failed (hash mismatch, decrypt error, IO error).

Fields

§file_id: String
§reason: String
§

RotationRequested

A peer initiated a key rotation in a room we’re in. The UI surfaces a modal asking the user to enter the new passphrase.

Fields

§room_id: String
§rotator_fingerprint: String
§new_salt: Vec<u8>
§

TypingChanged

Someone in a room started typing. The UI re-reads typing peers from AppHandle::typers_in_room on each render; the event is just a nudge.

Fields

§room_id: String
§

MentionReceived

A received message included our fingerprint (full or short form). The TUI uses this to ring the terminal bell, even in muted rooms.

Fields

§room_id: String
§body: String
§

InboundDial

Phase A: an unknown peer has dialed us and Identify has completed. The TUI shows an accept/reject/trust modal with the peer’s short fingerprint. Routed through replace_modal_if_idle so it doesn’t clobber whatever the user is typing.

Fields

§peer_id: PeerId
§fingerprint: String

24-char fingerprint, freshly derived from the peer’s Ed25519 pubkey via Identify — proves they hold the matching key.

§address: String

String form of the listener-side multiaddr (the address as seen from our side of the connection). Mostly informational for the user; we persist it on accept so the lobby online dot tracks the peer.

§

SasCodeReady

Phase G: SAS code is ready on both sides — both ephemeral X25519 pubkeys exchanged + ECDH derived. The TUI shows the SAS as its word list (emoji_labels) + decimal and the Match/Cancel buttons. huddle 0.9: the glyph form was dropped from the UI (emoji-free), so it’s no longer carried here.

Fields

§room_id: String
§partner_fingerprint: String
§tx_id: String
§emoji_labels: String
§decimal: String
§

SasVerified

Phase G: SAS completed — both sides confirmed the match. The partner’s fingerprint is now verified (per-room + global).

Fields

§room_id: String
§partner_fingerprint: String
§

CodeJoinTimedOut

Phase F follow-up: 30 seconds passed since we broadcast a CodeJoinRequest and no CodeJoinResponse ever came back. The owner either ignored us (bad/expired code), wasn’t online, or the network dropped our packet. Fired by the timeout task spawned in join_room_with_code once it confirms our pending secret is still sitting in the map.

Fields

§room_id: String
§reason: String
§

InviteFingerprintMismatch

Phase C follow-up: we dialed a peer via an invite link, the peer identified, and the fingerprint they cryptographically asserted doesn’t match the one the invite claimed. The connection has already been dropped. The TUI shows an error modal so the user knows the link is forged or stale.

Fields

§address: String
§claimed: String
§actual: String
§

NatStatusChanged

Phase D follow-up: aggregated NAT reachability state derived from the AutoNAT probe stream. The app layer maintains a small “do any probes say reachable?” tally; this event fires when that aggregate changes. The TUI renders it as a badge in the lobby header (‘reachable’ / ‘private’ / ‘detecting’).

Fields

§label: String
§reachable: bool
§

DcutrSucceeded

Phase D follow-up: a successful DCUtR upgrade — a relay-hopped connection became direct. The TUI shows a transient status line (“direct connection to ”). Fires only on success; failures stay in the debug log.

Fields

§peer_label: String
§

PeerProfileUpdated

huddle 0.5: a peer announced or cleared their self-declared username via a signed ProfileUpdate. username = None means the peer is now [anonymous]. TUI consumers redraw the chat

  • member list so the new label flows through.

Fields

§fingerprint: String
§username: Option<String>
§

WentDark

huddle 0.5: the local user’s go_dark call succeeded — every joined room got a best-effort MemberLeave, the network task shut down, and the data dir was wiped. TUI shows a final “Goodbye” modal and exits the process.

§

AutoOpenDm

huddle 0.7.7: a user-initiated dial (d / a / paste-invite / People-pane reconnect) connected, Identify completed, and we’ve idempotently opened a DM with the freshly-identified peer. The TUI listens for this and switches its pane to Dm(room_id) so the user lands in a chat surface instead of having to hunt for a way to message the peer they just dialed.

Auto-reconnects on startup do NOT fire this — we consume the address from pending_auto_dm_addrs and only the user-initiated paths register there in the first place.

Fields

§room_id: String
§fingerprint: String

Trait Implementations§

Source§

impl Clone for AppEvent

Source§

fn clone(&self) -> AppEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AppEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more