pub struct WebTransportServer { /* private fields */ }Available on crate feature
netcode only.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<WebTransportServer, Error>
pub fn new( config: WebTransportServerConfig, handle: Handle, ) -> Result<WebTransportServer, 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), Error>
fn try_recv(&mut self, buffer: &mut [u8]) -> Result<(usize, SocketAddr), Error>
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 UnsafeUnpin 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>
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> 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 moreSource§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.