Struct ThreadCount
pub struct ThreadCount(/* private fields */);Expand description
A non-zero thread count.
Implementations§
§impl ThreadCount
impl ThreadCount
pub fn new(value: usize) -> Result<ThreadCount, ThreadCountError>
pub fn new(value: usize) -> Result<ThreadCount, ThreadCountError>
Creates a thread count from a non-zero value.
§Errors
Returns ThreadCountError::Zero when value is zero.
Trait Implementations§
§impl Clone for ThreadCount
impl Clone for ThreadCount
§fn clone(&self) -> ThreadCount
fn clone(&self) -> ThreadCount
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 more§impl Debug for ThreadCount
impl Debug for ThreadCount
§impl Display for ThreadCount
impl Display for ThreadCount
§impl From<NonZero<usize>> for ThreadCount
impl From<NonZero<usize>> for ThreadCount
§fn from(value: NonZero<usize>) -> ThreadCount
fn from(value: NonZero<usize>) -> ThreadCount
Converts to this type from the input type.
§impl Hash for ThreadCount
impl Hash for ThreadCount
§impl Ord for ThreadCount
impl Ord for ThreadCount
§impl PartialEq for ThreadCount
impl PartialEq for ThreadCount
§impl PartialOrd for ThreadCount
impl PartialOrd for ThreadCount
§impl TryFrom<usize> for ThreadCount
impl TryFrom<usize> for ThreadCount
§type Error = ThreadCountError
type Error = ThreadCountError
The type returned in the event of a conversion error.
§fn try_from(
value: usize,
) -> Result<ThreadCount, <ThreadCount as TryFrom<usize>>::Error>
fn try_from( value: usize, ) -> Result<ThreadCount, <ThreadCount as TryFrom<usize>>::Error>
Performs the conversion.
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