pub struct Manager_type(/* private fields */);
Expand description
A manager for tasks.
Implementations§
Source§impl Manager_type
impl Manager_type
pub const Root_task_identifier: Task_identifier_type = _
Sourcepub unsafe fn Register_task(&self) -> Result_type<()>
pub unsafe fn Register_task(&self) -> Result_type<()>
Register the current thread as a task.
This function should ONLY be called for testing purposes.
§Safety
This function is unsafe because it can lead to undefined behavior if the current thread is already registered.
pub fn Get_thread_name(&self) -> Option<String>
Sourcepub fn Get_task_name(
&self,
Task_identifier: Task_identifier_type,
) -> Result_type<String>
pub fn Get_task_name( &self, Task_identifier: Task_identifier_type, ) -> Result_type<String>
§Arguments
Task_identifier
- The identifier of the task.
pub fn New_thread_internal<T, F>( Parent_task_identifier: Task_identifier_type, Name: &str, Stack_size: Option<usize>, Function: F, Main_thread: bool, ) -> Result_type<Join_handle_type<T>>
Sourcepub fn New_thread<T, F>(
&self,
Parent_task_identifier: Task_identifier_type,
Name: &str,
Stack_size: Option<usize>,
Function: F,
) -> Result_type<Join_handle_type<T>>
pub fn New_thread<T, F>( &self, Parent_task_identifier: Task_identifier_type, Name: &str, Stack_size: Option<usize>, Function: F, ) -> Result_type<Join_handle_type<T>>
Create a new thread, returns the identifier of the thread.
This function checks if the parent task exists.
Sourcepub fn New_task<T, F>(
&self,
Parent_task_identifier: Task_identifier_type,
Name: &str,
Stack_size: Option<usize>,
Function: F,
) -> Result_type<(Task_identifier_type, Join_handle_type<T>)>
pub fn New_task<T, F>( &self, Parent_task_identifier: Task_identifier_type, Name: &str, Stack_size: Option<usize>, Function: F, ) -> Result_type<(Task_identifier_type, Join_handle_type<T>)>
Create a new child task, returns the identifier of the child task.
§Arguments
Parent_task_identifier
- The identifier of the parent task, if None, the current task is used.Owner
- The identifier of the user that owns the task, if None, the parent task owner is used.Name
- The human readable name of the task.Stack_size
- The size of the stack of the task.Function
- The function that the task will execute.
Sourcepub fn Get_child_tasks(
&self,
Task_identifier: Task_identifier_type,
) -> Result_type<Vec<Task_identifier_type>>
pub fn Get_child_tasks( &self, Task_identifier: Task_identifier_type, ) -> Result_type<Vec<Task_identifier_type>>
Get the children tasks of a task.
Sourcepub fn Get_parent_task(
&self,
Task_identifier: Task_identifier_type,
) -> Result_type<Task_identifier_type>
pub fn Get_parent_task( &self, Task_identifier: Task_identifier_type, ) -> Result_type<Task_identifier_type>
Get the parent task of a task.
pub fn Set_user( &self, Task_identifier: Task_identifier_type, User: User_identifier_type, ) -> Result_type<()>
pub fn Set_group( &self, Task_identifier: Task_identifier_type, Group: Group_identifier_type, ) -> Result_type<()>
Sourcepub fn Get_children_threads(
&self,
Task_identifier: Task_identifier_type,
) -> Result_type<Vec<Thread_identifier_type>>
pub fn Get_children_threads( &self, Task_identifier: Task_identifier_type, ) -> Result_type<Vec<Thread_identifier_type>>
Get the children threads of a task.
Sourcepub fn Get_user(
&self,
Task_identifier: Task_identifier_type,
) -> Result_type<User_identifier_type>
pub fn Get_user( &self, Task_identifier: Task_identifier_type, ) -> Result_type<User_identifier_type>
Get user identifier of the owner of a task.
Sourcepub fn Get_group(
&self,
Task_identifier: Task_identifier_type,
) -> Result_type<Group_identifier_type>
pub fn Get_group( &self, Task_identifier: Task_identifier_type, ) -> Result_type<Group_identifier_type>
Get group identifier of the owner of a task.
pub fn Get_current_thread_identifier(&self) -> Thread_identifier_type
pub fn Get_current_task_identifier(&self) -> Result_type<Task_identifier_type>
pub fn Get_environment_variable( &self, Task_identifier: Task_identifier_type, Name: &str, ) -> Result_type<Environment_variable_type>
pub fn Get_environment_variables( &self, Task_identifier: Task_identifier_type, ) -> Result_type<Vec<Environment_variable_type>>
pub fn Set_environment_variable( &self, Task_identifier: Task_identifier_type, Name: &str, Value: &str, ) -> Result_type<()>
pub fn Remove_environment_variable( &self, Task_identifier: Task_identifier_type, Name: &str, ) -> Result_type<()>
pub fn Pop_signal( &self, Task_identifier: Task_identifier_type, ) -> Result_type<Option<Signal_type>>
pub fn Peek_signal( &self, Task_identifier: Task_identifier_type, ) -> Result_type<Option<Signal_type>>
Auto Trait Implementations§
impl !Freeze for Manager_type
impl RefUnwindSafe for Manager_type
impl Send for Manager_type
impl Sync for Manager_type
impl Unpin for Manager_type
impl UnwindSafe for Manager_type
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