Enum ambient_api::message::Source
source · pub enum Source {
Runtime,
Server,
Client {
user_id: String,
},
Local(EntityId),
}
Expand description
Where a message came from.
Variants§
Runtime
This message came from the runtime.
Server
Available on crate feature
client
only.This message came from the corresponding serverside package.
Client
Available on crate feature
server
only.This message came from the corresponding clientside package and was sent from user_id
.
Local(EntityId)
This message came from another package on this side.
Implementations§
source§impl Source
impl Source
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§
source§impl Ord for Source
impl Ord for Source
source§impl PartialEq for Source
impl PartialEq for Source
source§impl PartialOrd for Source
impl PartialOrd for Source
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Source
impl StructuralEq for Source
impl StructuralPartialEq for Source
Auto Trait Implementations§
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnwindSafe for Source
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.
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
Compare self to
key
and return true
if they are equal.