Skip to main content

Thread

Trait Thread 

Source
pub trait Thread: Source {
    type Cpus: DoubleEndedIterator<Item = Cpu> + ExactSizeIterator + FusedIterator;
    type Timer: Timer;
    type Receiver: Receiver;

    // Required methods
    fn current() -> Result<Self::Cpus, Error>;
    fn bind(cpu: Cpu) -> Result<(), Error>;
    fn is_main() -> bool;

    // Provided methods
    fn try_crc32() -> Result<bool, Errno> { ... }
    fn entropy<const N: usize>(
        bytes: &mut MaybeUninit<[u8; N]>,
    ) -> Result<&mut [u8; N], Errno> { ... }
}
Expand description

Native thread services and their backend-specific signal and timer owners.

Required Associated Types§

Required Methods§

Source

fn current() -> Result<Self::Cpus, Error>

Source

fn bind(cpu: Cpu) -> Result<(), Error>

Source

fn is_main() -> bool

Returns whether the caller is the process’s original thread.

Provided Methods§

Source

fn try_crc32() -> Result<bool, Errno>

Admits the native IEEE CRC32 backend without shared feature state. A denied native query retains its exact errno; callers may use software CRC.

Source

fn entropy<const N: usize>( bytes: &mut MaybeUninit<[u8; N]>, ) -> Result<&mut [u8; N], Errno>

Initializes N caller-owned bytes from the operating system; N must not exceed 256.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§