pub struct CallTimer {
pub call_id: String,
pub started_at: DateTime<Utc>,
/* private fields */
}Expand description
Timer utility for measuring call duration and generating call IDs.
Fields§
§call_id: StringUnique call identifier
started_at: DateTime<Utc>When the call started (UTC)
Implementations§
Source§impl CallTimer
impl CallTimer
Sourcepub fn finish(&self) -> (DateTime<Utc>, u128)
pub fn finish(&self) -> (DateTime<Utc>, u128)
Finish the timer and return the completion time and duration.
Sourcepub fn elapsed_ms(&self) -> u128
pub fn elapsed_ms(&self) -> u128
Return the elapsed duration in milliseconds without capturing a new timestamp.
Useful when you need to reuse a previously captured completed_at timestamp
for consistent day-bucket placement.
Auto Trait Implementations§
impl Freeze for CallTimer
impl RefUnwindSafe for CallTimer
impl Send for CallTimer
impl Sync for CallTimer
impl Unpin for CallTimer
impl UnsafeUnpin for CallTimer
impl UnwindSafe for CallTimer
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