Struct jsonrpsee_server::TowerServiceBuilder
source · pub struct TowerServiceBuilder<RpcMiddleware, HttpMiddleware> { /* private fields */ }
Expand description
Builder for TowerService
.
Implementations§
source§impl<RpcMiddleware, HttpMiddleware> TowerServiceBuilder<RpcMiddleware, HttpMiddleware>
impl<RpcMiddleware, HttpMiddleware> TowerServiceBuilder<RpcMiddleware, HttpMiddleware>
sourcepub fn build(
self,
methods: impl Into<Methods>,
stop_handle: StopHandle,
) -> TowerService<RpcMiddleware, HttpMiddleware>
pub fn build( self, methods: impl Into<Methods>, stop_handle: StopHandle, ) -> TowerService<RpcMiddleware, HttpMiddleware>
Build a tower service.
sourcepub fn connection_id(self, id: u32) -> Self
pub fn connection_id(self, id: u32) -> Self
Configure the connection id.
This is incremented every time build
is called.
sourcepub fn max_connections(self, limit: u32) -> Self
pub fn max_connections(self, limit: u32) -> Self
Configure the max allowed connections on the server.
sourcepub fn set_rpc_middleware<T>(
self,
rpc_middleware: RpcServiceBuilder<T>,
) -> TowerServiceBuilder<T, HttpMiddleware>
pub fn set_rpc_middleware<T>( self, rpc_middleware: RpcServiceBuilder<T>, ) -> TowerServiceBuilder<T, HttpMiddleware>
Configure rpc middleware.
sourcepub fn set_http_middleware<T>(
self,
http_middleware: ServiceBuilder<T>,
) -> TowerServiceBuilder<RpcMiddleware, T>
pub fn set_http_middleware<T>( self, http_middleware: ServiceBuilder<T>, ) -> TowerServiceBuilder<RpcMiddleware, T>
Configure http middleware.
Trait Implementations§
source§impl<RpcMiddleware: Clone, HttpMiddleware: Clone> Clone for TowerServiceBuilder<RpcMiddleware, HttpMiddleware>
impl<RpcMiddleware: Clone, HttpMiddleware: Clone> Clone for TowerServiceBuilder<RpcMiddleware, HttpMiddleware>
source§fn clone(&self) -> TowerServiceBuilder<RpcMiddleware, HttpMiddleware>
fn clone(&self) -> TowerServiceBuilder<RpcMiddleware, HttpMiddleware>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<RpcMiddleware, HttpMiddleware> Freeze for TowerServiceBuilder<RpcMiddleware, HttpMiddleware>
impl<RpcMiddleware, HttpMiddleware> !RefUnwindSafe for TowerServiceBuilder<RpcMiddleware, HttpMiddleware>
impl<RpcMiddleware, HttpMiddleware> Send for TowerServiceBuilder<RpcMiddleware, HttpMiddleware>
impl<RpcMiddleware, HttpMiddleware> Sync for TowerServiceBuilder<RpcMiddleware, HttpMiddleware>
impl<RpcMiddleware, HttpMiddleware> Unpin for TowerServiceBuilder<RpcMiddleware, HttpMiddleware>
impl<RpcMiddleware, HttpMiddleware> !UnwindSafe for TowerServiceBuilder<RpcMiddleware, HttpMiddleware>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)