pub struct Session { /* private fields */ }Expand description
One causal profiling session with isolated owned metric storage.
Implementations§
Source§impl Session
impl Session
Sourcepub fn start(identity: RunIdentity) -> Result<Self, SessionActive>
pub fn start(identity: RunIdentity) -> Result<Self, SessionActive>
Start a fresh isolated session.
Sourcepub fn runtime(&self) -> Runtime
pub fn runtime(&self) -> Runtime
Clone the runtime handle for propagation to a worker or async task.
Sourcepub fn identity_mut(&mut self) -> &mut RunIdentity
pub fn identity_mut(&mut self) -> &mut RunIdentity
Mutate run identity before the session is finalized.
Sourcepub fn transition(&mut self, state: RunState)
pub fn transition(&mut self, state: RunState)
Record an explicit macro state transition.
Sourcepub fn finish(self, status: RunState) -> RunProfile
pub fn finish(self, status: RunState) -> RunProfile
Finish the session and return its complete structured record.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Session
impl !Sync for Session
impl Freeze for Session
impl RefUnwindSafe for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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