Struct ambient_api::message::MessageContext
source · pub struct MessageContext {
pub source: Source,
pub listener: Listener,
}
Expand description
Message context.
Fields§
§source: Source
Where the message came from.
listener: Listener
The listener that can be used to stop listening.
Implementations§
source§impl MessageContext
impl MessageContext
sourcepub fn server(&self) -> bool
Available on crate feature client
only.
pub fn server(&self) -> bool
client
only.Is this message from the corresponding serverside package?
sourcepub fn client_user_id(&self) -> Option<String>
Available on crate feature server
only.
pub fn client_user_id(&self) -> Option<String>
server
only.The user that sent this message, if any.
sourcepub fn client_entity_id(&self) -> Option<EntityId>
Available on crate feature server
only.
pub fn client_entity_id(&self) -> Option<EntityId>
server
only.The entity ID of the player that sent this message, if any.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for MessageContext
impl Send for MessageContext
impl Sync for MessageContext
impl Unpin for MessageContext
impl UnwindSafe for MessageContext
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> Downcast for T
impl<T> Downcast for T
source§impl<T> ElementComponentName for T
impl<T> ElementComponentName for T
source§fn element_component_name(&self) -> &'static str
fn element_component_name(&self) -> &'static str
Returns the name of the type implementing ElementComponent.