Skip to main content

StreamFormat

Trait StreamFormat 

Source
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§

Source

fn format_name(&self) -> &'static str

A short, stable name, reported as the format tracing field.

Source

fn default_content_type(&self) -> &'static str

The Content-Type this format emits when encoding.

Provided Methods§

Source

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§

Source§

impl StreamFormat for ArrowRecordBatchIpcStreamFormat

Available on crate feature arrow only.
Source§

impl StreamFormat for CsvStreamFormat

Available on crate feature csv only.
Source§

impl StreamFormat for JsonNewLineStreamFormat

Available on crate feature json only.
Source§

impl StreamFormat for ProtobufStreamFormat

Available on crate feature protobuf only.
Source§

impl StreamFormat for TextStreamFormat

Available on crate feature text only.
Source§

impl<E> StreamFormat for JsonArrayStreamFormat<E>
where E: Serialize,

Available on crate feature json only.