Struct jsonrpsee_core::server::helpers::MethodSink
source · [−]pub struct MethodSink { /* private fields */ }
server
only.Expand description
Sink that is used to send back the result to the server for a specific method.
Implementations
sourceimpl MethodSink
impl MethodSink
sourcepub fn new(tx: UnboundedSender<String>) -> Self
pub fn new(tx: UnboundedSender<String>) -> Self
Create a new MethodSink
with unlimited response size
sourcepub fn new_with_limit(
tx: UnboundedSender<String>,
max_response_size: u32,
max_log_length: u32
) -> Self
pub fn new_with_limit(
tx: UnboundedSender<String>,
max_response_size: u32,
max_log_length: u32
) -> Self
Create a new MethodSink
with a limited response size
sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Returns whether this channel is closed without needing a context.
sourcepub fn send_error(&self, id: Id<'_>, error: ErrorObject<'_>) -> bool
pub fn send_error(&self, id: Id<'_>, error: ErrorObject<'_>) -> bool
Send a JSON-RPC error to the client
sourcepub fn send_call_error(&self, id: Id<'_>, err: Error) -> bool
pub fn send_call_error(&self, id: Id<'_>, err: Error) -> bool
Helper for sending the general purpose Error
as a JSON-RPC errors to the client
sourcepub fn send_raw(&self, json: String) -> Result<(), TrySendError<String>>
pub fn send_raw(&self, json: String) -> Result<(), TrySendError<String>>
Send a raw JSON-RPC message to the client, MethodSink
does not check verify the validity
of the JSON being sent.
sourcepub const fn max_response_size(&self) -> u32
pub const fn max_response_size(&self) -> u32
Get the maximum number of permitted subscriptions.
Trait Implementations
sourceimpl Clone for MethodSink
impl Clone for MethodSink
sourcefn clone(&self) -> MethodSink
fn clone(&self) -> MethodSink
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for MethodSink
impl Send for MethodSink
impl Sync for MethodSink
impl Unpin for MethodSink
impl !UnwindSafe for MethodSink
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn 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>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn 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>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more