pub struct ThreadSpec { /* private fields */ }Expand description
Validated inputs used to create a scheduler thread record.
Implementations§
Source§impl ThreadSpec
impl ThreadSpec
Sourcepub const fn new(policy: SchedulePolicy) -> Self
pub const fn new(policy: SchedulePolicy) -> Self
Creates a thread specification with full topology affinity.
Sourcepub fn with_affinity(self, affinity: CpuSet) -> Self
pub fn with_affinity(self, affinity: CpuSet) -> Self
Restricts the thread to an explicit CPU set.
Sourcepub fn with_extension(self, extension: ThreadExtension) -> Self
pub fn with_extension(self, extension: ThreadExtension) -> Self
Attaches OS-specific state.
Sourcepub unsafe fn with_resources(self, resources: ThreadResources) -> Self
pub unsafe fn with_resources(self, resources: ThreadResources) -> Self
Associates a complete runtime resource bundle with the thread.
§Safety
resources must satisfy ThreadResources::new and must be consumed by
exactly this specification and its eventual scheduler record.
Sourcepub const fn policy(&self) -> SchedulePolicy
pub const fn policy(&self) -> SchedulePolicy
Returns the base scheduling policy.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ThreadSpec
impl !UnwindSafe for ThreadSpec
impl Freeze for ThreadSpec
impl Send for ThreadSpec
impl Sync for ThreadSpec
impl Unpin for ThreadSpec
impl UnsafeUnpin for ThreadSpec
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
Mutably borrows from an owned value. Read more