pub struct ServerHandler<M: Metadata = (), S: Middleware<M> = Noop> { /* private fields */ }
Expand description
jsonrpc http request handler.
Implementations§
Source§impl<M: Metadata, S: Middleware<M>> ServerHandler<M, S>
impl<M: Metadata, S: Middleware<M>> ServerHandler<M, S>
Sourcepub fn new(
susydev_jsonrpc_handler: Rpc<M, S>,
cors_domains: Option<Vec<AccessControlAllowOrigin>>,
cors_max_age: Option<u32>,
cors_allowed_headers: AccessControlAllowHeaders,
allowed_hosts: Option<Vec<Host>>,
middleware: Arc<dyn RequestMiddleware>,
rest_api: RestApi,
health_api: Option<(String, String)>,
max_request_body_size: usize,
keep_alive: bool,
) -> Self
pub fn new( susydev_jsonrpc_handler: Rpc<M, S>, cors_domains: Option<Vec<AccessControlAllowOrigin>>, cors_max_age: Option<u32>, cors_allowed_headers: AccessControlAllowHeaders, allowed_hosts: Option<Vec<Host>>, middleware: Arc<dyn RequestMiddleware>, rest_api: RestApi, health_api: Option<(String, String)>, max_request_body_size: usize, keep_alive: bool, ) -> Self
Create new request handler.
Trait Implementations§
Auto Trait Implementations§
impl<M, S> Freeze for ServerHandler<M, S>
impl<M = (), S = Noop> !RefUnwindSafe for ServerHandler<M, S>
impl<M, S> Send for ServerHandler<M, S>
impl<M, S> Sync for ServerHandler<M, S>
impl<M, S> Unpin for ServerHandler<M, S>
impl<M = (), S = Noop> !UnwindSafe for ServerHandler<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
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