pub enum ServerMessage {
Devices {
devices: Vec<DeviceSummary>,
},
Ack {
reply_to: String,
},
Data {
device_id: DeviceId,
data: Bytes,
},
Connect {
device_id: DeviceId,
},
Disconnect {
device_id: DeviceId,
},
WedgeScan {
device_id: DeviceId,
scan: WedgeScan,
},
NfcReading {
device_id: DeviceId,
reading: NfcReading,
},
NfcError {
device_id: DeviceId,
reading: NfcReading,
},
Error {
code: BridgeErrorCode,
message: String,
reply_to: Option<String>,
},
}Expand description
The body of a ServerFrame.
Variants§
Devices
The full device list, for the port picker and getPorts(). Sent after hello and
whenever a device is added, removed or changes state.
Fields
§
devices: Vec<DeviceSummary>Every device.
Ack
A client message with an id succeeded.
Data
Device -> host bytes.
Connect
The device became reachable.
Disconnect
The device stopped being reachable.
WedgeScan
A keyboard-wedge scanner typed a scan: the shim presses the keys on the focused
element (PRD section 8.4). Sent only to shims whose hello listed wedge.
NfcReading
An NFC reader read a card: the shim fires reading on scanning NDEFReaders. Sent
only to shims whose hello listed nfc.
NfcError
An NFC reader failed to read a card: the shim fires readingerror. records is
empty.
Error
Something failed; replyTo names the client message, if any.
Fields
§
code: BridgeErrorCodeA machine-readable code, see BridgeErrorCode.
Trait Implementations§
Source§impl Clone for ServerMessage
impl Clone for ServerMessage
Source§impl Debug for ServerMessage
impl Debug for ServerMessage
Source§impl<'de> Deserialize<'de> for ServerMessage
impl<'de> Deserialize<'de> for ServerMessage
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
Source§impl PartialEq for ServerMessage
impl PartialEq for ServerMessage
Source§impl Serialize for ServerMessage
impl Serialize for ServerMessage
impl StructuralPartialEq for ServerMessage
Auto Trait Implementations§
impl !Freeze for ServerMessage
impl RefUnwindSafe for ServerMessage
impl Send for ServerMessage
impl Sync for ServerMessage
impl Unpin for ServerMessage
impl UnsafeUnpin for ServerMessage
impl UnwindSafe for ServerMessage
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