Struct trillium_http_types::content::ContentLength[][src]

pub struct ContentLength { /* fields omitted */ }
Expand description

The size of the entity-body, in bytes, sent to the recipient.

Specifications

Examples

use http_types::Response;
use http_types::content::{ContentLength};

let content_len = ContentLength::new(12);

let mut res = Response::new(200);
res.insert_header(&content_len, &content_len);

let content_len = ContentLength::from_headers(res)?.unwrap();
assert_eq!(content_len.len(), 12);

Implementations

Create a new instance.

Create a new instance from headers.

Get the content length.

Set the content length.

Trait Implementations

Formats the value using the given formatter. Read more

Access the header’s name.

Access the header’s value.

Insert the header name and header value into something that looks like a Headers map. Read more

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.

Performs the conversion.

Should always be Self

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.