pub enum Frame<T, B, E> {
Message {
message: T,
body: bool,
},
Body {
chunk: Option<B>,
},
Error {
error: E,
},
}
Expand description
A pipelined protocol frame
Variants§
Message
Either a request or a response
Body
Body frame. None indicates that the body is done streaming.
Fields
Error
Error
Fields
§
error: E
Error value
Implementations§
Source§impl<T, B, E> Frame<T, B, E>
impl<T, B, E> Frame<T, B, E>
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
)