pub struct Server<HttpMiddleware = Identity, RpcMiddleware = Identity> { /* private fields */ }
Expand description
JSON RPC server.
Implementations§
source§impl<RpcMiddleware, HttpMiddleware> Server<RpcMiddleware, HttpMiddleware>
impl<RpcMiddleware, HttpMiddleware> Server<RpcMiddleware, HttpMiddleware>
sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Returns socket address to which the server is bound.
source§impl<HttpMiddleware, RpcMiddleware, Body> Server<HttpMiddleware, RpcMiddleware>where
RpcMiddleware: Layer<RpcService> + Clone + Send + 'static,
for<'a> <RpcMiddleware as Layer<RpcService>>::Service: RpcServiceT<'a>,
HttpMiddleware: Layer<TowerServiceNoHttp<RpcMiddleware>> + Send + 'static,
<HttpMiddleware as Layer<TowerServiceNoHttp<RpcMiddleware>>>::Service: Send + Clone + Service<HttpRequest, Response = HttpResponse<Body>, Error = BoxError>,
<<HttpMiddleware as Layer<TowerServiceNoHttp<RpcMiddleware>>>::Service as Service<HttpRequest>>::Future: Send,
Body: Body<Data = Bytes> + Send + 'static,
<Body as Body>::Error: Into<BoxError>,
<Body as Body>::Data: Send,
impl<HttpMiddleware, RpcMiddleware, Body> Server<HttpMiddleware, RpcMiddleware>where
RpcMiddleware: Layer<RpcService> + Clone + Send + 'static,
for<'a> <RpcMiddleware as Layer<RpcService>>::Service: RpcServiceT<'a>,
HttpMiddleware: Layer<TowerServiceNoHttp<RpcMiddleware>> + Send + 'static,
<HttpMiddleware as Layer<TowerServiceNoHttp<RpcMiddleware>>>::Service: Send + Clone + Service<HttpRequest, Response = HttpResponse<Body>, Error = BoxError>,
<<HttpMiddleware as Layer<TowerServiceNoHttp<RpcMiddleware>>>::Service as Service<HttpRequest>>::Future: Send,
Body: Body<Data = Bytes> + Send + 'static,
<Body as Body>::Error: Into<BoxError>,
<Body as Body>::Data: Send,
sourcepub fn start(self, methods: impl Into<Methods>) -> ServerHandle
pub fn start(self, methods: impl Into<Methods>) -> ServerHandle
Start responding to connections requests.
This will run on the tokio runtime until the server is stopped or the ServerHandle
is dropped.
Trait Implementations§
Auto Trait Implementations§
impl<HttpMiddleware = Identity, RpcMiddleware = Identity> !Freeze for Server<HttpMiddleware, RpcMiddleware>
impl<HttpMiddleware = Identity, RpcMiddleware = Identity> !RefUnwindSafe for Server<HttpMiddleware, RpcMiddleware>
impl<HttpMiddleware, RpcMiddleware> Send for Server<HttpMiddleware, RpcMiddleware>
impl<HttpMiddleware, RpcMiddleware> Sync for Server<HttpMiddleware, RpcMiddleware>
impl<HttpMiddleware, RpcMiddleware> Unpin for Server<HttpMiddleware, RpcMiddleware>
impl<HttpMiddleware = Identity, RpcMiddleware = Identity> !UnwindSafe for Server<HttpMiddleware, RpcMiddleware>
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