Enum ambient_api_core::message::Target
source · pub enum Target {
LocalBroadcast {
include_self: bool,
},
Local(EntityId),
ServerUnreliable,
ServerReliable,
ClientBroadcastUnreliable,
ClientBroadcastReliable,
ClientTargetedUnreliable(String),
ClientTargetedReliable(String),
}
Expand description
The target for a originating message.
Variants§
LocalBroadcast
Fields
A message to all other packages running on this side.
Local(EntityId)
A message to a specific package or module running on this side.
ServerUnreliable
client
only.An unreliable transmission to the server.
Not guaranteed to be received, and must be below one kilobyte.
Unreliable messages are implemented using QUIC datagrams. This makes them ideal for messages that are sent frequently, but are not critical to the functioning of the logic on the server.
Note that this message will only be received by the corresponding package on the server, and not by any other packages. You will need to explicitly relay the message to other packages on the server.
ServerReliable
client
only.A reliable transmission to the server (guaranteed to be received).
Reliable messages are implemented using QUIC streams. This makes them ideal for messages that are sent infrequently, but must be received by the server.
Note that this message will only be received by the corresponding package on the server, and not by any other packages. You will need to explicitly relay the message to other packages on the server.
ClientBroadcastUnreliable
server
only.An unreliable transmission to all clients.
Not guaranteed to be received, and must be below one kilobyte.
Unreliable messages are implemented using QUIC datagrams. This makes them ideal for messages that are sent frequently, but are not critical to the functioning of the logic on the client.
Note that this message will only be received by the corresponding package on the client, and not by any other packages. You will need to explicitly relay the message to other packages on the client.
ClientBroadcastReliable
server
only.A reliable transmission to all clients (guaranteed to be received).
Reliable messages are implemented using QUIC streams. This makes them ideal for messages that are sent infrequently, but must be received by the client.
Note that this message will only be received by the corresponding package on the client, and not by any other packages. You will need to explicitly relay the message to other packages on the client.
ClientTargetedUnreliable(String)
server
only.An unreliable transmission to a specific client.
Not guaranteed to be received, and must be below one kilobyte.
Unreliable messages are implemented using QUIC datagrams. This makes them ideal for messages that are sent frequently, but are not critical to the functioning of the logic on the client.
Note that this message will only be received by the corresponding package on the client, and not by any other packages. You will need to explicitly relay the message to other packages on the client.
ClientTargetedReliable(String)
server
only.A reliable transmission to a specific client (guaranteed to be received).
Reliable messages are implemented using QUIC streams. This makes them ideal for messages that are sent infrequently, but must be received by the client.
Note that this message will only be received by the corresponding package on the client, and not by any other packages. You will need to explicitly relay the message to other packages on the client.
Trait Implementations§
source§impl Ord for Target
impl Ord for Target
source§impl PartialEq for Target
impl PartialEq for Target
source§impl PartialOrd for Target
impl PartialOrd for Target
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Target
impl StructuralEq for Target
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnwindSafe for Target
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
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key
and return true
if they are equal.