#[repr(C)]pub enum ThreadingPolicy {
Single,
Fixed(usize),
Adaptive,
}Expand description
Declares thread policy usage
Variants§
Single
Will use only one current thread
Fixed(usize)
Spawn provided threads count, will not work for wasm - fallback to Single
Adaptive
Computes adaptive thread count between 1…available parallelism
for given image bounds, will not work for wasm - fallback to Single
Implementations§
Source§impl ThreadingPolicy
impl ThreadingPolicy
Sourcepub fn thread_count(&self, for_size: ImageSize) -> usize
Available on non-WebAssembly only.
pub fn thread_count(&self, for_size: ImageSize) -> usize
Returns the number of threads to use for the given image dimensions under the selected policy variant.
Source§impl ThreadingPolicy
impl ThreadingPolicy
pub fn get_pool(&self, for_size: ImageSize) -> Option<ThreadPool>
Available on non-WebAssembly only.
Trait Implementations§
Source§impl Clone for ThreadingPolicy
impl Clone for ThreadingPolicy
Source§fn clone(&self) -> ThreadingPolicy
fn clone(&self) -> ThreadingPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ThreadingPolicy
impl Debug for ThreadingPolicy
Source§impl Default for ThreadingPolicy
impl Default for ThreadingPolicy
Source§fn default() -> ThreadingPolicy
fn default() -> ThreadingPolicy
Returns the “default value” for a type. Read more
Source§impl Ord for ThreadingPolicy
impl Ord for ThreadingPolicy
Source§fn cmp(&self, other: &ThreadingPolicy) -> Ordering
fn cmp(&self, other: &ThreadingPolicy) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ThreadingPolicy
impl PartialEq for ThreadingPolicy
Source§impl PartialOrd for ThreadingPolicy
impl PartialOrd for ThreadingPolicy
impl Copy for ThreadingPolicy
impl Eq for ThreadingPolicy
impl StructuralPartialEq for ThreadingPolicy
Auto Trait Implementations§
impl Freeze for ThreadingPolicy
impl RefUnwindSafe for ThreadingPolicy
impl Send for ThreadingPolicy
impl Sync for ThreadingPolicy
impl Unpin for ThreadingPolicy
impl UnwindSafe for ThreadingPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more