Skip to main content

HeaderWriter

Trait HeaderWriter 

Source
pub trait HeaderWriter: Sized {
    // Required method
    fn write_header(&self, writer: &mut impl Writer);

    // Provided method
    fn to_header(&self) -> String { ... }
}
Expand description

A header that can be written to a message.

Required Methods§

Source

fn write_header(&self, writer: &mut impl Writer)

Writes the complete header field, including the field name and the trailing CRLF, to writer.

Provided Methods§

Source

fn to_header(&self) -> String

Returns the complete header field as a string, including the field name and the trailing CRLF. Invalid UTF-8 is replaced with U+FFFD.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§