pub struct NativeSocket { /* private fields */ }Expand description
Implementation of ServerSocket for UdpSockets.
Implementations§
Source§impl NativeSocket
impl NativeSocket
Sourcepub fn new(socket: UdpSocket) -> Result<Self, NetcodeError>
pub fn new(socket: UdpSocket) -> Result<Self, NetcodeError>
Makes a new native socket.
Trait Implementations§
Source§impl ClientSocket for NativeSocket
impl ClientSocket for NativeSocket
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 Debug for NativeSocket
impl Debug for NativeSocket
Source§impl ServerSocket for NativeSocket
impl ServerSocket for NativeSocket
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 connection_denied(&mut self, _: SocketAddr)
fn connection_denied(&mut self, _: SocketAddr)
Notifies the data source that an address’s connection request was denied. Read more
Source§fn connection_accepted(&mut self, _: u64, _: SocketAddr)
fn connection_accepted(&mut self, _: u64, _: SocketAddr)
Notifies the data source that an address’s connection request was accepted. Read more
Source§fn disconnect(&mut self, _: SocketAddr)
fn disconnect(&mut self, _: SocketAddr)
Disconnects a remote connection with the given address.
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
Auto Trait Implementations§
impl Freeze for NativeSocket
impl RefUnwindSafe for NativeSocket
impl Send for NativeSocket
impl Sync for NativeSocket
impl Unpin for NativeSocket
impl UnwindSafe for NativeSocket
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> 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> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.