Struct jsonrpsee_core::server::helpers::MethodResponse
source · Expand description
Represent the response to method call.
Fields§
§result: String
Serialized JSON-RPC response,
success: bool
Indicates whether the call was successful or not.
Implementations§
source§impl MethodResponse
impl MethodResponse
sourcepub fn response(
id: Id<'_>,
result: impl Serialize,
max_response_size: usize
) -> Self
pub fn response(
id: Id<'_>,
result: impl Serialize,
max_response_size: usize
) -> Self
Send a JSON-RPC response to the client. If the serialization of result
exceeds max_response_size
,
an error will be sent instead.
sourcepub fn error<'a>(id: Id<'_>, err: impl Into<ErrorObject<'a>>) -> Self
pub fn error<'a>(id: Id<'_>, err: impl Into<ErrorObject<'a>>) -> Self
Create a MethodResponse
from an error.