pub struct ThreadId(/* private fields */);Expand description
A validated thread id. Construction from user- or externally-supplied
input goes through ThreadId::new, which rejects anything that is not a
safe single shell token (see validate_thread_id). That invariant is what
lets recommended-command breadcrumbs interpolate a thread id bare — there
is no whitespace or shell metacharacter to quote, by construction.
Implementations§
Source§impl ThreadId
impl ThreadId
Sourcepub fn new(value: impl Into<String>) -> Result<Self, ThreadIdError>
pub fn new(value: impl Into<String>) -> Result<Self, ThreadIdError>
Construct a thread id from user/external input, validating it against
the safe slug rule. Returns a ThreadIdError carrying an actionable
rename hint when the input is empty or contains a space, a shell
metacharacter, a .. path segment, or a leading /.
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ThreadId
impl<'de> Deserialize<'de> for ThreadId
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ThreadId
Source§impl Ord for ThreadId
impl Ord for ThreadId
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 PartialOrd for ThreadId
impl PartialOrd for ThreadId
impl StructuralPartialEq for ThreadId
Auto Trait Implementations§
impl Freeze for ThreadId
impl RefUnwindSafe for ThreadId
impl Send for ThreadId
impl Sync for ThreadId
impl Unpin for ThreadId
impl UnsafeUnpin for ThreadId
impl UnwindSafe for ThreadId
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