Struct distant_net::server::Server
source · pub struct Server<T> { /* private fields */ }
Expand description
Represents a server that can be used to receive requests & send responses to clients.
Implementations§
source§impl<T> Server<T>
impl<T> Server<T>
sourcepub fn into_tcp_builder(self) -> TcpServerBuilder<T>
pub fn into_tcp_builder(self) -> TcpServerBuilder<T>
Consume Server
and produce a builder for a TCP variant.
source§impl<T> Server<T>
impl<T> Server<T>
sourcepub fn into_unix_socket_builder(self) -> UnixSocketServerBuilder<T>
pub fn into_unix_socket_builder(self) -> UnixSocketServerBuilder<T>
Consume Server
and produce a builder for a Unix socket variant.
source§impl Server<()>
impl Server<()>
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new Server
, starting with a default configuration, no authentication methods,
and no ServerHandler
.
sourcepub fn tcp() -> TcpServerBuilder<()>
pub fn tcp() -> TcpServerBuilder<()>
Creates a new TcpServerBuilder
that is used to construct a Server
.
sourcepub fn unix_socket() -> UnixSocketServerBuilder<()>
pub fn unix_socket() -> UnixSocketServerBuilder<()>
Creates a new UnixSocketServerBuilder
that is used to construct a Server
.
source§impl<T> Server<T>
impl<T> Server<T>
sourcepub fn config(self, config: ServerConfig) -> Self
pub fn config(self, config: ServerConfig) -> Self
Consumes the current server, replacing its config with config
and returning it.
sourcepub fn handler<U>(self, handler: U) -> Server<U>
pub fn handler<U>(self, handler: U) -> Server<U>
Consumes the current server, replacing its handler with handler
and returning it.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Server<T>
impl<T> Send for Server<T>where T: Send,
impl<T> Sync for Server<T>where T: Sync,
impl<T> Unpin for Server<T>where T: Unpin,
impl<T> !UnwindSafe for Server<T>
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
Mutably borrows from an owned value. Read more