pub struct ThreadCount(/* private fields */);Expand description
A non-zero thread count.
Implementations§
Source§impl ThreadCount
impl ThreadCount
Sourcepub fn new(value: usize) -> Result<Self, ThreadCountError>
pub fn new(value: usize) -> Result<Self, ThreadCountError>
Creates a thread count from a non-zero value.
§Errors
Returns ThreadCountError::Zero when value is zero.
Trait Implementations§
Source§impl Clone for ThreadCount
impl Clone for ThreadCount
Source§fn clone(&self) -> ThreadCount
fn clone(&self) -> ThreadCount
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 moreSource§impl Debug for ThreadCount
impl Debug for ThreadCount
Source§impl Display for ThreadCount
impl Display for ThreadCount
Source§impl From<NonZero<usize>> for ThreadCount
impl From<NonZero<usize>> for ThreadCount
Source§fn from(value: NonZeroUsize) -> Self
fn from(value: NonZeroUsize) -> Self
Converts to this type from the input type.
Source§impl Hash for ThreadCount
impl Hash for ThreadCount
Source§impl Ord for ThreadCount
impl Ord for ThreadCount
Source§fn cmp(&self, other: &ThreadCount) -> Ordering
fn cmp(&self, other: &ThreadCount) -> 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 ThreadCount
impl PartialEq for ThreadCount
Source§fn eq(&self, other: &ThreadCount) -> bool
fn eq(&self, other: &ThreadCount) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ThreadCount
impl PartialOrd for ThreadCount
Source§impl TryFrom<usize> for ThreadCount
impl TryFrom<usize> for ThreadCount
impl Copy for ThreadCount
impl Eq for ThreadCount
impl StructuralPartialEq for ThreadCount
Auto Trait Implementations§
impl Freeze for ThreadCount
impl RefUnwindSafe for ThreadCount
impl Send for ThreadCount
impl Sync for ThreadCount
impl Unpin for ThreadCount
impl UnsafeUnpin for ThreadCount
impl UnwindSafe for ThreadCount
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