pub struct MemorySocketClient { /* private fields */ }Expand description
Implementation of ClientSocket for clients of an in-memory channel server socket.
In-memory sockets are treated as encrypted and reliable by default for efficiency. Use Self::new_with to use
a different policy (this is useful for performane tests).
Implementations§
Source§impl MemorySocketClient
impl MemorySocketClient
Sourcepub fn new(client_id: u16, channels: MemorySocketChannels) -> Self
pub fn new(client_id: u16, channels: MemorySocketChannels) -> Self
Makes a new in-memory client socket.
Trait Implementations§
Source§impl ClientSocket for MemorySocketClient
impl ClientSocket for MemorySocketClient
Source§fn is_encrypted(&self) -> bool
fn is_encrypted(&self) -> bool
Gets the encryption behavior of the socket. Read more
Source§fn is_reliable(&self) -> bool
fn is_reliable(&self) -> bool
Gets the reliability of the socket. Read more
Source§fn preupdate(&mut self)
fn preupdate(&mut self)
Handles data-source-specific logic that must run before receiving packets.
Source§fn try_recv(&mut self, buffer: &mut [u8]) -> Result<(usize, SocketAddr)>
fn try_recv(&mut self, buffer: &mut [u8]) -> Result<(usize, SocketAddr)>
Tries to receive the next packet sent to this data source. Read more
Source§fn postupdate(&mut self)
fn postupdate(&mut self)
Handles data-source-specific logic that must run after sending packets.
Source§fn send(
&mut self,
addr: SocketAddr,
packet: &[u8],
) -> Result<(), NetcodeTransportError>
fn send( &mut self, addr: SocketAddr, packet: &[u8], ) -> Result<(), NetcodeTransportError>
Sends a packet to the designated address. Read more
Source§impl Clone for MemorySocketClient
impl Clone for MemorySocketClient
Source§fn clone(&self) -> MemorySocketClient
fn clone(&self) -> MemorySocketClient
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 moreAuto Trait Implementations§
impl Freeze for MemorySocketClient
impl RefUnwindSafe for MemorySocketClient
impl Send for MemorySocketClient
impl Sync for MemorySocketClient
impl Unpin for MemorySocketClient
impl UnwindSafe for MemorySocketClient
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<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>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> 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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.