Trait thread_priority::windows::ThreadExt[][src]

pub trait ThreadExt {
    fn get_priority(&self) -> Result<ThreadPriority, Error> { ... }
fn set_priority(&self, priority: ThreadPriority) -> Result<(), Error> { ... }
fn get_native_id(&self) -> ThreadId { ... }
fn set_ideal_processor(
        &self,
        ideal_processor: IdealProcessor
    ) -> Result<IdealProcessor, Error> { ... }
fn set_priority_boost(&self, enabled: bool) -> Result<(), Error> { ... } }
Expand description

Windows-specific complemented part of the crate::ThreadExt trait.

Provided methods

Returns current thread’s priority. For more info see thread_priority.

use thread_priority::*;

assert!(std::thread::current().get_priority().is_ok());

Sets current thread’s priority. For more info see set_current_thread_priority.

use thread_priority::*;

assert!(std::thread::current().set_priority(ThreadPriority::Min).is_ok());

Returns current thread’s windows id. For more info see thread_native_id.

use thread_priority::*;

assert!(!std::thread::current().get_native_id().is_null());

Sets current thread’s ideal processor. For more info see set_current_thread_ideal_processor.

use thread_priority::*;

assert!(std::thread::current().set_ideal_processor(0).is_ok());

Sets current thread’s priority boost. For more info see set_current_thread_priority_boost.

use thread_priority::*;

assert!(std::thread::current().set_priority_boost(true).is_ok());

Implementations on Foreign Types

Auto-implementation of this trait for the std::thread::Thread.

Implementors