Struct fidl::handle::fuchsia_handles::Thread
source · pub struct Thread(/* private fields */);
Expand description
An object representing a Zircon thread.
As essentially a subtype of Handle
, it can be freely interconverted.
Implementations§
source§impl Thread
impl Thread
sourcepub fn start(
&self,
thread_entry: usize,
stack: usize,
arg1: usize,
arg2: usize,
) -> Result<(), Status>
pub fn start( &self, thread_entry: usize, stack: usize, arg1: usize, arg2: usize, ) -> Result<(), Status>
Cause the thread to begin execution.
Wraps the zx_thread_start syscall.
sourcepub fn set_profile(&self, profile: Profile, options: u32) -> Result<(), Status>
pub fn set_profile(&self, profile: Profile, options: u32) -> Result<(), Status>
Apply a scheduling profile to a thread.
Wraps the zx_object_set_profile syscall.
sourcepub unsafe fn exit()
pub unsafe fn exit()
Terminate the current running thread.
§Safety
Extreme caution should be used– this is basically always UB in Rust. There’s almost no “normal” program code where this is okay to call. Users should take care that no references could possibly exist to stack variables on this thread, and that any destructors, closure suffixes, or other “after this thing runs” code is waiting to run in order for safety.
sourcepub fn get_exception_report(&self) -> Result<ExceptionReport, Status>
pub fn get_exception_report(&self) -> Result<ExceptionReport, Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_THREAD_EXCEPTION_REPORT topic.
sourcepub fn get_stats(&self) -> Result<ThreadStats, Status>
pub fn get_stats(&self) -> Result<ThreadStats, Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_THREAD_STATS topic.
pub fn read_state_general_regs( &self, ) -> Result<zx_thread_state_general_regs_t, Status>
pub fn write_state_general_regs( &self, state: zx_thread_state_general_regs_t, ) -> Result<(), Status>
sourcepub fn raise_user_exception(
options: RaiseExceptionOptions,
synth_code: u32,
synth_data: u32,
) -> Result<(), Status>
pub fn raise_user_exception( options: RaiseExceptionOptions, synth_code: u32, synth_data: u32, ) -> Result<(), Status>
Wraps the zx_thread_raise_exception
syscall.
See https://fuchsia.dev/reference/syscalls/thread_raise_exception?hl=en for details.
Trait Implementations§
source§impl AsHandleRef for Thread
impl AsHandleRef for Thread
source§fn as_handle_ref(&self) -> Unowned<'_, Handle>
fn as_handle_ref(&self) -> Unowned<'_, Handle>
object_wait_many
.source§fn raw_handle(&self) -> u32
fn raw_handle(&self) -> u32
source§fn signal_handle(
&self,
clear_mask: Signals,
set_mask: Signals,
) -> Result<(), Status>
fn signal_handle( &self, clear_mask: Signals, set_mask: Signals, ) -> Result<(), Status>
source§fn wait_handle(
&self,
signals: Signals,
deadline: Instant<MonotonicTimeline>,
) -> Result<Signals, Status>
fn wait_handle( &self, signals: Signals, deadline: Instant<MonotonicTimeline>, ) -> Result<Signals, Status>
source§fn wait_async_handle(
&self,
port: &Port,
key: u64,
signals: Signals,
options: WaitAsyncOpts,
) -> Result<(), Status>
fn wait_async_handle( &self, port: &Port, key: u64, signals: Signals, options: WaitAsyncOpts, ) -> Result<(), Status>
source§fn get_name(&self) -> Result<Name, Status>
fn get_name(&self) -> Result<Name, Status>
source§fn set_name(&self, name: &Name) -> Result<(), Status>
fn set_name(&self, name: &Name) -> Result<(), Status>
source§fn basic_info(&self) -> Result<HandleBasicInfo, Status>
fn basic_info(&self) -> Result<HandleBasicInfo, Status>
source§fn count_info(&self) -> Result<HandleCountInfo, Status>
fn count_info(&self) -> Result<HandleCountInfo, Status>
source§impl HandleBased for Thread
impl HandleBased for Thread
source§fn duplicate_handle(&self, rights: Rights) -> Result<Self, Status>
fn duplicate_handle(&self, rights: Rights) -> Result<Self, Status>
source§fn replace_handle(self, rights: Rights) -> Result<Self, Status>
fn replace_handle(self, rights: Rights) -> Result<Self, Status>
source§fn into_handle(self) -> Handle
fn into_handle(self) -> Handle
source§fn from_handle(handle: Handle) -> Self
fn from_handle(handle: Handle) -> Self
source§fn into_handle_based<H>(self) -> Hwhere
H: HandleBased,
fn into_handle_based<H>(self) -> Hwhere
H: HandleBased,
source§fn from_handle_based<H>(h: H) -> Selfwhere
H: HandleBased,
fn from_handle_based<H>(h: H) -> Selfwhere
H: HandleBased,
fn is_invalid_handle(&self) -> bool
source§impl Ord for Thread
impl Ord for Thread
source§impl PartialEq for Thread
impl PartialEq for Thread
source§impl PartialOrd for Thread
impl PartialOrd for Thread
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more