pub unsafe trait GetThreadId {
    const INIT: Self;

    // Required method
    fn nonzero_thread_id(&self) -> NonZeroUsize;
}
Expand description

Helper trait which returns a non-zero thread ID.

The simplest way to implement this trait is to return the address of a thread-local variable.

Safety

Implementations of this trait must ensure that no two active threads share the same thread ID. However the ID of a thread that has exited can be re-used since that thread is no longer active.

Required Associated Constants§

const INIT: Self

Initial value.

Required Methods§

fn nonzero_thread_id(&self) -> NonZeroUsize

Returns a non-zero thread ID which identifies the current thread of execution.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl GetThreadId for RawThreadId

Implementors§

source§

impl GetThreadId for holochain::prelude::dependencies::kitsune_p2p_types::dependencies::lair_keystore_api::dependencies::parking_lot::RawThreadId

source§

const INIT: RawThreadId = RawThreadId