pub struct Task {
    pub pid: i32,
    pub tid: i32,
    /* private fields */
}
Expand description

A task (aka Thread) inside of a Process

Created by Process::tasks, tasks in general are similar to Processes and should have mostly the same fields.

Fields

pid: i32

The ID of the process that this task belongs to

tid: i32

The task ID

Implementations

Thread info from /proc/<pid>/task/<tid>/stat

Many of the returned fields will be the same as the parent process, but some fields like utime and stime will be per-task

Thread info from /proc/<pid>/task/<tid>/status

Many of the returned fields will be the same as the parent process

Thread IO info from /proc/<pid>/task/<tid>/io

This data will be unique per task.

Thread scheduler info from /proc/<pid>/task/<tid>/schedstat

This data will be unique per task.

Thread children from /proc/<pid>/task/<tid>/children

WARNING: This interface is not reliable unless all the child processes are stoppped or frozen. If a child task exits while the file is being read, non-exiting children may be omitted. See the procfs(5) man page for more information.

This data will be unique per task.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.