pub enum ThreadIdLabel {
Label(String),
Number(u64),
}Expand description
A stable label or numeric thread-like identifier.
Variants§
Label(String)
A caller-provided stable thread label.
Number(u64)
A caller-provided numeric thread-like identifier.
Implementations§
Source§impl ThreadIdLabel
impl ThreadIdLabel
Sourcepub fn label(
value: impl AsRef<str>,
) -> Result<ThreadIdLabel, ThreadIdLabelError>
pub fn label( value: impl AsRef<str>, ) -> Result<ThreadIdLabel, ThreadIdLabelError>
Creates a thread ID label from non-empty text.
§Errors
Returns ThreadIdLabelError::Empty when the trimmed input is empty.
Sourcepub const fn number(value: u64) -> ThreadIdLabel
pub const fn number(value: u64) -> ThreadIdLabel
Creates a numeric thread-like identifier.
Trait Implementations§
Source§impl Clone for ThreadIdLabel
impl Clone for ThreadIdLabel
Source§fn clone(&self) -> ThreadIdLabel
fn clone(&self) -> ThreadIdLabel
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 ThreadIdLabel
impl Debug for ThreadIdLabel
Source§impl Display for ThreadIdLabel
impl Display for ThreadIdLabel
Source§impl FromStr for ThreadIdLabel
impl FromStr for ThreadIdLabel
Source§type Err = ThreadIdLabelError
type Err = ThreadIdLabelError
The associated error which can be returned from parsing.
Source§fn from_str(
value: &str,
) -> Result<ThreadIdLabel, <ThreadIdLabel as FromStr>::Err>
fn from_str( value: &str, ) -> Result<ThreadIdLabel, <ThreadIdLabel as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for ThreadIdLabel
impl Hash for ThreadIdLabel
Source§impl Ord for ThreadIdLabel
impl Ord for ThreadIdLabel
Source§fn cmp(&self, other: &ThreadIdLabel) -> Ordering
fn cmp(&self, other: &ThreadIdLabel) -> 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 ThreadIdLabel
impl PartialEq for ThreadIdLabel
Source§fn eq(&self, other: &ThreadIdLabel) -> bool
fn eq(&self, other: &ThreadIdLabel) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ThreadIdLabel
impl PartialOrd for ThreadIdLabel
impl Eq for ThreadIdLabel
impl StructuralPartialEq for ThreadIdLabel
Auto Trait Implementations§
impl Freeze for ThreadIdLabel
impl RefUnwindSafe for ThreadIdLabel
impl Send for ThreadIdLabel
impl Sync for ThreadIdLabel
impl Unpin for ThreadIdLabel
impl UnsafeUnpin for ThreadIdLabel
impl UnwindSafe for ThreadIdLabel
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