pub enum DeviceMessage {
Enroll {
enroll_token: String,
version: u32,
label: Option<String>,
},
Attach {
device_id: String,
enroll_token: String,
},
Heartbeat,
}Expand description
Device → relay.
Variants§
Enroll
First message: ask to attach to this relay.
Fields
Attach
First frame on a data connection: claim a slot in a device’s pool.
The secret travels in the frame body, never in the URL. Query strings are written to access logs by default by the reverse proxies this relay is meant to sit behind, so a token in the URL would end up on disk in plaintext on every deployment that follows our own TLS advice.
Fields
Heartbeat
Liveness heartbeat.
Sent by the device rather than relied upon from the transport: a proxy or load balancer between the two closes idle connections (60s is the common default), and tungstenite answers pings but never originates them.
Trait Implementations§
Source§impl Clone for DeviceMessage
impl Clone for DeviceMessage
Source§fn clone(&self) -> DeviceMessage
fn clone(&self) -> DeviceMessage
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 DeviceMessage
impl Debug for DeviceMessage
Source§impl<'de> Deserialize<'de> for DeviceMessage
impl<'de> Deserialize<'de> for DeviceMessage
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
impl Eq for DeviceMessage
Source§impl PartialEq for DeviceMessage
impl PartialEq for DeviceMessage
Source§impl Serialize for DeviceMessage
impl Serialize for DeviceMessage
impl StructuralPartialEq for DeviceMessage
Auto Trait Implementations§
impl Freeze for DeviceMessage
impl RefUnwindSafe for DeviceMessage
impl Send for DeviceMessage
impl Sync for DeviceMessage
impl Unpin for DeviceMessage
impl UnsafeUnpin for DeviceMessage
impl UnwindSafe for DeviceMessage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.