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,
},
}
Expand description
A multiplexed protocol frame
Variants§
Message
Either a request or a response.
Fields
§
message: T
The message value
Body
Body frame.
Fields
Error
Error
Implementations§
Source§impl<T, B, E> Frame<T, B, E>
impl<T, B, E> Frame<T, B, E>
Sourcepub fn request_id(&self) -> RequestId
pub fn request_id(&self) -> RequestId
Return the request ID associated with the frame.
Sourcepub fn unwrap_msg(self) -> T
pub fn unwrap_msg(self) -> T
Unwraps a frame, yielding the content of the Message
.
Sourcepub fn unwrap_body(self) -> Option<B>
pub fn unwrap_body(self) -> Option<B>
Unwraps a frame, yielding the content of the Body
.
Sourcepub fn unwrap_err(self) -> E
pub fn unwrap_err(self) -> E
Unwraps a frame, yielding the content of the Error
.
Trait Implementations§
Auto Trait Implementations§
impl<T, B, E> Freeze for Frame<T, B, E>
impl<T, B, E> RefUnwindSafe for Frame<T, B, E>
impl<T, B, E> Send for Frame<T, B, E>
impl<T, B, E> Sync for Frame<T, B, E>
impl<T, B, E> Unpin for Frame<T, B, E>
impl<T, B, E> UnwindSafe for Frame<T, B, E>
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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)