pub struct RpcService { /* private fields */ }Expand description
JSON-RPC service middleware.
Implementations§
Source§impl RpcService
impl RpcService
Sourcepub fn new(
methods: Methods,
max_response_body_size: usize,
conn_id: ConnectionId,
bounded_subscriptions: BoundedSubscriptions,
sink: MethodSink,
id_provider: Arc<dyn IdProvider>,
) -> Self
pub fn new( methods: Methods, max_response_body_size: usize, conn_id: ConnectionId, bounded_subscriptions: BoundedSubscriptions, sink: MethodSink, id_provider: Arc<dyn IdProvider>, ) -> Self
Creates a service for a connection that supports subscriptions.
Subscription notifications are sent to sink, and at most bounded_subscriptions of them
can be active at once.
Trait Implementations§
Source§impl Clone for RpcService
impl Clone for RpcService
Source§impl Debug for RpcService
impl Debug for RpcService
Source§impl RpcServiceT for RpcService
impl RpcServiceT for RpcService
Source§fn call<'a>(
&self,
req: Request<'a>,
) -> impl Future<Output = MethodResponse> + Send + 'a
fn call<'a>( &self, req: Request<'a>, ) -> impl Future<Output = MethodResponse> + Send + 'a
Processes a single JSON-RPC call, which may be a subscription or regular call.
Source§fn batch<'a>(
&self,
batch: Batch<'a>,
) -> impl Future<Output = MethodResponse> + Send + 'a
fn batch<'a>( &self, batch: Batch<'a>, ) -> impl Future<Output = MethodResponse> + Send + 'a
Processes multiple JSON-RPC calls at once, similar to
RpcServiceT::call. Read moreSource§fn notification<'a>(
&self,
_n: Notification<'a>,
) -> impl Future<Output = MethodResponse> + Send + 'a
fn notification<'a>( &self, _n: Notification<'a>, ) -> impl Future<Output = MethodResponse> + Send + 'a
Similar to
RpcServiceT::call but processes a JSON-RPC notification.Auto Trait Implementations§
impl !RefUnwindSafe for RpcService
impl !UnwindSafe for RpcService
impl Freeze for RpcService
impl Send for RpcService
impl Sync for RpcService
impl Unpin for RpcService
impl UnsafeUnpin for RpcService
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 72 bytes