pub struct ExecutionContext {
pub threads: usize,
}Expand description
Advisory runtime information handed to a codec after construction.
The struct is deliberately tiny for now. New fields can be added
without breaking API consumers that already construct the value via
ExecutionContext::serial or ExecutionContext::with_threads.
Fields§
§threads: usizeAdvisory cap on how many threads a codec may use for its own
internal parallelism (slice-parallel decode, GOP-parallel decode,
etc.). Always ≥ 1. 1 means “caller requests serial execution
from this codec” — obey it unless you have a very good reason.
Implementations§
Source§impl ExecutionContext
impl ExecutionContext
Sourcepub fn with_threads(threads: usize) -> Self
pub fn with_threads(threads: usize) -> Self
Budget the codec to at most threads internal workers. Values
below 1 are clamped up to 1.
Trait Implementations§
Source§impl Clone for ExecutionContext
impl Clone for ExecutionContext
Source§fn clone(&self) -> ExecutionContext
fn clone(&self) -> ExecutionContext
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 ExecutionContext
impl Debug for ExecutionContext
Auto Trait Implementations§
impl Freeze for ExecutionContext
impl RefUnwindSafe for ExecutionContext
impl Send for ExecutionContext
impl Sync for ExecutionContext
impl Unpin for ExecutionContext
impl UnsafeUnpin for ExecutionContext
impl UnwindSafe for ExecutionContext
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