pub enum ServerMessage {
Error(StatusCode, String),
NewSession(SessionRequest),
SessionConnection {
session_id: SessionId,
peer_key: Vec<u8>,
},
SessionCreated(SessionState),
SessionReady(SessionState),
SessionActive(SessionState),
CloseSession(SessionId),
SessionFinished(SessionId),
// some variants omitted
}
Expand description
Message sent between the server and a client.
Variants§
Error(StatusCode, String)
Return an error message to the client.
NewSession(SessionRequest)
Request a new session.
SessionConnection
Register a peer connection in a session.
SessionCreated(SessionState)
Response to a new session request.
SessionReady(SessionState)
Notification dispatched to all participants in a session when they have all completed the server handshake.
SessionActive(SessionState)
Notification dispatched to all participants in a session when they have all established peer connections to each other.
CloseSession(SessionId)
Request to close a session.
SessionFinished(SessionId)
Message sent when a session was closed.
Trait Implementations§
source§impl Debug for ServerMessage
impl Debug for ServerMessage
source§impl Decodable for ServerMessage
impl Decodable for ServerMessage
source§fn decode<'life0, 'life1, 'async_trait, R>(
&'life0 mut self,
reader: &'life1 mut BinaryReader<R>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
R: 'async_trait + AsyncRead + AsyncSeek + Unpin + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn decode<'life0, 'life1, 'async_trait, R>( &'life0 mut self, reader: &'life1 mut BinaryReader<R> ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where R: 'async_trait + AsyncRead + AsyncSeek + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Decode from the binary reader into self.
source§impl Default for ServerMessage
impl Default for ServerMessage
source§fn default() -> ServerMessage
fn default() -> ServerMessage
Returns the “default value” for a type. Read more
source§impl Encodable for ServerMessage
impl Encodable for ServerMessage
source§fn encode<'life0, 'life1, 'async_trait, W>(
&'life0 self,
writer: &'life1 mut BinaryWriter<W>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
W: 'async_trait + AsyncWrite + AsyncSeek + Unpin + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn encode<'life0, 'life1, 'async_trait, W>( &'life0 self, writer: &'life1 mut BinaryWriter<W> ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where W: 'async_trait + AsyncWrite + AsyncSeek + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Encode self into the binary writer.
source§impl From<&ServerMessage> for u8
impl From<&ServerMessage> for u8
source§fn from(value: &ServerMessage) -> Self
fn from(value: &ServerMessage) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for ServerMessage
impl Send for ServerMessage
impl Sync for ServerMessage
impl Unpin for ServerMessage
impl UnwindSafe for ServerMessage
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