pub struct ServerBuilder<M: Metadata = (), S: Middleware<M> = Noop> { /* private fields */ }
Expand description
TCP server builder
Implementations§
Source§impl<M: Metadata + Default, S: Middleware<M> + 'static> ServerBuilder<M, S>
impl<M: Metadata + Default, S: Middleware<M> + 'static> ServerBuilder<M, S>
Sourcepub fn new<T>(handler: T) -> Selfwhere
T: Into<MetaIoHandler<M, S>>,
pub fn new<T>(handler: T) -> Selfwhere
T: Into<MetaIoHandler<M, S>>,
Creates new ServerBuilder
wih given IoHandler
Source§impl<M: Metadata, S: Middleware<M> + 'static> ServerBuilder<M, S>
impl<M: Metadata, S: Middleware<M> + 'static> ServerBuilder<M, S>
Sourcepub fn with_meta_extractor<T, E>(handler: T, extractor: E) -> Self
pub fn with_meta_extractor<T, E>(handler: T, extractor: E) -> Self
Creates new ServerBuilder
wih given IoHandler
Sourcepub fn event_loop_executor(self, handle: TaskExecutor) -> Self
pub fn event_loop_executor(self, handle: TaskExecutor) -> Self
Utilize existing event loop executor.
Sourcepub fn session_meta_extractor<T: MetaExtractor<M> + 'static>(
self,
meta_extractor: T,
) -> Self
pub fn session_meta_extractor<T: MetaExtractor<M> + 'static>( self, meta_extractor: T, ) -> Self
Sets session meta extractor
Sourcepub fn request_separators(
self,
incoming: Separator,
outgoing: Separator,
) -> Self
pub fn request_separators( self, incoming: Separator, outgoing: Separator, ) -> Self
Sets the incoming and outgoing requests separator
Sourcepub fn start(self, addr: &SocketAddr) -> Result<Server>
pub fn start(self, addr: &SocketAddr) -> Result<Server>
Starts a new server
Sourcepub fn dispatcher(&self) -> Dispatcher
pub fn dispatcher(&self) -> Dispatcher
Returns dispatcher
Auto Trait Implementations§
impl<M, S> Freeze for ServerBuilder<M, S>
impl<M = (), S = Noop> !RefUnwindSafe for ServerBuilder<M, S>
impl<M, S> Send for ServerBuilder<M, S>
impl<M, S> Sync for ServerBuilder<M, S>
impl<M, S> Unpin for ServerBuilder<M, S>
impl<M = (), S = Noop> !UnwindSafe for ServerBuilder<M, S>
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