pub struct ServiceConfig { /* private fields */ }
Implementations§
Source§impl ServiceConfig
impl ServiceConfig
Sourcepub fn workers(&mut self, num: usize)
pub fn workers(&mut self, num: usize)
Set number of workers to start.
By default server uses number of available logical cpu as workers count.
Sourcepub fn bind<U, N: AsRef<str>>(&mut self, name: N, addr: U) -> Result<&mut Self>where
U: ToSocketAddrs,
pub fn bind<U, N: AsRef<str>>(&mut self, name: N, addr: U) -> Result<&mut Self>where
U: ToSocketAddrs,
Add new service to server
Sourcepub fn listen<N: AsRef<str>>(&mut self, name: N, lst: TcpListener) -> &mut Self
pub fn listen<N: AsRef<str>>(&mut self, name: N, lst: TcpListener) -> &mut Self
Add new service to server
Auto Trait Implementations§
impl Freeze for ServiceConfig
impl !RefUnwindSafe for ServiceConfig
impl Send for ServiceConfig
impl !Sync for ServiceConfig
impl Unpin for ServiceConfig
impl !UnwindSafe for ServiceConfig
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
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>
Converts
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>
Converts
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