Enum holochain_websocket::WireMessage
source · [−]pub enum WireMessage {
Signal {
data: Vec<u8>,
},
Request {
id: u64,
data: Vec<u8>,
},
Response {
id: u64,
data: Option<Vec<u8>>,
},
}
Expand description
The messages actually sent over the wire by this library. If you want to impliment your own server or client you will need this type or be able to serialize / deserialize it.
Variants
Signal
Fields
data: Vec<u8>
Actual bytes of the message serialized as message pack.
A message without a response.
Request
Fields
id: u64
The id of this request. Note ids are recycled once they are used.
data: Vec<u8>
Actual bytes of the message serialized as message pack.
A request that requires a response.
Response
Fields
id: u64
The id of the request that this response is for.
data: Option<Vec<u8>>
Actual bytes of the message serialized as message pack.
The response to a request.
Trait Implementations
sourceimpl Debug for WireMessage
impl Debug for WireMessage
sourceimpl<'de> Deserialize<'de> for WireMessage
impl<'de> Deserialize<'de> for WireMessage
sourcefn 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
sourceimpl Serialize for WireMessage
impl Serialize for WireMessage
sourceimpl TryFrom<&'_ WireMessage> for SerializedBytes
impl TryFrom<&'_ WireMessage> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
sourcefn try_from(t: &WireMessage) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &WireMessage) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
sourceimpl TryFrom<SerializedBytes> for WireMessage
impl TryFrom<SerializedBytes> for WireMessage
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
sourcefn try_from(sb: SerializedBytes) -> Result<WireMessage, SerializedBytesError>
fn try_from(sb: SerializedBytes) -> Result<WireMessage, SerializedBytesError>
Performs the conversion.
sourceimpl TryFrom<WireMessage> for SerializedBytes
impl TryFrom<WireMessage> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
sourcefn try_from(t: WireMessage) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: WireMessage) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for WireMessage
impl Send for WireMessage
impl Sync for WireMessage
impl Unpin for WireMessage
impl UnwindSafe for WireMessage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more