pub struct Resp {
pub ok: bool,
pub result: Option<Value>,
pub error: Option<PluginError>,
}Expand description
响应信封:{ ok, result } | { ok, error }(spec §6.4)。
Fields§
§ok: bool§result: Option<Value>§error: Option<PluginError>Implementations§
Source§impl Resp
impl Resp
pub fn ok(result: Value) -> Self
pub fn err(e: PluginError) -> Self
pub fn into_result(self) -> Result<Value, PluginError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Resp
impl<'de> Deserialize<'de> for Resp
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 Resp
impl RefUnwindSafe for Resp
impl Send for Resp
impl Sync for Resp
impl Unpin for Resp
impl UnsafeUnpin for Resp
impl UnwindSafe for Resp
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