pub struct CurrentTask {
pub task: OwnedRef<Task>,
pub thread_state: Box<ThreadState>,
pub overridden_creds: RefCell<Option<FullCredentials>>,
/* private fields */
}Expand description
The task object associated with the currently executing thread.
We often pass the CurrentTask as the first argument to functions if those functions need to
know contextual information about the thread on which they are running. For example, we often
use the CurrentTask to perform access checks, which ensures that the caller is authorized to
perform the requested operation.
The CurrentTask also has state that can be referenced only on the currently executing thread,
such as the register state for that thread. Syscalls are given a mutable references to the
CurrentTask, which lets them manipulate this state.
See also Task for more information about tasks.
Fields§
§task: OwnedRef<Task>The underlying task object.
thread_state: Box<ThreadState>§overridden_creds: RefCell<Option<FullCredentials>>Implementations§
Source§impl CurrentTask
impl CurrentTask
pub fn new(task: OwnedRef<Task>, thread_state: Box<ThreadState>) -> Self
Sourcepub fn current_creds(&self) -> Credentials
pub fn current_creds(&self) -> Credentials
Returns the current subjective credentials of the task.
The subjective credentials are the credentials that are used to check permissions for actions performed by the task.
pub fn with_current_creds<B, F>(&self, f: F) -> Bwhere
F: FnOnce(&Credentials) -> B,
Sourcepub fn full_current_creds(&self) -> FullCredentials
pub fn full_current_creds(&self) -> FullCredentials
Returns the current subjective credentials of the task, including the security state.
pub fn current_fscred(&self) -> FsCred
pub fn current_ucred(&self) -> ucred
Sourcepub async fn override_creds_async<R>(
&self,
alter_creds: impl FnOnce(&mut FullCredentials),
callback: impl AsyncFnOnce() -> R,
) -> R
pub async fn override_creds_async<R>( &self, alter_creds: impl FnOnce(&mut FullCredentials), callback: impl AsyncFnOnce() -> R, ) -> R
Save the current creds and security state, alter them by calling alter_creds, then call
callback.
The creds and security state will be restored to their original values at the end of the
call. Only the “subjective” state of the CurrentTask, accessed with current_creds() and
used to check permissions for actions performed by the task, is altered. The “objective”
state, accessed through Task::real_creds() by other tasks and used to check permissions
for actions performed on the task, is not altered, and changes to the credentials are not
externally visible.
Sourcepub fn override_creds<R>(
&self,
alter_creds: impl FnOnce(&mut FullCredentials),
callback: impl FnOnce() -> R,
) -> R
pub fn override_creds<R>( &self, alter_creds: impl FnOnce(&mut FullCredentials), callback: impl FnOnce() -> R, ) -> R
Save the current creds and security state, alter them by calling alter_creds, then call
callback.
The creds and security state will be restored to their original values at the end of the
call. Only the “subjective” state of the CurrentTask, accessed with current_creds() and
used to check permissions for actions performed by the task, is altered. The “objective”
state, accessed through Task::real_creds() by other tasks and used to check permissions
for actions performed on the task, is not altered, and changes to the credentials are not
externally visible.
pub fn has_overridden_creds(&self) -> bool
pub fn trigger_delayed_releaser<L>(&self, locked: &mut Locked<L>)where
L: LockEqualOrBefore<FileOpsCore>,
pub fn weak_task(&self) -> WeakRef<Task>
pub fn temp_task(&self) -> TempRef<'_, Task>
Sourcepub fn set_creds(&self, creds: Credentials)
pub fn set_creds(&self, creds: Credentials)
Change the current and real creds of the task. This is invalid to call while temporary credentials are present.
pub fn release<L>(self, locked: &mut Locked<L>)where
L: LockBefore<TaskRelease>,
pub fn set_syscall_restart_func<R: Into<SyscallResult>>( &mut self, f: impl FnOnce(&mut Locked<Unlocked>, &mut CurrentTask) -> Result<R, Errno> + Send + Sync + 'static, )
Sourcepub fn wait_with_temporary_mask<F, T, L>(
&mut self,
locked: &mut Locked<L>,
signal_mask: SigSet,
wait_function: F,
) -> Result<T, Errno>where
L: LockEqualOrBefore<FileOpsCore>,
F: FnOnce(&mut Locked<L>, &CurrentTask) -> Result<T, Errno>,
pub fn wait_with_temporary_mask<F, T, L>(
&mut self,
locked: &mut Locked<L>,
signal_mask: SigSet,
wait_function: F,
) -> Result<T, Errno>where
L: LockEqualOrBefore<FileOpsCore>,
F: FnOnce(&mut Locked<L>, &CurrentTask) -> Result<T, Errno>,
Sets the task’s signal mask to signal_mask and runs wait_function.
Signals are dequeued prior to the original signal mask being restored. This is done by the signal machinery in the syscall dispatch loop.
The returned result is the result returned from the wait function.
Sourcepub fn wake_or_wait_until_unstopped_async(&self, waiter: &Waiter) -> bool
pub fn wake_or_wait_until_unstopped_async(&self, waiter: &Waiter) -> bool
If waking, promotes from waking to awake. If not waking, make waiter async wait until woken. Returns true if woken.
Sourcepub fn run_in_state<F, T>(
&self,
run_state: RunState,
callback: F,
) -> Result<T, Errno>
pub fn run_in_state<F, T>( &self, run_state: RunState, callback: F, ) -> Result<T, Errno>
Set the RunState for the current task to the given value and then call the given callback.
When the callback is done, the run_state is restored to RunState::Running.
This function is typically used just before blocking the current task on some operation.
The given run_state registers the mechanism for interrupting the blocking operation with
the task and the given callback actually blocks the task.
This function can only be called in the RunState::Running state and cannot set the
run state to RunState::Running. For this reason, this function cannot be reentered.
pub fn block_until( &self, guard: EventWaitGuard<'_>, deadline: MonotonicInstant, ) -> Result<(), Errno>
pub fn block_with_owner_until( &self, guard: EventWaitGuard<'_>, new_owner: &Thread, deadline: MonotonicInstant, ) -> Result<(), Errno>
Sourcepub fn resolve_dir_fd<'a, L>(
&self,
locked: &mut Locked<L>,
dir_fd: FdNumber,
path: &'a FsStr,
flags: ResolveFlags,
) -> Result<(NamespaceNode, &'a FsStr), Errno>where
L: LockEqualOrBefore<FileOpsCore>,
pub fn resolve_dir_fd<'a, L>(
&self,
locked: &mut Locked<L>,
dir_fd: FdNumber,
path: &'a FsStr,
flags: ResolveFlags,
) -> Result<(NamespaceNode, &'a FsStr), Errno>where
L: LockEqualOrBefore<FileOpsCore>,
Determine namespace node indicated by the dir_fd.
Returns the namespace node and the path to use relative to that node.
Sourcepub fn open_file(
&self,
locked: &mut Locked<Unlocked>,
path: &FsStr,
flags: OpenFlags,
) -> Result<FileHandle, Errno>
pub fn open_file( &self, locked: &mut Locked<Unlocked>, path: &FsStr, flags: OpenFlags, ) -> Result<FileHandle, Errno>
A convenient wrapper for opening files relative to FdNumber::AT_FDCWD.
Returns a FileHandle but does not install the FileHandle in the FdTable for this task.
Sourcepub fn open_file_at(
&self,
locked: &mut Locked<Unlocked>,
dir_fd: FdNumber,
path: &FsStr,
flags: OpenFlags,
mode: FileMode,
resolve_flags: ResolveFlags,
access_check: AccessCheck,
) -> Result<FileHandle, Errno>
pub fn open_file_at( &self, locked: &mut Locked<Unlocked>, dir_fd: FdNumber, path: &FsStr, flags: OpenFlags, mode: FileMode, resolve_flags: ResolveFlags, access_check: AccessCheck, ) -> Result<FileHandle, Errno>
The primary entry point for opening files relative to a task.
Absolute paths are resolve relative to the root of the FsContext for this task. Relative paths are resolve relative to dir_fd. To resolve relative to the current working directory, pass FdNumber::AT_FDCWD for dir_fd.
Returns a FileHandle but does not install the FileHandle in the FdTable for this task.
pub fn open_namespace_node_at( &self, locked: &mut Locked<Unlocked>, dir: NamespaceNode, path: &FsStr, flags: OpenFlags, mode: FileMode, resolve_flags: ResolveFlags, access_check: AccessCheck, ) -> Result<FileHandle, Errno>
Sourcepub fn lookup_parent_at<'a, L>(
&self,
locked: &mut Locked<L>,
context: &mut LookupContext,
dir_fd: FdNumber,
path: &'a FsStr,
) -> Result<(NamespaceNode, &'a FsStr), Errno>where
L: LockEqualOrBefore<FileOpsCore>,
pub fn lookup_parent_at<'a, L>(
&self,
locked: &mut Locked<L>,
context: &mut LookupContext,
dir_fd: FdNumber,
path: &'a FsStr,
) -> Result<(NamespaceNode, &'a FsStr), Errno>where
L: LockEqualOrBefore<FileOpsCore>,
A wrapper for FsContext::lookup_parent_at that resolves the given dir_fd to a NamespaceNode.
Absolute paths are resolve relative to the root of the FsContext for this task. Relative paths are resolve relative to dir_fd. To resolve relative to the current working directory, pass FdNumber::AT_FDCWD for dir_fd.
Sourcepub fn lookup_parent<'a, L>(
&self,
locked: &mut Locked<L>,
context: &mut LookupContext,
dir: &NamespaceNode,
path: &'a FsStr,
) -> Result<(NamespaceNode, &'a FsStr), Errno>where
L: LockEqualOrBefore<FileOpsCore>,
pub fn lookup_parent<'a, L>(
&self,
locked: &mut Locked<L>,
context: &mut LookupContext,
dir: &NamespaceNode,
path: &'a FsStr,
) -> Result<(NamespaceNode, &'a FsStr), Errno>where
L: LockEqualOrBefore<FileOpsCore>,
Lookup the parent of a namespace node.
Consider using Task::open_file_at or Task::lookup_parent_at rather than calling this function directly.
This function resolves all but the last component of the given path. The function returns the parent directory of the last component as well as the last component.
If path is empty, this function returns dir and an empty path. Similarly, if path ends with “.” or “..”, these components will be returned along with the parent.
The returned parent might not be a directory.
Sourcepub fn lookup_path<L>(
&self,
locked: &mut Locked<L>,
context: &mut LookupContext,
dir: NamespaceNode,
path: &FsStr,
) -> Result<NamespaceNode, Errno>where
L: LockEqualOrBefore<FileOpsCore>,
pub fn lookup_path<L>(
&self,
locked: &mut Locked<L>,
context: &mut LookupContext,
dir: NamespaceNode,
path: &FsStr,
) -> Result<NamespaceNode, Errno>where
L: LockEqualOrBefore<FileOpsCore>,
Lookup a namespace node.
Consider using Task::open_file_at or Task::lookup_parent_at rather than calling this function directly.
This function resolves the component of the given path.
Sourcepub fn lookup_path_from_root<L>(
&self,
locked: &mut Locked<L>,
path: &FsStr,
) -> Result<NamespaceNode, Errno>where
L: LockEqualOrBefore<FileOpsCore>,
pub fn lookup_path_from_root<L>(
&self,
locked: &mut Locked<L>,
path: &FsStr,
) -> Result<NamespaceNode, Errno>where
L: LockEqualOrBefore<FileOpsCore>,
Lookup a namespace node starting at the root directory.
Resolves symlinks.
pub fn exec( &mut self, locked: &mut Locked<Unlocked>, executable: FileHandle, path: CString, argv: Vec<CString>, environ: Vec<CString>, ) -> Result<(), Errno>
pub fn set_command_name(&self, new_name: TaskCommand)
pub fn add_seccomp_filter( &mut self, locked: &mut Locked<Unlocked>, code: Vec<sock_filter>, flags: u32, ) -> Result<SyscallResult, Errno>
pub fn run_seccomp_filters( &mut self, locked: &mut Locked<Unlocked>, syscall: &Syscall, ) -> Option<Result<SyscallResult, Errno>>
pub fn notify_robust_list(&self)
Sourcepub fn get_seccomp_notifier(&mut self) -> Option<SeccompNotifierHandle>
pub fn get_seccomp_notifier(&mut self) -> Option<SeccompNotifierHandle>
Returns a ref to this thread’s SeccompNotifier.
pub fn set_seccomp_notifier(&mut self, notifier: Option<SeccompNotifierHandle>)
Sourcepub fn process_exception(
&self,
locked: &mut Locked<Unlocked>,
report: &ExceptionReport,
) -> ExceptionResult
pub fn process_exception( &self, locked: &mut Locked<Unlocked>, report: &ExceptionReport, ) -> ExceptionResult
Processes a Zircon exception associated with this task.
Sourcepub fn clone_task<L>(
&self,
locked: &mut Locked<L>,
flags: u64,
child_exit_signal: Option<Signal>,
user_parent_tid: UserRef<pid_t>,
user_child_tid: UserRef<pid_t>,
user_pidfd: UserRef<FdNumber>,
) -> Result<TaskBuilder, Errno>
pub fn clone_task<L>( &self, locked: &mut Locked<L>, flags: u64, child_exit_signal: Option<Signal>, user_parent_tid: UserRef<pid_t>, user_child_tid: UserRef<pid_t>, user_pidfd: UserRef<FdNumber>, ) -> Result<TaskBuilder, Errno>
Clone this task.
Creates a new task object that shares some state with this task according to the given flags.
Used by the clone() syscall to create both processes and threads.
The exit signal is broken out from the flags parameter like clone3() rather than being bitwise-ORed like clone().
Sourcepub fn set_stopped_and_notify(
&self,
stopped: StopState,
siginfo: Option<SignalInfo>,
)
pub fn set_stopped_and_notify( &self, stopped: StopState, siginfo: Option<SignalInfo>, )
Sets the stop state (per set_stopped), and also notifies all listeners, including the parent process if appropriate.
Sourcepub fn finalize_stop_state(&mut self) -> bool
pub fn finalize_stop_state(&mut self) -> bool
If the task is stopping, set it as stopped. return whether the caller should stop. The task might also be waking up.
Sourcepub fn block_while_stopped(&mut self, locked: &mut Locked<Unlocked>)
pub fn block_while_stopped(&mut self, locked: &mut Locked<Unlocked>)
Block the execution of current_task as long as the task is stopped and
not terminated.
Sourcepub fn get_ptrace_core_state_for_clone(
&mut self,
clone_args: &clone_args,
) -> (PtraceOptions, Option<PtraceCoreState>)
pub fn get_ptrace_core_state_for_clone( &mut self, clone_args: &clone_args, ) -> (PtraceOptions, Option<PtraceCoreState>)
For traced tasks, this will return the data neceessary for a cloned task to attach to the same tracer.
Sourcepub fn ptrace_event(
&mut self,
locked: &mut Locked<Unlocked>,
trace_kind: PtraceOptions,
msg: u64,
)
pub fn ptrace_event( &mut self, locked: &mut Locked<Unlocked>, trace_kind: PtraceOptions, msg: u64, )
If currently being ptraced with the given option, emit the appropriate event. PTRACE_EVENTMSG will return the given message. Also emits the appropriate event for execve in the absence of TRACEEXEC.
Note that the Linux kernel has a documented bug where, if TRACEEXIT is enabled, SIGKILL will trigger an event. We do not exhibit this behavior.
Sourcepub fn thread_group_exit(
&mut self,
locked: &mut Locked<Unlocked>,
exit_status: ExitStatus,
)
pub fn thread_group_exit( &mut self, locked: &mut Locked<Unlocked>, exit_status: ExitStatus, )
Causes the current thread’s thread group to exit, notifying any ptracer of this task first.
Sourcepub fn clone_task_for_test<L>(
&self,
locked: &mut Locked<L>,
flags: u64,
exit_signal: Option<Signal>,
) -> AutoReleasableTask
pub fn clone_task_for_test<L>( &self, locked: &mut Locked<L>, flags: u64, exit_signal: Option<Signal>, ) -> AutoReleasableTask
The flags indicates only the flags as in clone3(), and does not use the low 8 bits for the exit signal as in clone().
pub fn check_ptrace_access_mode<L>(
&self,
locked: &mut Locked<L>,
mode: PtraceAccessMode,
target: &Task,
) -> Result<(), Errno>where
L: LockBefore<MmDumpable>,
pub fn can_signal( &self, target: &Task, unchecked_signal: UncheckedSignal, ) -> Result<(), Errno>
Source§impl CurrentTask
impl CurrentTask
pub fn create_filesystem( &self, locked: &mut Locked<Unlocked>, fs_type: &FsStr, options: FileSystemOptions, ) -> Result<FileSystemHandle, Errno>
Methods from Deref<Target = Task>§
pub fn kernel(&self) -> &Arc<Kernel>
pub fn thread_group(&self) -> &Arc<ThreadGroup>
pub fn has_same_address_space(&self, other: Option<&Arc<MemoryManager>>) -> bool
pub fn flags(&self) -> TaskFlags
Sourcepub fn set_ptrace_zombie(&self, pids: &mut PidTable)
pub fn set_ptrace_zombie(&self, pids: &mut PidTable)
When the task exits, if there is a notification that needs to propagate to a ptracer, make sure it will propagate.
pub fn exit_status(&self) -> Option<ExitStatus>
pub fn is_exitted(&self) -> bool
pub fn load_stopped(&self) -> StopState
pub fn read<'a>(self: &'a Task) -> TaskReadGuard<'a>
pub fn write<'a>(self: &'a Task) -> TaskWriteGuard<'a>
pub fn add_file<L>(
&self,
locked: &mut Locked<L>,
file: FileHandle,
flags: FdFlags,
) -> Result<FdNumber, Errno>where
L: LockEqualOrBefore<FileOpsCore>,
Sourcepub fn real_creds(&self) -> Credentials
pub fn real_creds(&self) -> Credentials
Returns the real credentials of the task. These credentials are used to check permissions
for actions performed on the task. If the task itself is performing an action, use
CurrentTask::current_creds instead.
pub fn with_real_creds<B, F>(&self, f: F) -> Bwhere
F: FnOnce(&Credentials) -> B,
pub fn ptracer_task(&self) -> WeakRef<Task>
pub fn fs(&self) -> Arc<FsContext>
pub fn mm(&self) -> Result<Arc<MemoryManager>, Errno>
Sourcepub fn set_scheduler_state(
&self,
scheduler_state: SchedulerState,
) -> Result<(), Errno>
pub fn set_scheduler_state( &self, scheduler_state: SchedulerState, ) -> Result<(), Errno>
Overwrite the existing scheduler state with a new one and update the task’s thread’s role.
Sourcepub fn sync_scheduler_state_to_role(&self) -> Result<(), Errno>
pub fn sync_scheduler_state_to_role(&self) -> Result<(), Errno>
Update the task’s thread’s role based on its current scheduler state without making any changes to the state.
This should be called on tasks that have newly created threads, e.g. after cloning.
Sourcepub fn signal_vfork(&self)
pub fn signal_vfork(&self)
Signals the vfork event, if any, to unblock waiters.
Sourcepub fn wait_for_execve(&self, task_to_wait: WeakRef<Task>) -> Result<(), Errno>
pub fn wait_for_execve(&self, task_to_wait: WeakRef<Task>) -> Result<(), Errno>
Blocks the caller until the task has exited or executed execve(). This is used to implement vfork() and clone(… CLONE_VFORK, …). The task must have created with CLONE_EXECVE.
Sourcepub fn clear_child_tid_if_needed<L>(
&self,
locked: &mut Locked<L>,
) -> Result<(), Errno>where
L: LockBefore<TerminalLock>,
pub fn clear_child_tid_if_needed<L>(
&self,
locked: &mut Locked<L>,
) -> Result<(), Errno>where
L: LockBefore<TerminalLock>,
If needed, clear the child tid for this task.
Userspace can ask us to clear the child tid and issue a futex wake at the child tid address when we tear down a task. For example, bionic uses this mechanism to implement pthread_join. The thread that calls pthread_join sleeps using FUTEX_WAIT on the child tid address. We wake them up here to let them know the thread is done.
pub fn get_task(&self, tid: tid_t) -> WeakRef<Task>
pub fn get_pid(&self) -> pid_t
pub fn get_tid(&self) -> tid_t
pub fn is_leader(&self) -> bool
pub fn read_argv(&self, max_len: usize) -> Result<Vec<FsString>, Errno>
pub fn read_argv0(&self) -> Result<FsString, Errno>
pub fn read_env(&self, max_len: usize) -> Result<Vec<FsString>, Errno>
pub fn thread_runtime_info(&self) -> Result<TaskRuntimeInfo, Errno>
pub fn real_fscred(&self) -> FsCred
Sourcepub fn interrupt(&self)
pub fn interrupt(&self)
Interrupts the current task.
This will interrupt any blocking syscalls if the task is blocked on one. The signal_state of the task must not be locked.
pub fn command(&self) -> TaskCommand
pub fn set_command_name(&self, new_name: TaskCommand)
pub fn set_seccomp_state(&self, state: SeccompStateValue) -> Result<(), Errno>
pub fn state_code(&self) -> TaskStateCode
pub fn time_stats(&self) -> TaskTimeStats
pub fn get_signal_action(&self, signal: Signal) -> sigaction_t
pub fn record_pid_koid_mapping(&self)
Trait Implementations§
Source§impl ArchSpecific for CurrentTask
impl ArchSpecific for CurrentTask
Source§impl AsRef<CurrentTask> for AutoReleasableTask
impl AsRef<CurrentTask> for AutoReleasableTask
Source§fn as_ref(&self) -> &CurrentTask
fn as_ref(&self) -> &CurrentTask
Source§impl Borrow<CurrentTask> for AutoReleasableTask
impl Borrow<CurrentTask> for AutoReleasableTask
Source§fn borrow(&self) -> &CurrentTask
fn borrow(&self) -> &CurrentTask
Source§impl Debug for CurrentTask
impl Debug for CurrentTask
Source§impl Deref for CurrentTask
impl Deref for CurrentTask
Source§impl<'a> From<&'a CurrentTask> for Auditable<'a>
impl<'a> From<&'a CurrentTask> for Auditable<'a>
Source§fn from(_value: &'a CurrentTask) -> Self
fn from(_value: &'a CurrentTask) -> Self
Source§impl From<CurrentTask> for AutoReleasableTask
impl From<CurrentTask> for AutoReleasableTask
Source§fn from(task: CurrentTask) -> Self
fn from(task: CurrentTask) -> Self
Source§impl From<TaskBuilder> for CurrentTask
impl From<TaskBuilder> for CurrentTask
Source§fn from(builder: TaskBuilder) -> Self
fn from(builder: TaskBuilder) -> Self
Source§impl<'a> KernelOrTask<'a> for &'a CurrentTask
impl<'a> KernelOrTask<'a> for &'a CurrentTask
fn kernel(&self) -> &'a Kernel
fn maybe_task(&self) -> Option<&'a CurrentTask>
Source§impl MemoryAccessor for CurrentTask
impl MemoryAccessor for CurrentTask
Source§fn read_memory<'a>(
&self,
addr: UserAddress,
bytes: &'a mut [MaybeUninit<u8>],
) -> Result<&'a mut [u8], Errno>
fn read_memory<'a>( &self, addr: UserAddress, bytes: &'a mut [MaybeUninit<u8>], ) -> Result<&'a mut [u8], Errno>
Source§fn read_memory_partial_until_null_byte<'a>(
&self,
addr: UserAddress,
bytes: &'a mut [MaybeUninit<u8>],
) -> Result<&'a mut [u8], Errno>
fn read_memory_partial_until_null_byte<'a>( &self, addr: UserAddress, bytes: &'a mut [MaybeUninit<u8>], ) -> Result<&'a mut [u8], Errno>
addr, continuing until either a null byte is read, bytes.len()
bytes have been read or no more bytes can be read from the target. Read moreSource§fn read_memory_partial<'a>(
&self,
addr: UserAddress,
bytes: &'a mut [MaybeUninit<u8>],
) -> Result<&'a mut [u8], Errno>
fn read_memory_partial<'a>( &self, addr: UserAddress, bytes: &'a mut [MaybeUninit<u8>], ) -> Result<&'a mut [u8], Errno>
addr, continuing until either bytes.len() bytes have been read
or no more bytes can be read from the target. Read moreSource§fn write_memory(&self, addr: UserAddress, bytes: &[u8]) -> Result<usize, Errno>
fn write_memory(&self, addr: UserAddress, bytes: &[u8]) -> Result<usize, Errno>
addr. Read moreSource§fn write_memory_partial(
&self,
addr: UserAddress,
bytes: &[u8],
) -> Result<usize, Errno>
fn write_memory_partial( &self, addr: UserAddress, bytes: &[u8], ) -> Result<usize, Errno>
addr, continuing until either bytes.len() bytes have been
written or no more bytes can be written. Read moreSource§impl Releasable for CurrentTask
impl Releasable for CurrentTask
Source§impl TaskMemoryAccessor for CurrentTask
impl TaskMemoryAccessor for CurrentTask
Source§fn maximum_valid_address(&self) -> Option<UserAddress>
fn maximum_valid_address(&self) -> Option<UserAddress>
Auto Trait Implementations§
impl !Freeze for CurrentTask
impl !RefUnwindSafe for CurrentTask
impl !Send for CurrentTask
impl !Sync for CurrentTask
impl Unpin for CurrentTask
impl !UnwindSafe for CurrentTask
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MemoryAccessorExt for Twhere
T: MemoryAccessor,
impl<T> MemoryAccessorExt for Twhere
T: MemoryAccessor,
Source§fn read_memory_to_slice(
&self,
addr: UserAddress,
bytes: &mut [u8],
) -> Result<(), Errno>
fn read_memory_to_slice( &self, addr: UserAddress, bytes: &mut [u8], ) -> Result<(), Errno>
Source§fn read_memory_to_vec(
&self,
addr: UserAddress,
len: usize,
) -> Result<Vec<u8>, Errno>
fn read_memory_to_vec( &self, addr: UserAddress, len: usize, ) -> Result<Vec<u8>, Errno>
len bytes of memory, returning them as a a Vec.Source§fn read_memory_partial_to_vec(
&self,
addr: UserAddress,
max_len: usize,
) -> Result<Vec<u8>, Errno>
fn read_memory_partial_to_vec( &self, addr: UserAddress, max_len: usize, ) -> Result<Vec<u8>, Errno>
max_len bytes from addr, returning them as a Vec.Source§fn read_memory_to_array<const N: usize>(
&self,
addr: UserAddress,
) -> Result<[u8; N], Errno>
fn read_memory_to_array<const N: usize>( &self, addr: UserAddress, ) -> Result<[u8; N], Errno>
N bytes from addr, returning them as an array.Source§fn read_buffer(&self, buffer: &UserBuffer) -> Result<Vec<u8>, Errno>
fn read_buffer(&self, buffer: &UserBuffer) -> Result<Vec<u8>, Errno>
buffer, returning them as a Vec.Source§fn read_object<T: FromBytes>(&self, user: UserRef<T>) -> Result<T, Errno>
fn read_object<T: FromBytes>(&self, user: UserRef<T>) -> Result<T, Errno>
user.fn read_multi_arch_ptr<T64, T32>( &self, user: MultiArchUserRef<MultiArchUserRef<T64, T32>, MultiArchUserRef<T64, T32>>, ) -> Result<MultiArchUserRef<T64, T32>, Errno>
Source§fn read_multi_arch_object<T, T64: FromBytes + TryInto<T>, T32: FromBytes + TryInto<T>>(
&self,
user: MappingMultiArchUserRef<T, T64, T32>,
) -> Result<T, Errno>
fn read_multi_arch_object<T, T64: FromBytes + TryInto<T>, T32: FromBytes + TryInto<T>>( &self, user: MappingMultiArchUserRef<T, T64, T32>, ) -> Result<T, Errno>
user where the object has a different representation in 32
and 64 bits.Source§fn read_multi_arch_objects_to_vec<T, T64: FromBytes + TryInto<T>, T32: FromBytes + TryInto<T>>(
&self,
user: MappingMultiArchUserRef<T, T64, T32>,
len: usize,
) -> Result<Vec<T>, Errno>
fn read_multi_arch_objects_to_vec<T, T64: FromBytes + TryInto<T>, T32: FromBytes + TryInto<T>>( &self, user: MappingMultiArchUserRef<T, T64, T32>, len: usize, ) -> Result<Vec<T>, Errno>
len objects from user, returning them as a Vec.Source§fn read_object_partial<T: FromBytes>(
&self,
user: UserRef<T>,
partial_size: usize,
) -> Result<T, Errno>
fn read_object_partial<T: FromBytes>( &self, user: UserRef<T>, partial_size: usize, ) -> Result<T, Errno>
partial bytes of an object, leaving any remainder 0-filled. Read moreSource§fn read_objects<'a, T: FromBytes>(
&self,
user: UserRef<T>,
objects: &'a mut [MaybeUninit<T>],
) -> Result<&'a mut [T], Errno>
fn read_objects<'a, T: FromBytes>( &self, user: UserRef<T>, objects: &'a mut [MaybeUninit<T>], ) -> Result<&'a mut [T], Errno>
objects.len() objects into objects from user.Source§fn read_objects_to_slice<T: FromBytes>(
&self,
user: UserRef<T>,
objects: &mut [T],
) -> Result<(), Errno>
fn read_objects_to_slice<T: FromBytes>( &self, user: UserRef<T>, objects: &mut [T], ) -> Result<(), Errno>
objects.len() objects into objects from user.Source§fn read_objects_to_vec<T: FromBytes>(
&self,
user: UserRef<T>,
len: usize,
) -> Result<Vec<T>, Errno>
fn read_objects_to_vec<T: FromBytes>( &self, user: UserRef<T>, len: usize, ) -> Result<Vec<T>, Errno>
len objects from user, returning them as a Vec.Source§fn read_objects_to_smallvec<T: Clone + FromBytes, const N: usize>(
&self,
user: UserRef<T>,
len: usize,
) -> Result<SmallVec<[T; N]>, Errno>
fn read_objects_to_smallvec<T: Clone + FromBytes, const N: usize>( &self, user: UserRef<T>, len: usize, ) -> Result<SmallVec<[T; N]>, Errno>
len objects from user, returning them as a SmallVec.Source§fn read_objects_to_array<T: Copy + FromBytes, const N: usize>(
&self,
user: UserRef<T>,
) -> Result<[T; N], Errno>
fn read_objects_to_array<T: Copy + FromBytes, const N: usize>( &self, user: UserRef<T>, ) -> Result<[T; N], Errno>
N objects from user, returning them as an array.Source§fn read_iovec<T: Copy + Eq + IntoBytes + FromBytes + Immutable + TryInto<usize>>(
&self,
iovec_addr: IOVecPtr,
iovec_count: UserValue<T>,
) -> Result<UserBuffers, Errno>
fn read_iovec<T: Copy + Eq + IntoBytes + FromBytes + Immutable + TryInto<usize>>( &self, iovec_addr: IOVecPtr, iovec_count: UserValue<T>, ) -> Result<UserBuffers, Errno>
Source§fn read_c_string_to_vec(
&self,
string: UserCString,
max_size: usize,
) -> Result<FsString, Errno>
fn read_c_string_to_vec( &self, string: UserCString, max_size: usize, ) -> Result<FsString, Errno>
max_size bytes from string, stopping at the first discovered null byte and
returning the results as a Vec.Source§fn read_path_if_non_null(&self, path: UserCString) -> Result<FsString, Errno>
fn read_path_if_non_null(&self, path: UserCString) -> Result<FsString, Errno>
Source§fn read_nul_delimited_c_string_list(
&self,
start: UserAddress,
len: usize,
) -> Result<Vec<FsString>, Errno>
fn read_nul_delimited_c_string_list( &self, start: UserAddress, len: usize, ) -> Result<Vec<FsString>, Errno>
len bytes from start and parse the region as null-delimited CStrings, for example
how argv is stored. Read moreSource§fn read_c_string<'a>(
&self,
string: UserCString,
buffer: &'a mut [MaybeUninit<u8>],
) -> Result<&'a FsStr, Errno>
fn read_c_string<'a>( &self, string: UserCString, buffer: &'a mut [MaybeUninit<u8>], ) -> Result<&'a FsStr, Errno>
buffer.len() bytes from string, stopping at the first discovered null byte
and returning the result as a slice that ends before that null. Read moreSource§fn read_c_string_if_non_null<'a>(
&self,
addr: UserCString,
buffer: &'a mut [MaybeUninit<u8>],
) -> Result<&'a FsStr, Errno>
fn read_c_string_if_non_null<'a>( &self, addr: UserCString, buffer: &'a mut [MaybeUninit<u8>], ) -> Result<&'a FsStr, Errno>
addr is null, otherwise
behaves as read_c_string.