pub struct RpcServer<R: RpcApi + ?Sized> { /* private fields */ }Expand description
The JSON-RPC server itself.
Implementations§
Source§impl<R: RpcApi + ?Sized> RpcServer<R>
impl<R: RpcApi + ?Sized> RpcServer<R>
Sourcepub fn new(api: Arc<R>, registry: MethodRegistry, mode: RpcServerMode) -> Self
pub fn new(api: Arc<R>, registry: MethodRegistry, mode: RpcServerMode) -> Self
Construct a server. Use default rate-limit config;
customise via with_rate_limit_state.
Sourcepub fn with_rate_limit_state(self, state: RateLimitState) -> Self
pub fn with_rate_limit_state(self, state: RateLimitState) -> Self
Replace the rate-limit state.
Sourcepub fn bind_addr(&self) -> SocketAddr
pub fn bind_addr(&self) -> SocketAddr
The bind address for this server.
Source§impl<R: RpcApi> RpcServer<R>
impl<R: RpcApi> RpcServer<R>
Sourcepub async fn serve(self, shutdown: ShutdownToken) -> Result<(), RpcServerError>
pub async fn serve(self, shutdown: ShutdownToken) -> Result<(), RpcServerError>
Start serving; return when shutdown fires or the listener dies.
Auto Trait Implementations§
impl<R> Freeze for RpcServer<R>where
R: ?Sized,
impl<R> !RefUnwindSafe for RpcServer<R>
impl<R> Send for RpcServer<R>where
R: ?Sized,
impl<R> Sync for RpcServer<R>where
R: ?Sized,
impl<R> Unpin for RpcServer<R>where
R: ?Sized,
impl<R> UnsafeUnpin for RpcServer<R>where
R: ?Sized,
impl<R> !UnwindSafe for RpcServer<R>
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