pub enum ServerMsg {
    Info(ServerInfo),
    Init(Box<ServerInit>),
    RegisterAnswer(ServerRegisterAnswer),
    General(ServerGeneral),
    Ping(PingMsg),
}Expand description
This struct contains all messages the server might send (on different streams though)
Variants§
Info(ServerInfo)
Basic info about server, send ONCE, clients need it to Register
Init(Box<ServerInit>)
Initial data package, send BEFORE Register ONCE. Not Register relevant
RegisterAnswer(ServerRegisterAnswer)
Result to ClientMsg::Register. send ONCE
General(ServerGeneral)
Msg that can be send ALWAYS as soon as client is registered, e.g. Chat
Ping(PingMsg)
Implementations§
Source§impl ServerMsg
 
impl ServerMsg
pub fn verify( &self, c_type: ClientType, registered: bool, presence: Option<PresenceKind>, ) -> bool
Trait Implementations§
Source§impl From<Result<(), RegisterError>> for ServerMsg
 
impl From<Result<(), RegisterError>> for ServerMsg
Source§fn from(o: ServerRegisterAnswer) -> ServerMsg
 
fn from(o: ServerRegisterAnswer) -> ServerMsg
Converts to this type from the input type.
Source§impl From<ServerGeneral> for ServerMsg
 
impl From<ServerGeneral> for ServerMsg
Source§fn from(o: ServerGeneral) -> ServerMsg
 
fn from(o: ServerGeneral) -> ServerMsg
Converts to this type from the input type.
Source§impl From<ServerInfo> for ServerMsg
 
impl From<ServerInfo> for ServerMsg
Source§fn from(o: ServerInfo) -> ServerMsg
 
fn from(o: ServerInfo) -> ServerMsg
Converts to this type from the input type.
Source§impl From<ServerInit> for ServerMsg
 
impl From<ServerInit> for ServerMsg
Source§fn from(o: ServerInit) -> ServerMsg
 
fn from(o: ServerInit) -> ServerMsg
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ServerMsg
impl !RefUnwindSafe for ServerMsg
impl Send for ServerMsg
impl Sync for ServerMsg
impl Unpin for ServerMsg
impl !UnwindSafe for ServerMsg
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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
§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