[−][src]Struct jsonrpc_ws_server::ServerBuilder
Builder for WebSockets
server
Implementations
impl<M: Metadata + Default, S: Middleware<M>> ServerBuilder<M, S> where
S::Future: Unpin,
S::CallFuture: Unpin,
[src]
S::Future: Unpin,
S::CallFuture: Unpin,
pub fn new<T>(handler: T) -> Self where
T: Into<MetaIoHandler<M, S>>,
[src]
T: Into<MetaIoHandler<M, S>>,
Creates new ServerBuilder
impl<M: Metadata, S: Middleware<M>> ServerBuilder<M, S> where
S::Future: Unpin,
S::CallFuture: Unpin,
[src]
S::Future: Unpin,
S::CallFuture: Unpin,
pub fn with_meta_extractor<T, E>(handler: T, extractor: E) -> Self where
T: Into<MetaIoHandler<M, S>>,
E: MetaExtractor<M>,
[src]
T: Into<MetaIoHandler<M, S>>,
E: MetaExtractor<M>,
Creates new ServerBuilder
pub fn event_loop_executor(mut self: Self, executor: TaskExecutor) -> Self
[src]
Utilize existing event loop executor to poll RPC results.
pub fn session_meta_extractor<T: MetaExtractor<M>>(
mut self: Self,
extractor: T
) -> Self
[src]
mut self: Self,
extractor: T
) -> Self
Sets a meta extractor.
pub fn allowed_origins(
mut self: Self,
allowed_origins: DomainsValidation<Origin>
) -> Self
[src]
mut self: Self,
allowed_origins: DomainsValidation<Origin>
) -> Self
Allowed origins.
pub fn allowed_hosts(
mut self: Self,
allowed_hosts: DomainsValidation<Host>
) -> Self
[src]
mut self: Self,
allowed_hosts: DomainsValidation<Host>
) -> Self
Allowed hosts.
pub fn session_stats<T: SessionStats>(mut self: Self, stats: T) -> Self
[src]
Session stats
pub fn request_middleware<T: RequestMiddleware>(
mut self: Self,
middleware: T
) -> Self
[src]
mut self: Self,
middleware: T
) -> Self
Sets a request middleware. Middleware will be invoked before each handshake request. You can either terminate the handshake in the middleware or run a default behaviour after.
pub fn max_connections(mut self: Self, max_connections: usize) -> Self
[src]
Maximal number of concurrent connections this server supports. Default: 100
pub fn max_payload(mut self: Self, max_payload_bytes: usize) -> Self
[src]
Maximal size of the payload (in bytes) Default: 5MB
pub fn max_in_buffer_capacity(
mut self: Self,
max_in_buffer_capacity: usize
) -> Self
[src]
mut self: Self,
max_in_buffer_capacity: usize
) -> Self
The maximum size to which the incoming buffer can grow. Default: 10,485,760
pub fn max_out_buffer_capacity(
mut self: Self,
max_out_buffer_capacity: usize
) -> Self
[src]
mut self: Self,
max_out_buffer_capacity: usize
) -> Self
The maximum size to which the outgoing buffer can grow. Default: 10,485,760
pub fn start(self, addr: &SocketAddr) -> Result<Server>
[src]
Starts a new WebSocket
server in separate thread.
Returns a Server
handle which closes the server when droped.
Auto Trait Implementations
impl<M, S> !RefUnwindSafe for ServerBuilder<M, S>
[src]
impl<M, S> Send for ServerBuilder<M, S>
[src]
impl<M, S> Sync for ServerBuilder<M, S>
[src]
impl<M, S> Unpin for ServerBuilder<M, S>
[src]
impl<M, S> !UnwindSafe for ServerBuilder<M, S>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,