pub struct ThreadName(/* private fields */);Expand description
A non-empty thread name value.
Implementations§
Source§impl ThreadName
impl ThreadName
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, ThreadNameError>
pub fn new(value: impl AsRef<str>) -> Result<Self, ThreadNameError>
Creates a thread name from non-empty text.
§Errors
Returns ThreadNameError::Empty when the trimmed input is empty.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the thread name and returns the owned string.
Trait Implementations§
Source§impl AsRef<str> for ThreadName
impl AsRef<str> for ThreadName
Source§impl Clone for ThreadName
impl Clone for ThreadName
Source§fn clone(&self) -> ThreadName
fn clone(&self) -> ThreadName
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 ThreadName
impl Debug for ThreadName
Source§impl Display for ThreadName
impl Display for ThreadName
Source§impl FromStr for ThreadName
impl FromStr for ThreadName
Source§impl Hash for ThreadName
impl Hash for ThreadName
Source§impl Ord for ThreadName
impl Ord for ThreadName
Source§fn cmp(&self, other: &ThreadName) -> Ordering
fn cmp(&self, other: &ThreadName) -> 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 ThreadName
impl PartialEq for ThreadName
Source§fn eq(&self, other: &ThreadName) -> bool
fn eq(&self, other: &ThreadName) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ThreadName
impl PartialOrd for ThreadName
impl Eq for ThreadName
impl StructuralPartialEq for ThreadName
Auto Trait Implementations§
impl Freeze for ThreadName
impl RefUnwindSafe for ThreadName
impl Send for ThreadName
impl Sync for ThreadName
impl Unpin for ThreadName
impl UnsafeUnpin for ThreadName
impl UnwindSafe for ThreadName
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