pub struct JsonArrayStreamFormat<E = ()>where
E: Serialize,{ /* private fields */ }Available on crate feature
json only.Expand description
A JSON array: [item, item, …], optionally wrapped in an envelope object.
Implementations§
Source§impl JsonArrayStreamFormat
impl JsonArrayStreamFormat
Sourcepub fn new() -> JsonArrayStreamFormat<()>
pub fn new() -> JsonArrayStreamFormat<()>
A bare array.
Sourcepub fn with_envelope<E>(
envelope: E,
array_field: &str,
) -> JsonArrayStreamFormat<E>where
E: Serialize,
pub fn with_envelope<E>(
envelope: E,
array_field: &str,
) -> JsonArrayStreamFormat<E>where
E: Serialize,
An array emitted as array_field of envelope.
Encode only: the decoder expects a bare array and will not unwrap an envelope.
Trait Implementations§
Source§impl<E> Clone for JsonArrayStreamFormat<E>
impl<E> Clone for JsonArrayStreamFormat<E>
Source§fn clone(&self) -> JsonArrayStreamFormat<E>
fn clone(&self) -> JsonArrayStreamFormat<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 moreSource§impl<E> Debug for JsonArrayStreamFormat<E>
impl<E> Debug for JsonArrayStreamFormat<E>
Source§impl Default for JsonArrayStreamFormat<()>
impl Default for JsonArrayStreamFormat<()>
Source§impl DefaultFormat for JsonArrayStreamFormat<()>
impl DefaultFormat for JsonArrayStreamFormat<()>
Source§fn default_format() -> Self
fn default_format() -> Self
The configuration to use when the caller supplied none.
Source§impl<E> StreamFormat for JsonArrayStreamFormat<E>where
E: Serialize,
impl<E> StreamFormat for JsonArrayStreamFormat<E>where
E: Serialize,
Source§fn format_name(&self) -> &'static str
fn format_name(&self) -> &'static str
A short, stable name, reported as the
format tracing field.Source§fn default_content_type(&self) -> &'static str
fn default_content_type(&self) -> &'static str
The
Content-Type this format emits when encoding.Source§fn accepts_content_type(&self, ct: &ContentType<'_>) -> bool
fn accepts_content_type(&self, ct: &ContentType<'_>) -> bool
Whether an incoming
Content-Type should be accepted as this format. Read moreSource§impl<T, E> StreamFormatDecode<T> for JsonArrayStreamFormat<E>where
T: for<'de> Deserialize<'de>,
E: Serialize,
impl<T, E> StreamFormatDecode<T> for JsonArrayStreamFormat<E>where
T: for<'de> Deserialize<'de>,
E: Serialize,
Source§type Framer = JsonArrayCodec<T>
type Framer = JsonArrayCodec<T>
Splits the body into records. Read more
Source§type Parser = IdentityParser
type Parser = IdentityParser
Deserialises framed records.
Source§fn framer(&self, options: &DecodeOptions) -> Self::Framer
fn framer(&self, options: &DecodeOptions) -> Self::Framer
Build a framer for one body.
Source§impl<T, E> StreamFormatEncode<T> for JsonArrayStreamFormat<E>
impl<T, E> StreamFormatEncode<T> for JsonArrayStreamFormat<E>
Auto Trait Implementations§
impl<E> Freeze for JsonArrayStreamFormat<E>
impl<E> RefUnwindSafe for JsonArrayStreamFormat<E>
impl<E> Send for JsonArrayStreamFormat<E>
impl<E> Sync for JsonArrayStreamFormat<E>
impl<E> Unpin for JsonArrayStreamFormat<E>
impl<E> UnsafeUnpin for JsonArrayStreamFormat<E>
impl<E> UnwindSafe for JsonArrayStreamFormat<E>
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