pub struct ConnectionManager {
pub delta_manager: DeltaManager,
/* private fields */
}
Fields§
§delta_manager: DeltaManager
Implementations§
Source§impl ConnectionManager
impl ConnectionManager
Sourcepub fn client_entity(&self, client_id: ClientId) -> Result<Entity, ServerError>
pub fn client_entity(&self, client_id: ClientId) -> Result<Entity, ServerError>
Sourcepub fn connected_clients(&self) -> impl Iterator<Item = ClientId> + '_
pub fn connected_clients(&self) -> impl Iterator<Item = ClientId> + '_
Return the list of connected ClientId
s
Sourcepub fn map_entities_to_remote<M: Message + MapEntities>(
&mut self,
message: &mut M,
client_id: ClientId,
) -> Result<(), ServerError>
pub fn map_entities_to_remote<M: Message + MapEntities>( &mut self, message: &mut M, client_id: ClientId, ) -> Result<(), ServerError>
Convert entities in the message to be compatible with the remote world of the provided client
Sourcepub fn update_priority(
&mut self,
replication_group_id: ReplicationGroupId,
client_id: ClientId,
priority: f32,
) -> Result<(), ServerError>
pub fn update_priority( &mut self, replication_group_id: ReplicationGroupId, client_id: ClientId, priority: f32, ) -> Result<(), ServerError>
Update the priority of a ReplicationGroup
that is replicated to a given client
pub fn connection( &self, client_id: ClientId, ) -> Result<&Connection, ServerError>
pub fn connection_mut( &mut self, client_id: ClientId, ) -> Result<&mut Connection, ServerError>
Source§impl ConnectionManager
impl ConnectionManager
Sourcepub fn send_message_to_room<C: Channel, M: Message>(
&mut self,
message: &M,
room_id: RoomId,
room_manager: &RoomManager,
) -> Result<(), ServerError>
pub fn send_message_to_room<C: Channel, M: Message>( &mut self, message: &M, room_id: RoomId, room_manager: &RoomManager, ) -> Result<(), ServerError>
Send a message to all clients in a room
Sourcepub fn send_message<C: Channel, M: Message>(
&mut self,
client_id: ClientId,
message: &M,
) -> Result<(), ServerError>
pub fn send_message<C: Channel, M: Message>( &mut self, client_id: ClientId, message: &M, ) -> Result<(), ServerError>
Queues up a message to be sent to a client
Trait Implementations§
Source§impl Default for ConnectionManager
impl Default for ConnectionManager
Source§impl MessageSend for ConnectionManager
impl MessageSend for ConnectionManager
Source§fn send_message_to_target<C: Channel, M: Message>(
&mut self,
message: &M,
target: NetworkTarget,
) -> Result<(), Self::Error>
fn send_message_to_target<C: Channel, M: Message>( &mut self, message: &M, target: NetworkTarget, ) -> Result<(), Self::Error>
Send a message to a target via a channel
impl Resource for ConnectionManager
Auto Trait Implementations§
impl Freeze for ConnectionManager
impl RefUnwindSafe for ConnectionManager
impl Send for ConnectionManager
impl Sync for ConnectionManager
impl Unpin for ConnectionManager
impl UnwindSafe for ConnectionManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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 Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.
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