pub struct StreamFormatEnvelope<E> {
pub object: E,
pub array_field: String,
}Expand description
An object to wrap a streamed JSON array in.
The array is emitted as array_field of object, so
StreamFormatEnvelope { object: Meta { total: 3 }, array_field: "items" } produces
{"total":3,"items":[…]}.
Only one level of nesting is supported: the array is always a direct field of the envelope
object. This is a consequence of how the framing works: the envelope is serialised once,
its trailing } is stripped, and the array is appended. It is not something a deeper path
could be threaded through.
Fields§
§object: EThe object to wrap the array in.
array_field: StringThe field of object that the array is emitted as.
Trait Implementations§
Source§impl<E: Clone> Clone for StreamFormatEnvelope<E>
impl<E: Clone> Clone for StreamFormatEnvelope<E>
Source§fn clone(&self) -> StreamFormatEnvelope<E>
fn clone(&self) -> StreamFormatEnvelope<E>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<E> Freeze for StreamFormatEnvelope<E>where
E: Freeze,
impl<E> RefUnwindSafe for StreamFormatEnvelope<E>where
E: RefUnwindSafe,
impl<E> Send for StreamFormatEnvelope<E>where
E: Send,
impl<E> Sync for StreamFormatEnvelope<E>where
E: Sync,
impl<E> Unpin for StreamFormatEnvelope<E>where
E: Unpin,
impl<E> UnsafeUnpin for StreamFormatEnvelope<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for StreamFormatEnvelope<E>where
E: UnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
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