Struct jsonrpsee_core::server::helpers::MethodSink
source · pub struct MethodSink { /* private fields */ }
Expand description
Sink that is used to send back the result to the server for a specific method.
Implementations§
source§impl 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§
source§impl Clone for MethodSink
impl Clone for MethodSink
source§fn clone(&self) -> MethodSink
fn clone(&self) -> MethodSink
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 more