pub struct Timer { /* private fields */ }
Expand description
Timer used to share performance metrics to the client using the HTTP Server-Timing header https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing
Implementations§
Source§impl Timer
impl Timer
pub fn new() -> Self
Sourcepub fn add(&mut self, name: &str)
pub fn add(&mut self, name: &str)
Adds a named measurement, counting from the last one. Only alphanumeric characters are allowed, other characters are replaced with underscores.
pub fn header_key() -> &'static str
Sourcepub fn header_value(&self) -> String
pub fn header_value(&self) -> String
Returns the value for a Server-Timings header. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Send for Timer
impl Sync for Timer
impl Unpin for Timer
impl UnwindSafe for Timer
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