pub struct WorkersCount(/* private fields */);Expand description
A wrapper around NonZeroUsize that enforces a maximum value.
This is used to ensure that the number of workers for loading trusted issuers does not exceed a reasonable limit.
The maximum value is defined based on the target architecture to prevent excessive resource usage.
On non-WebAssembly targets, the maximum is set to 1000, while on WebAssembly targets, it is set to 4 to align with typical browser limits on concurrent HTTP connections.
Implementations§
Source§impl WorkersCount
impl WorkersCount
Sourcepub const MAX: WorkersCount
pub const MAX: WorkersCount
Maximum number of workers is 1000 to prevent excessive resource usage.
Sourcepub const DEFAULT: WorkersCount
pub const DEFAULT: WorkersCount
For native architecture default value is 10. Should cover most of cases.
Source§impl WorkersCount
impl WorkersCount
Sourcepub const MIN: WorkersCount
pub const MIN: WorkersCount
Minimum number of workers is 1.
Trait Implementations§
Source§impl Clone for WorkersCount
impl Clone for WorkersCount
Source§fn clone(&self) -> WorkersCount
fn clone(&self) -> WorkersCount
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for WorkersCount
Source§impl Debug for WorkersCount
impl Debug for WorkersCount
Source§impl Default for WorkersCount
impl Default for WorkersCount
Source§impl Deref for WorkersCount
impl Deref for WorkersCount
Source§impl<'de> Deserialize<'de> for WorkersCount
impl<'de> Deserialize<'de> for WorkersCount
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for WorkersCount
Source§impl Ord for WorkersCount
impl Ord for WorkersCount
Source§fn cmp(&self, other: &WorkersCount) -> Ordering
fn cmp(&self, other: &WorkersCount) -> Ordering
1.21.0 (const: unstable) · 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 WorkersCount
impl PartialEq for WorkersCount
Source§impl PartialEq<usize> for WorkersCount
impl PartialEq<usize> for WorkersCount
Source§impl PartialOrd for WorkersCount
impl PartialOrd for WorkersCount
Source§impl Serialize for WorkersCount
impl Serialize for WorkersCount
impl StructuralPartialEq for WorkersCount
Auto Trait Implementations§
impl Freeze for WorkersCount
impl RefUnwindSafe for WorkersCount
impl Send for WorkersCount
impl Sync for WorkersCount
impl Unpin for WorkersCount
impl UnsafeUnpin for WorkersCount
impl UnwindSafe for WorkersCount
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request