Struct i3_ipc::MsgResponse

source ·
pub struct MsgResponse<D> {
    pub msg_type: Msg,
    pub body: D,
}
Expand description

Instead of returning an enum, we’re returning a struct containing the Msg type and some body. An advantage to this over the enum method is that there is no minimum memory size that we must have. This is helpful when some variants are very large compared to others, as in the case of say reply::Node vs reply::Config

Fields§

§msg_type: Msg§body: D

Implementations§

MsgResponse is valid for anything which can be deserialized with serde

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.