pub enum StreamingFormat {
Json,
Ndjson,
ServerSentEvents,
Binary,
}
Expand description
Streaming format options for framework responses
Variants§
Json
Standard JSON response
Ndjson
Newline-Delimited JSON (NDJSON)
ServerSentEvents
Server-Sent Events
Binary
Custom binary format
Implementations§
Source§impl StreamingFormat
impl StreamingFormat
Sourcepub fn content_type(&self) -> &'static str
pub fn content_type(&self) -> &'static str
Get the MIME type for this format
Sourcepub fn from_accept_header(accept: &str) -> Self
pub fn from_accept_header(accept: &str) -> Self
Detect format from Accept header
Sourcepub fn supports_streaming(&self) -> bool
pub fn supports_streaming(&self) -> bool
Check if format supports streaming
Trait Implementations§
Source§impl Clone for StreamingFormat
impl Clone for StreamingFormat
Source§fn clone(&self) -> StreamingFormat
fn clone(&self) -> StreamingFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StreamingFormat
impl Debug for StreamingFormat
Source§impl PartialEq for StreamingFormat
impl PartialEq for StreamingFormat
impl Copy for StreamingFormat
impl Eq for StreamingFormat
impl StructuralPartialEq for StreamingFormat
Auto Trait Implementations§
impl Freeze for StreamingFormat
impl RefUnwindSafe for StreamingFormat
impl Send for StreamingFormat
impl Sync for StreamingFormat
impl Unpin for StreamingFormat
impl UnwindSafe for StreamingFormat
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.