pub struct TaskCommand { /* private fields */ }Expand description
The command for a task.
Linux task commands are limited to 15 bytes, but Fuchsia allows longer names in places. It’s useful to store longer names diagnostics and debugging information.
Implementations§
Source§impl TaskCommand
impl TaskCommand
Sourcepub fn new(name: &[u8]) -> Self
pub fn new(name: &[u8]) -> Self
Create a new TaskCommand from a byte slice. The byte slice is truncated at the first null
byte if any.
Sourcepub fn from_path_bytes(path: &[u8]) -> Self
pub fn from_path_bytes(path: &[u8]) -> Self
Create a new TaskCommand from a path. The basename of the path is used as the name.
Sourcepub fn prctl_name(&self) -> [u8; 16]
pub fn prctl_name(&self) -> [u8; 16]
Returns the name as a 16-byte array, null-terminated if shorter than 16 bytes,
as expected by prctl(PR_GET_NAME).
Sourcepub fn try_embed(&self, other: &TaskCommand) -> Option<Self>
pub fn try_embed(&self, other: &TaskCommand) -> Option<Self>
Tries to embed other as the Linux name within this command.
Returns a new TaskCommand if other is a substring of this command.
Trait Implementations§
Source§impl Clone for TaskCommand
impl Clone for TaskCommand
Source§fn clone(&self) -> TaskCommand
fn clone(&self) -> TaskCommand
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 moreSource§impl Debug for TaskCommand
impl Debug for TaskCommand
Source§impl Default for TaskCommand
impl Default for TaskCommand
Source§impl Display for TaskCommand
impl Display for TaskCommand
Source§impl Hash for TaskCommand
impl Hash for TaskCommand
Source§impl Into<FlyByteStr> for TaskCommand
impl Into<FlyByteStr> for TaskCommand
Source§fn into(self) -> FlyByteStr
fn into(self) -> FlyByteStr
Converts this type into the (usually inferred) input type.
Source§impl Ord for TaskCommand
impl Ord for TaskCommand
Source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
This comparison ignores the linux rendering of the name and provides a total ordering based on the full name.
1.21.0 · 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 TaskCommand
impl PartialEq for TaskCommand
Source§impl PartialOrd for TaskCommand
impl PartialOrd for TaskCommand
impl Eq for TaskCommand
impl StructuralPartialEq for TaskCommand
Auto Trait Implementations§
impl Freeze for TaskCommand
impl RefUnwindSafe for TaskCommand
impl Send for TaskCommand
impl Sync for TaskCommand
impl Unpin for TaskCommand
impl UnwindSafe for TaskCommand
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.