Struct http_types::trace::ServerTiming[][src]

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

Metrics and descriptions for the given request-response cycle.

Specifications

Examples

use http_types::Response;
use http_types::trace::{ServerTiming, Metric};

let mut timings = ServerTiming::new();
timings.push(Metric::new("server".to_owned(), None, None)?);

let mut res = Response::new(200);
timings.apply(&mut res);

let timings = ServerTiming::from_headers(res)?.unwrap();
let entry = timings.iter().next().unwrap();
assert_eq!(entry.name(), "server");

Implementations

Create a new instance of ServerTiming.

Create a new instance from headers.

Sets the Server-Timing header.

Get the HeaderName.

Get the HeaderValue.

Push an entry into the list of entries.

An iterator visiting all server timings.

An iterator visiting all server timings.

Trait Implementations

Formats the value using the given formatter. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Returned iterator over header values which this type may correspond to.

Converts this object to an iterator of resolved HeaderValues.

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.