pub struct Server { /* private fields */ }Expand description
A QUIC endpoint accepting clients.
Implementations§
Source§impl Server
impl Server
Sourcepub fn bind(addr: SocketAddr, config: ServerConfig) -> StreamResult<Self>
pub fn bind(addr: SocketAddr, config: ServerConfig) -> StreamResult<Self>
Listens on addr (UDP), at most DEFAULT_MAX_CONNECTIONS clients at once.
Checks every client’s certificate against authority’s registry after the handshake (use
with a configuration from super::tls::server_config_with_clients): enrolled and not
revoked, or the connection is closed.
Sourcepub fn with_max_connections(self, n: usize) -> Self
pub fn with_max_connections(self, n: usize) -> Self
At most n clients at once (at least one).
pub fn local_addr(&self) -> StreamResult<SocketAddr>
Sourcepub async fn accept(&self) -> Option<(Connection, Peer)>
pub async fn accept(&self) -> Option<(Connection, Peer)>
The next client whose handshake succeeds and who is allowed in, and who it is; None
once the endpoint is closed. Before any handshake work, a client must prove it owns its
address (QUIC Retry: a spoofed source address gets one small packet, never the server’s
answers), and clients beyond the connection limit are refused. With an authority, a
client presenting a certificate must be enrolled and not revoked; one presenting none is
anonymous (only possible when the TLS configuration allows it).
Auto Trait Implementations§
impl !RefUnwindSafe for Server
impl !UnwindSafe for Server
impl Forget for Server
impl Freeze for Server
impl Move for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
Blanket Implementations§
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
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> ⓘ
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> ⓘ
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