pub struct JsonRpcRequest {
pub method: Method,
pub parameters: Vec<Option<String>>,
pub settings: Value,
pub id: i32,
pub error: Value,
}Expand description
JsonRPC 请求数据
Fields§
§method: Method§parameters: Vec<Option<String>>§settings: Value§id: i32§error: ValueImplementations§
Source§impl JsonRpcRequest
impl JsonRpcRequest
Sourcepub fn from(argument: &String) -> Result<Self, LauncherError>
pub fn from(argument: &String) -> Result<Self, LauncherError>
将JsonRPC请求反序列化
Sourcepub fn get_parameter(&self) -> String
pub fn get_parameter(&self) -> String
获取第一个参数
Sourcepub fn set_response(
&self,
response: JsonRpcResponse,
) -> Result<(), LauncherError>
pub fn set_response( &self, response: JsonRpcResponse, ) -> Result<(), LauncherError>
设置响应
Sourcepub fn set_simple_response<S: Into<String>>(
&self,
title: S,
sub_title: S,
icon_path: S,
action: Option<JsonRpcAction>,
) -> Result<(), LauncherError>
pub fn set_simple_response<S: Into<String>>( &self, title: S, sub_title: S, icon_path: S, action: Option<JsonRpcAction>, ) -> Result<(), LauncherError>
设置简单响应
Sourcepub fn to_string(&self) -> Result<String, LauncherError>
pub fn to_string(&self) -> Result<String, LauncherError>
转换为字符串,方便调试
Trait Implementations§
Source§impl Debug for JsonRpcRequest
impl Debug for JsonRpcRequest
Source§impl<'de> Deserialize<'de> for JsonRpcRequest
impl<'de> Deserialize<'de> for JsonRpcRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for JsonRpcRequest
impl RefUnwindSafe for JsonRpcRequest
impl Send for JsonRpcRequest
impl Sync for JsonRpcRequest
impl Unpin for JsonRpcRequest
impl UnwindSafe for JsonRpcRequest
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