pub struct RecommendedConcurrency { /* private fields */ }Expand description
The recommended concurrency of a codec includes the most efficient and maximum recommended concurrency.
Consider a chain that does slow decoding first on a single thread, but subsequent codecs can run on multiple threads. In this case, recommended concurrency is best expressed by two numbers:
- the efficient concurrency, equal to the minimum of codecs
- the maximum concurrency, equal to the maximum of codecs
Implementations§
Source§impl RecommendedConcurrency
impl RecommendedConcurrency
Sourcepub fn new(range: impl RangeBounds<usize>) -> RecommendedConcurrency
pub fn new(range: impl RangeBounds<usize>) -> RecommendedConcurrency
Create a new recommended concurrency struct with an explicit concurrency range and preferred concurrency.
A minimum concurrency of zero is interpreted as a minimum concurrency of one.
Sourcepub fn new_minimum(minimum: usize) -> RecommendedConcurrency
pub fn new_minimum(minimum: usize) -> RecommendedConcurrency
Create a new recommended concurrency struct with a specified minimum concurrency and unbounded maximum concurrency.
Sourcepub fn new_maximum(maximum: usize) -> RecommendedConcurrency
pub fn new_maximum(maximum: usize) -> RecommendedConcurrency
Create a new recommended concurrency struct with a specified maximum concurrency.
Trait Implementations§
Source§impl Clone for RecommendedConcurrency
impl Clone for RecommendedConcurrency
Source§fn clone(&self) -> RecommendedConcurrency
fn clone(&self) -> RecommendedConcurrency
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 moreAuto Trait Implementations§
impl Freeze for RecommendedConcurrency
impl Send for RecommendedConcurrency
impl Sync for RecommendedConcurrency
impl RefUnwindSafe for RecommendedConcurrency
impl Unpin for RecommendedConcurrency
impl UnsafeUnpin for RecommendedConcurrency
impl UnwindSafe for RecommendedConcurrency
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