Enum ThreadIdLabel
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§
§impl ThreadIdLabel
impl ThreadIdLabel
pub 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.
pub const fn number(value: u64) -> ThreadIdLabel
pub const fn number(value: u64) -> ThreadIdLabel
Creates a numeric thread-like identifier.
Trait Implementations§
§impl Clone for ThreadIdLabel
impl Clone for ThreadIdLabel
§fn clone(&self) -> ThreadIdLabel
fn clone(&self) -> ThreadIdLabel
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 ThreadIdLabel
impl Debug for ThreadIdLabel
§impl Display for ThreadIdLabel
impl Display for ThreadIdLabel
§impl FromStr for ThreadIdLabel
impl FromStr for ThreadIdLabel
§type Err = ThreadIdLabelError
type Err = ThreadIdLabelError
The associated error which can be returned from parsing.
§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 more§impl Hash for ThreadIdLabel
impl Hash for ThreadIdLabel
§impl Ord for ThreadIdLabel
impl Ord for ThreadIdLabel
§impl PartialEq for ThreadIdLabel
impl PartialEq for ThreadIdLabel
§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