Struct trillium_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);
res.insert_header(&timings, &timings);

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.

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

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

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

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.