pub struct Id(/* private fields */);
Expand description
An identifier for flows and async spans.
Implementations§
Source§impl Id
impl Id
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new Id
. Id
s created by separate calls to new
in the same process are
guaranteed to be distinct.
WARNING: Id::new
is likely to hit the UI bug where UIs group async
durations with the same trace id but different process ids. Use
Id::random
instead. (Until https://fxbug.dev/42054669 is fixed.)
Sourcepub fn random() -> Self
pub fn random() -> Self
Creates a new Id
based on the current montonic time and a random u16
to, with high
probability, avoid the bug where UIs group async durations with the same trace id but
different process ids.
Id::new
is likely to hit the UI bug because it (per process) generates trace ids
consecutively starting from 1.
https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/system/ulib/trace-engine/nonce.cc;l=15-17;drc=b1c2f508a59e6c87c617852ed3e424693a392646
TODO(https://fxbug.dev/42054669) Delete this and migrate clients to Id::new
once UIs stop grouping
async durations with the same trace id but different process ids.
Trait Implementations§
Source§impl Ord for Id
impl Ord for Id
Source§impl PartialOrd for Id
impl PartialOrd for Id
impl Copy for Id
impl Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)