pub struct ResponseHeader {
pub ok: bool,
pub error: Option<String>,
pub x: Option<i32>,
pub y: Option<i32>,
pub payload_len: u32,
}Expand description
JSON header of a response frame (guest → host). ok reports success;
on failure error carries a message and no payload follows. x/y
are populated by Action::CursorPosition. payload_len is the count
of binary bytes (e.g. PNG) following this header in the frame.
Fields§
§ok: bool§error: Option<String>§x: Option<i32>§y: Option<i32>§payload_len: u32Implementations§
Source§impl ResponseHeader
impl ResponseHeader
Sourcepub fn ok() -> ResponseHeader
pub fn ok() -> ResponseHeader
A bare success header with no payload and no coordinates.
Sourcepub fn err(msg: impl Into<String>) -> ResponseHeader
pub fn err(msg: impl Into<String>) -> ResponseHeader
A failure header carrying msg.
Trait Implementations§
Source§impl Clone for ResponseHeader
impl Clone for ResponseHeader
Source§fn clone(&self) -> ResponseHeader
fn clone(&self) -> ResponseHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResponseHeader
impl Debug for ResponseHeader
Source§impl<'de> Deserialize<'de> for ResponseHeader
impl<'de> Deserialize<'de> for ResponseHeader
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResponseHeader, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResponseHeader, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ResponseHeader
impl PartialEq for ResponseHeader
Source§fn eq(&self, other: &ResponseHeader) -> bool
fn eq(&self, other: &ResponseHeader) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ResponseHeader
impl Serialize for ResponseHeader
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ResponseHeader
Auto Trait Implementations§
impl Freeze for ResponseHeader
impl RefUnwindSafe for ResponseHeader
impl Send for ResponseHeader
impl Sync for ResponseHeader
impl Unpin for ResponseHeader
impl UnsafeUnpin for ResponseHeader
impl UnwindSafe for ResponseHeader
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