#[non_exhaustive]pub enum ThreadingPolicy {
SingleThread,
LimitOrSingle {
max_threads: u16,
},
LimitOrAny {
preferred_max_threads: u16,
},
Balanced,
Unlimited,
}Expand description
Threading policy for codec operations.
Controls how many threads a codec may use. Codecs report their
supported range via
EncodeCapabilities::threads_supported_range()
and DecodeCapabilities::threads_supported_range().
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
SingleThread
Force single-threaded operation.
Useful for deterministic output or constrained environments.
LimitOrSingle
Use at most max_threads threads. If the codec would need more,
fall back to single-threaded.
LimitOrAny
Prefer at most preferred_max_threads threads, but the codec
may use more if it needs to.
Balanced
Let the codec pick a reasonable thread count based on available parallelism (typically half of available cores or similar).
Unlimited
No thread limit. Use as many threads as the codec wants.
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 PartialEq for ThreadingPolicy
impl PartialEq 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 UnsafeUnpin 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