pub enum ProtocolMessage {
Show 26 variants
Hello {
protocol_version: u32,
session: String,
},
Challenge {
nonce: Vec<u8>,
},
Auth {
pubkey: Vec<u8>,
signature: Vec<u8>,
},
Established {
path: SessionPath,
},
Register {
username: String,
machine: String,
pubkey: Vec<u8>,
},
Join {
channel: String,
token: Option<String>,
},
Leave {
channel: String,
},
Who {
channel: Option<String>,
},
Admin(AdminOp),
ChannelMsg {
channel: String,
from: SessionPath,
payload: Payload,
},
Whisper {
from: SessionPath,
target: SessionPath,
payload: Payload,
},
Presence {
channel: Option<String>,
sessions: Vec<SessionPath>,
},
Error(ProtocolError),
ListChannels,
ChannelList {
channels: Vec<ChannelInfo>,
},
Joined {
channel: String,
},
Ack {
detail: Option<String>,
},
InviteToken {
token: String,
},
Ping,
Pong,
ServerInfo {
admin: bool,
},
ListMachines,
MachineList {
machines: Vec<MachineInfo>,
},
ListUsers,
UserList {
users: Vec<String>,
},
InviteList {
invites: Vec<InviteInfo>,
},
}Expand description
The versioned frame exchanged between a bridge and a central server.
Variants are append-only across protocol versions: later milestones may add variants but must
not renumber or repurpose existing ones without a version bump (see negotiate_version).
Variants§
Hello
Client → server on connect: advertise the protocol version and the session handle.
Fields
Challenge
Server → client: a random nonce for the client to sign (challenge-response).
Auth
Client → server: the machine public key and its signature over the nonce.
Fields
Established
Server → client: authentication succeeded; the resolved full participant path.
Fields
path: SessionPathThe resolved user/machine/session path.
Register
Client → server: claim a username and enroll this machine as its first key.
Fields
Join
Client → server: join a channel, optionally redeeming an invite token.
Leave
Client → server: leave a channel.
Who
Client → server: request presence, optionally scoped to one channel.
Admin(AdminOp)
Client → server: an admin / moderation operation.
ChannelMsg
A message addressed to all sessions subscribed to a channel.
Fields
from: SessionPathThe sender’s full participant path.
Whisper
A direct message to exactly one session path.
Fields
from: SessionPathThe sender’s full participant path.
target: SessionPathThe single recipient’s full participant path.
Presence
Server → client: presence enumerated as full session paths.
Fields
sessions: Vec<SessionPath>The present sessions.
Error(ProtocolError)
A typed error surfaced to the peer that triggered it.
ListChannels
Client → server: request the channels visible to the authenticated user (discovery).
ChannelList
Server → client: the discovery result, already visibility-gated.
Fields
channels: Vec<ChannelInfo>The channels the caller may see.
Joined
Server → client: a ProtocolMessage::Join succeeded; the session is now subscribed.
Ack
Server → client: a control / admin operation succeeded, with an optional human detail.
InviteToken
Server → client: the token minted by an AdminOp::InviteCreate.
Ping
Client → server: liveness keepalive; refreshes presence and draws a ProtocolMessage::Pong
(the application-level realization of the §10 heartbeat, uniform across transports).
Pong
Server → client: keepalive acknowledgement.
ServerInfo
Server → client, immediately after ProtocolMessage::Established: the authenticated user’s
server-wide role, so the bridge can gate its admin tools (DESIGN.md §7).
ListMachines
Client → server: list the machines enrolled under the authenticated user.
MachineList
Server → client: the caller’s enrolled machines.
Fields
machines: Vec<MachineInfo>The machines under the caller’s account.
ListUsers
Client → server: list the server’s users (server-admin only).
UserList
Server → client: the registered usernames (server-admin only).
InviteList
Server → client: a channel’s outstanding invites (channel-admin audit, PRD-0011).
Fields
invites: Vec<InviteInfo>The outstanding invites.
Trait Implementations§
Source§impl Clone for ProtocolMessage
impl Clone for ProtocolMessage
Source§fn clone(&self) -> ProtocolMessage
fn clone(&self) -> ProtocolMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProtocolMessage
impl Debug for ProtocolMessage
Source§impl<'de> Deserialize<'de> for ProtocolMessage
impl<'de> Deserialize<'de> for ProtocolMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ProtocolMessage
Source§impl PartialEq for ProtocolMessage
impl PartialEq for ProtocolMessage
Source§fn eq(&self, other: &ProtocolMessage) -> bool
fn eq(&self, other: &ProtocolMessage) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ProtocolMessage
impl Serialize for ProtocolMessage
impl StructuralPartialEq for ProtocolMessage
Auto Trait Implementations§
impl Freeze for ProtocolMessage
impl RefUnwindSafe for ProtocolMessage
impl Send for ProtocolMessage
impl Sync for ProtocolMessage
impl Unpin for ProtocolMessage
impl UnsafeUnpin for ProtocolMessage
impl UnwindSafe for ProtocolMessage
Blanket Implementations§
impl<T> AsyncFriendly for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request