pub struct SocketMessage {
pub sender_name: Option<String>,
pub sender_type: Option<String>,
pub message: String,
pub message_type: SocketMessageType,
}
Expand description
Represents a message sent from the game
Fields§
§sender_name: Option<String>
The name of the sender, usually the name of the mod
sender_type: Option<String>
The type of the sender, usually ModHelper
message: String
The message sent from the game
message_type: SocketMessageType
The type of message sent from the game
Note that the message sent calls this type
so we have to alias it because type is a reserved keyword
Implementations§
Source§impl SocketMessage
impl SocketMessage
Sourcepub fn make_internal(message: &str, message_type: SocketMessageType) -> Self
pub fn make_internal(message: &str, message_type: SocketMessageType) -> Self
Make an internal SocketMessage to send to the server for debugging/information.
§Returns
A SocketMessage with sender_name set to “Manager” and sender_type set to “Log Server”.
Trait Implementations§
Source§impl Clone for SocketMessage
impl Clone for SocketMessage
Source§fn clone(&self) -> SocketMessage
fn clone(&self) -> SocketMessage
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SocketMessage
impl Debug for SocketMessage
Source§impl<'de> Deserialize<'de> for SocketMessage
impl<'de> Deserialize<'de> for SocketMessage
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SocketMessage
impl PartialEq for SocketMessage
Source§impl Searchable for SocketMessage
impl Searchable for SocketMessage
Source§fn get_values(&self) -> Vec<String>
fn get_values(&self) -> Vec<String>
Get the values that can be searched
Each value will be weighted based on its position in the list (first is most important)
Values are automatically normalized for optimal searching via normalize_value when using search_list
Source§impl Serialize for SocketMessage
impl Serialize for SocketMessage
impl StructuralPartialEq for SocketMessage
Auto Trait Implementations§
impl Freeze for SocketMessage
impl RefUnwindSafe for SocketMessage
impl Send for SocketMessage
impl Sync for SocketMessage
impl Unpin for SocketMessage
impl UnwindSafe for SocketMessage
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,
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>
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