pub struct ServiceConfig<Cfg: ServerAppConfig>(/* private fields */);Implementations§
Source§impl<Cfg: ServerAppConfig> ServiceConfig<Cfg>
impl<Cfg: ServerAppConfig> ServiceConfig<Cfg>
Sourcepub fn bind(
&self,
name: impl AsRef<str>,
addr: impl ToSocketAddrs,
cfg: impl Into<SharedCfg>,
) -> Result<&Self>
pub fn bind( &self, name: impl AsRef<str>, addr: impl ToSocketAddrs, cfg: impl Into<SharedCfg>, ) -> Result<&Self>
Add new service to the server.
Sourcepub fn listen(
&self,
name: impl AsRef<str>,
lst: TcpListener,
cfg: impl Into<SharedCfg>,
) -> &Self
pub fn listen( &self, name: impl AsRef<str>, lst: TcpListener, cfg: impl Into<SharedCfg>, ) -> &Self
Add new service to the server.
Sourcepub fn on_worker_start<F>(&self, f: F) -> &Self
pub fn on_worker_start<F>(&self, f: F) -> &Self
Register async service configuration function.
This function get called during worker runtime configuration stage. It get executed in the worker thread.
Trait Implementations§
Source§impl<Cfg: ServerAppConfig> Clone for ServiceConfig<Cfg>
impl<Cfg: ServerAppConfig> Clone for ServiceConfig<Cfg>
Auto Trait Implementations§
impl<Cfg> !RefUnwindSafe for ServiceConfig<Cfg>
impl<Cfg> !Send for ServiceConfig<Cfg>
impl<Cfg> !Sync for ServiceConfig<Cfg>
impl<Cfg> !UnwindSafe for ServiceConfig<Cfg>
impl<Cfg> Freeze for ServiceConfig<Cfg>
impl<Cfg> Unpin for ServiceConfig<Cfg>
impl<Cfg> UnsafeUnpin for ServiceConfig<Cfg>
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