[−][src]Struct surf::http::trace::ServerTiming
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
impl ServerTiming
[src]
pub fn new() -> ServerTiming
[src]
Create a new instance of ServerTiming
.
pub fn from_headers(
headers: impl AsRef<Headers>
) -> Result<Option<ServerTiming>, Error>
[src]
headers: impl AsRef<Headers>
) -> Result<Option<ServerTiming>, Error>
Create a new instance from headers.
pub fn apply(&self, headers: impl AsMut<Headers>)
[src]
Sets the Server-Timing
header.
pub fn name(&self) -> HeaderName
[src]
Get the HeaderName
.
pub fn value(&self) -> HeaderValue
[src]
Get the HeaderValue
.
pub fn push(&mut self, entry: Metric)
[src]
Push an entry into the list of entries.
pub fn iter(&self) -> Iter<'_>ⓘ
[src]
An iterator visiting all server timings.
pub fn iter_mut(&mut self) -> IterMut<'_>ⓘ
[src]
An iterator visiting all server timings.
Trait Implementations
impl Debug for ServerTiming
[src]
impl<'a> IntoIterator for &'a mut ServerTiming
[src]
type Item = &'a mut Metric
The type of the elements being iterated over.
type IntoIter = IterMut<'a>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> <&'a mut ServerTiming as IntoIterator>::IntoIter
[src]
impl IntoIterator for ServerTiming
[src]
type Item = Metric
The type of the elements being iterated over.
type IntoIter = IntoIter
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> <ServerTiming as IntoIterator>::IntoIter
[src]
impl<'a> IntoIterator for &'a ServerTiming
[src]
type Item = &'a Metric
The type of the elements being iterated over.
type IntoIter = Iter<'a>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> <&'a ServerTiming as IntoIterator>::IntoIter
[src]
impl ToHeaderValues for ServerTiming
[src]
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
pub fn to_header_values(
&self
) -> Result<<ServerTiming as ToHeaderValues>::Iter, Error>
[src]
&self
) -> Result<<ServerTiming as ToHeaderValues>::Iter, Error>
Auto Trait Implementations
impl RefUnwindSafe for ServerTiming
impl Send for ServerTiming
impl Sync for ServerTiming
impl Unpin for ServerTiming
impl UnwindSafe for ServerTiming
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> I
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,