pub trait StreamFormat {
// Required methods
fn format_name(&self) -> &'static str;
fn default_content_type(&self) -> &'static str;
// Provided method
fn accepts_content_type(&self, ct: &ContentType<'_>) -> bool { ... }
}Expand description
Identity and content-type negotiation, shared by both directions.
Required Methods§
Sourcefn format_name(&self) -> &'static str
fn format_name(&self) -> &'static str
A short, stable name, reported as the format tracing field.
Sourcefn default_content_type(&self) -> &'static str
fn default_content_type(&self) -> &'static str
The Content-Type this format emits when encoding.
Provided Methods§
Sourcefn 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.
Implementations should be lenient about parameters, which ContentType has already
stripped, and should accept the well-known aliases for their wire format.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl StreamFormat for ArrowRecordBatchIpcStreamFormat
Available on crate feature
arrow only.impl StreamFormat for CsvStreamFormat
Available on crate feature
csv only.impl StreamFormat for JsonNewLineStreamFormat
Available on crate feature
json only.impl StreamFormat for ProtobufStreamFormat
Available on crate feature
protobuf only.impl StreamFormat for TextStreamFormat
Available on crate feature
text only.impl<E> StreamFormat for JsonArrayStreamFormat<E>where
E: Serialize,
Available on crate feature
json only.