Struct fidl::handle::fuchsia_handles::Thread
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§
§impl Thread
impl Thread
pub 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.
pub 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.
pub 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.
pub fn get_exception_report(&self) -> Result<zx_exception_report_t, Status>
pub fn get_exception_report(&self) -> Result<zx_exception_report_t, Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_THREAD_EXCEPTION_REPORT topic.
pub fn get_stats(&self) -> Result<zx_info_thread_stats_t, Status>
pub fn get_stats(&self) -> Result<zx_info_thread_stats_t, 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>
pub fn raise_exception( options: RaiseExceptionOptions, exception_type: u32, context: zx_exception_context_t ) -> Result<(), Status>
pub fn raise_user_exception( options: RaiseExceptionOptions, synth_code: u32, synth_data: u32 ) -> Result<(), Status>
Trait Implementations§
§impl AsHandleRef for Thread
impl AsHandleRef for Thread
§fn as_handle_ref(&self) -> Unowned<'_, Handle>
fn as_handle_ref(&self) -> Unowned<'_, Handle>
object_wait_many
.§fn raw_handle(&self) -> u32
fn raw_handle(&self) -> u32
§fn signal_handle(
&self,
clear_mask: Signals,
set_mask: Signals
) -> Result<(), Status>
fn signal_handle( &self, clear_mask: Signals, set_mask: Signals ) -> Result<(), Status>
§fn wait_handle(
&self,
signals: Signals,
deadline: Time
) -> Result<Signals, Status>
fn wait_handle( &self, signals: Signals, deadline: Time ) -> Result<Signals, Status>
§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>
§fn get_name(&self) -> Result<CString, Status>
fn get_name(&self) -> Result<CString, Status>
§fn set_name(&self, name: &CStr) -> Result<(), Status>
fn set_name(&self, name: &CStr) -> Result<(), Status>
§fn basic_info(&self) -> Result<HandleBasicInfo, Status>
fn basic_info(&self) -> Result<HandleBasicInfo, Status>
§fn count_info(&self) -> Result<HandleCountInfo, Status>
fn count_info(&self) -> Result<HandleCountInfo, Status>
§impl HandleBased for Thread
impl HandleBased for Thread
§fn duplicate_handle(&self, rights: Rights) -> Result<Self, Status>
fn duplicate_handle(&self, rights: Rights) -> Result<Self, Status>
§fn replace_handle(self, rights: Rights) -> Result<Self, Status>
fn replace_handle(self, rights: Rights) -> Result<Self, Status>
§fn into_handle(self) -> Handle
fn into_handle(self) -> Handle
§fn from_handle(handle: Handle) -> Self
fn from_handle(handle: Handle) -> Self
§fn into_handle_based<H>(self) -> Hwhere
H: HandleBased,
fn into_handle_based<H>(self) -> Hwhere
H: HandleBased,
§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
§impl Ord for Thread
impl Ord for Thread
§impl PartialOrd for Thread
impl PartialOrd for Thread
§fn partial_cmp(&self, other: &Thread) -> Option<Ordering>
fn partial_cmp(&self, other: &Thread) -> Option<Ordering>
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