[][src]Struct meows::Envelope

pub struct Envelope {
    pub ttype: String,
    pub value: Value,
}

The Envelope handles the serialization/deserialization of the outer part of a websocket message.

All websocket messages are expected to have the basic format of:

{
    "type" : "foo",
    "value": {}
}

The contents of value can be completely arbitrary and are expected to be deserializable into whatever the type value string is , e.g. Foo in this example.

Fields

ttype: Stringvalue: Value

Trait Implementations

impl Debug for Envelope[src]

impl<'de> Deserialize<'de> for Envelope[src]

impl Into<String> for Envelope[src]

Support converting an Envelope directly into a String type

use meows::Envelope;

let e = Envelope { ttype: String::from("rust"), value: serde_json::Value::Null };
let into: String = e.into();
assert_eq!(r#"{"type":"rust","value":null}"#, into);

impl Serialize for Envelope[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,