[][src]Struct httpbis::ServerBuilder

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: ServerConftls: 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: ServerHandlerPaths

Implementations

impl ServerBuilder<TlsAcceptor>[src]

pub fn new_plain() -> ServerBuilder<TlsAcceptor>[src]

New server builder with defaults.

Port must be set, other properties are optional.

impl ServerBuilder<TlsAcceptor>[src]

pub fn new_plain_unix() -> ServerBuilder<TlsAcceptor>[src]

New unix domain socket server with defaults

Addr must be set, other properties are optional.

impl<A: TlsAcceptor> ServerBuilder<A>[src]

pub fn set_port(&mut self, port: u16)[src]

Set port server listens on. Can be zero to bind on any available port, which can be later obtained by Server::local_addr.

pub fn set_addr<S: ToSocketAddrs>(&mut self, addr: S) -> Result<()>[src]

Set port server listens on.

impl<A: TlsAcceptor> ServerBuilder<A>[src]

pub fn set_unix_addr<S: Into<SocketAddrUnix>>(&mut self, addr: S) -> Result<()>[src]

impl<A: TlsAcceptor> ServerBuilder<A>[src]

pub fn new() -> ServerBuilder<A>[src]

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)[src]

pub fn build(self) -> Result<Server>[src]

Auto Trait Implementations

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 = TlsAcceptor> !UnwindSafe for ServerBuilder<A>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.