Struct storage_trace::__backend::Id
source · pub struct Id(/* private fields */);
Expand description
An identifier for flows and async spans.
Implementations§
source§impl Id
impl Id
sourcepub fn new() -> Id
pub fn new() -> Id
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() -> Id
pub fn random() -> Id
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
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)