Struct jsonrpc_tcp_server::ServerBuilder
source · [−]pub struct ServerBuilder<M: Metadata = (), S: Middleware<M> = Noop> { /* private fields */ }
Expand description
TCP server builder
Implementations
sourceimpl<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) -> Self where
T: Into<MetaIoHandler<M, S>>,
pub fn new<T>(handler: T) -> Self where
T: Into<MetaIoHandler<M, S>>,
Creates new ServerBuilder
wih given IoHandler
sourceimpl<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 where
T: Into<MetaIoHandler<M, S>>,
E: MetaExtractor<M> + 'static,
pub fn with_meta_extractor<T, E>(handler: T, extractor: E) -> Self where
T: Into<MetaIoHandler<M, S>>,
E: MetaExtractor<M> + 'static,
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 = 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more