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> Freeze for Server<T>where
T: Freeze,
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