pub struct WebTransportServer { /* private fields */ }Expand description
Implementation of ServerSocket for WebTransport servers.
The server handles connections internally with tokio.
Implementations§
Source§impl WebTransportServer
impl WebTransportServer
Sourcepub fn new(
config: WebTransportServerConfig,
handle: Handle,
) -> Result<Self, Error>
pub fn new( config: WebTransportServerConfig, handle: Handle, ) -> Result<Self, Error>
Makes a new server.
§Errors
- Errors if unable to build a
rustls::ServerConfig. - Errors if unable to bind to the
WebTransportServerConfig::listenaddress, which can happen if your machine is using all ports on a pre-defined IP address.
Trait Implementations§
Source§impl Debug for WebTransportServer
impl Debug for WebTransportServer
Source§impl Drop for WebTransportServer
impl Drop for WebTransportServer
Source§impl ServerSocket for WebTransportServer
impl ServerSocket for WebTransportServer
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, addr: SocketAddr)
fn connection_denied(&mut self, addr: SocketAddr)
Notifies the data source that an address’s connection request was denied. Read more
Source§fn connection_accepted(&mut self, client_id: u64, addr: SocketAddr)
fn connection_accepted(&mut self, client_id: u64, addr: SocketAddr)
Notifies the data source that an address’s connection request was accepted. Read more
Source§fn disconnect(&mut self, addr: SocketAddr)
fn disconnect(&mut self, addr: 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 WebTransportServer
impl !RefUnwindSafe for WebTransportServer
impl Send for WebTransportServer
impl Sync for WebTransportServer
impl Unpin for WebTransportServer
impl !UnwindSafe for WebTransportServer
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>
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.