pub enum RawItem {
Data {
content_type: Option<Arc<str>>,
content: Content,
},
Progress {
content_type: Option<Arc<str>>,
content: Content,
},
Error {
message: Option<String>,
code: Option<String>,
recoverable: bool,
error: Box<RemoteError>,
},
Done,
}Expand description
One item of a response stream as a typed client reads it (PERF.115-36):
a StreamItem whose content is still the wire’s JSON (Content), and
nothing read that a typed decode does not use: no metadata. Transport::call_raw yields these and
decode_raw turns them into events; a consumer that
wants the metadata reads StreamItems.
Variants§
Data
A payload item: its content, and its content_type, which every item
of a call shares.
Progress
A progress report: the method’s progress value P (a Content,
decoded when an opted-in caller reads it), its content_type the
call’s. Never terminates the stream.
Error
The call failed: its typed RemoteError (RETURNS-6), beside
spec/05’s message and code. Terminates the stream.
Done
Normal end of stream.
Implementations§
Trait Implementations§
Source§impl From<StreamItem> for RawItem
impl From<StreamItem> for RawItem
Source§fn from(item: StreamItem) -> Self
fn from(item: StreamItem) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for RawItem
impl Freeze for RawItem
impl RefUnwindSafe for RawItem
impl Send for RawItem
impl Sync for RawItem
impl Unpin for RawItem
impl UnsafeUnpin for RawItem
impl UnwindSafe for RawItem
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