pub struct ServerBuilder<A: TlsAcceptor = TlsAcceptor> {
pub conf: ServerConf,
pub tls: ServerTlsOption<A>,
pub addr: Option<AnySocketAddr>,
pub event_loop: Option<Handle>,
pub conn_event_loops: Vec<Handle>,
pub service: ServerHandlerPaths,
}Fields§
§conf: ServerConf§tls: ServerTlsOption<A>§addr: Option<AnySocketAddr>§event_loop: Option<Handle>Event loop to spawn server. If not specified, builder will create new event loop in a new thread.
conn_event_loops: Vec<Handle>Event loops used to run incoming connections. If empty, listener event loop will be used.
service: ServerHandlerPathsImplementations§
Source§impl ServerBuilder<TlsAcceptor>
impl ServerBuilder<TlsAcceptor>
Sourcepub fn new_plain() -> ServerBuilder<TlsAcceptor>
pub fn new_plain() -> ServerBuilder<TlsAcceptor>
New server builder with defaults.
Port must be set, other properties are optional.
Source§impl ServerBuilder<TlsAcceptor>
impl ServerBuilder<TlsAcceptor>
Sourcepub fn new_plain_unix() -> ServerBuilder<TlsAcceptor>
pub fn new_plain_unix() -> ServerBuilder<TlsAcceptor>
New unix domain socket server with defaults
Addr must be set, other properties are optional.
Source§impl<A: TlsAcceptor> ServerBuilder<A>
impl<A: TlsAcceptor> ServerBuilder<A>
Source§impl<A: TlsAcceptor> ServerBuilder<A>
impl<A: TlsAcceptor> ServerBuilder<A>
pub fn set_unix_addr<S: Into<SocketAddrUnix>>(&mut self, addr: S) -> Result<()>
Source§impl<A: TlsAcceptor> ServerBuilder<A>
impl<A: TlsAcceptor> ServerBuilder<A>
Sourcepub fn new() -> ServerBuilder<A>
pub fn new() -> ServerBuilder<A>
New server builder with defaults.
To call this function ServerBuilder must be parameterized with TLS acceptor.
If TLS is not needed, ServerBuilder::new_plain function can be used.
Port must be set, other properties are optional.
pub fn set_tls(&mut self, acceptor: A)
pub fn build(self) -> Result<Server>
Auto Trait Implementations§
impl<A> Freeze for ServerBuilder<A>
impl<A = TlsAcceptor> !RefUnwindSafe for ServerBuilder<A>
impl<A> Send for ServerBuilder<A>
impl<A> Sync for ServerBuilder<A>
impl<A> Unpin for ServerBuilder<A>
impl<A> UnsafeUnpin for ServerBuilder<A>
impl<A = TlsAcceptor> !UnwindSafe for ServerBuilder<A>
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