Enum tokio_proto::streaming::multiplex::Frame [−][src]
pub enum Frame<T, B, E> { Message { id: RequestId, message: T, body: bool, solo: bool, }, Body { id: RequestId, chunk: Option<B>, }, Error { id: RequestId, error: E, }, }
A multiplexed protocol frame
Variants
Message
Either a request or a response.
Fields of Message
id: RequestId | Message exchange identifier |
message: T | The message value |
body: bool | Set to true when body frames will follow with the same request ID. |
solo: bool | Set to |
Body
Body frame.
Fields of Body
id: RequestId | Message exchange identifier |
chunk: Option<B> | Body chunk. Setting to |
Error
Error
Fields of Error
id: RequestId | Message exchange identifier |
error: E | Error value |
Methods
impl<T, B, E> Frame<T, B, E>
[src]
impl<T, B, E> Frame<T, B, E>
pub fn request_id(&self) -> RequestId
[src]
pub fn request_id(&self) -> RequestId
Return the request ID associated with the frame.
pub fn unwrap_msg(self) -> T
[src]
pub fn unwrap_msg(self) -> T
Unwraps a frame, yielding the content of the Message
.
pub fn unwrap_body(self) -> Option<B>
[src]
pub fn unwrap_body(self) -> Option<B>
Unwraps a frame, yielding the content of the Body
.
pub fn unwrap_err(self) -> E
[src]
pub fn unwrap_err(self) -> E
Unwraps a frame, yielding the content of the Error
.
Trait Implementations
impl<T: Debug, B: Debug, E: Debug> Debug for Frame<T, B, E>
[src]
impl<T: Debug, B: Debug, E: Debug> Debug for Frame<T, B, E>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Clone, B: Clone, E: Clone> Clone for Frame<T, B, E>
[src]
impl<T: Clone, B: Clone, E: Clone> Clone for Frame<T, B, E>