Struct actix_web::http::header::AcceptCharset[][src]

pub struct AcceptCharset(pub Vec<QualityItem<Charset>>);
Expand description

Accept-Charset header, defined in RFC7231

The Accept-Charset header field can be sent by a user agent to indicate what charsets are acceptable in textual response content. This field allows user agents capable of understanding more comprehensive or special-purpose charsets to signal that capability to an origin server that is capable of representing information in those charsets.

ABNF

Accept-Charset = 1#( ( charset / "*" ) [ weight ] )

Example values

  • iso-8859-5, unicode-1-1;q=0.8

Examples

use actix_web::HttpResponse;
use actix_web::http::header::{AcceptCharset, Charset, qitem};

let mut builder = HttpResponse::Ok();
builder.insert_header(
    AcceptCharset(vec![qitem(Charset::Us_Ascii)])
);
use actix_web::HttpResponse;
use actix_web::http::header::{AcceptCharset, Charset, q, QualityItem};

let mut builder = HttpResponse::Ok();
builder.insert_header(
    AcceptCharset(vec![
        QualityItem::new(Charset::Us_Ascii, q(900)),
        QualityItem::new(Charset::Iso_8859_10, q(200)),
    ])
);
use actix_web::HttpResponse;
use actix_web::http::header::{AcceptCharset, Charset, qitem};

let mut builder = HttpResponse::Ok();
builder.insert_header(
    AcceptCharset(vec![qitem(Charset::Ext("utf-8".to_owned()))])
);

Tuple Fields

0: Vec<QualityItem<Charset>>

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Formats the value using the given formatter. Read more

Returns the name of the header field

Parse a header

The type returned in the event of a conversion error.

Try to convert value to a HeaderValue.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more