pub struct ServerTiming { /* private fields */ }
Expand description
Metrics and descriptions for the given request-response cycle.
§Specifications
§Examples
use http_types_rs::Response;
use http_types_rs::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§
Source§impl ServerTiming
impl ServerTiming
Trait Implementations§
Source§impl Debug for ServerTiming
impl Debug for ServerTiming
Source§impl Header for ServerTiming
impl Header for ServerTiming
Source§fn header_name(&self) -> HeaderName
fn header_name(&self) -> HeaderName
Access the header’s name.
Source§fn header_value(&self) -> HeaderValue
fn header_value(&self) -> HeaderValue
Access the header’s value.
Source§impl<'a> IntoIterator for &'a ServerTiming
impl<'a> IntoIterator for &'a ServerTiming
Source§impl<'a> IntoIterator for &'a mut ServerTiming
impl<'a> IntoIterator for &'a mut ServerTiming
Auto Trait Implementations§
impl Freeze for ServerTiming
impl RefUnwindSafe for ServerTiming
impl Send for ServerTiming
impl Sync for ServerTiming
impl Unpin for ServerTiming
impl UnwindSafe for ServerTiming
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ToHeaderValues for Twhere
T: Header,
impl<T> ToHeaderValues for Twhere
T: Header,
Source§type Iter = IntoIter<HeaderValue>
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
Source§fn to_header_values(&self) -> Result<<T as ToHeaderValues>::Iter, Error>
fn to_header_values(&self) -> Result<<T as ToHeaderValues>::Iter, Error>
Converts this object to an iterator of resolved
HeaderValues
.