Trait web_socket::http::Header

source ·
pub trait Header {
    // Required method
    fn fmt(_: &Self) -> String;
}
Expand description

Example

use web_socket::http::Header;

assert_eq!(Header::fmt(&("val", 2)), "val: 2\r\n");
assert_eq!(Header::fmt(&["key", "value"]), "key: value\r\n");

Required Methods§

source

fn fmt(_: &Self) -> String

Format a single http header field

Implementations on Foreign Types§

source§

impl<K: Display, V: Display> Header for (K, V)

source§

fn fmt((key, value): &Self) -> String

source§

impl<T: Display> Header for [T; 2]

source§

fn fmt([key, value]: &Self) -> String

source§

impl<T: Header> Header for &T

source§

fn fmt(this: &Self) -> String

Implementors§