pub struct Response {
pub result: Option<Vec<Value>>,
pub error: Option<ResponseError>,
}Expand description
A response the plugin writes back to the host.
Fields§
§result: Option<Vec<Value>>Present on success: the function’s return values.
error: Option<ResponseError>Present on failure: a human-readable message.
Implementations§
Source§impl Response
impl Response
Sourcepub fn from_json_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_json_bytes(bytes: &[u8]) -> Result<Self>
Parse a length-prefixed frame from a raw JSON byte slice.
Sourcepub fn into_result(self, method: &str) -> Result<Vec<Value>>
pub fn into_result(self, method: &str) -> Result<Vec<Value>>
Split into success values or an Error::PluginError.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
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 Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
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