Struct RpcService
pub struct RpcService { /* private fields */ }Expand description
JSON-RPC service middleware.
Implementations§
§impl RpcService
impl RpcService
pub fn new(
methods: Methods,
max_response_body_size: usize,
conn_id: ConnectionId,
bounded_subscriptions: BoundedSubscriptions,
sink: MethodSink,
id_provider: Arc<dyn IdProvider>,
) -> RpcService
pub fn new( methods: Methods, max_response_body_size: usize, conn_id: ConnectionId, bounded_subscriptions: BoundedSubscriptions, sink: MethodSink, id_provider: Arc<dyn IdProvider>, ) -> RpcService
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§
§impl Clone for RpcService
impl Clone for RpcService
§fn clone(&self) -> RpcService
fn clone(&self) -> RpcService
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for RpcService
impl Debug for RpcService
§impl RpcServiceT for RpcService
impl RpcServiceT for RpcService
§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.
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