Struct Job
pub struct Job(/* private fields */);Expand description
An object representing a Zircon job.
As essentially a subtype of NullableHandle, it can be freely interconverted.
Implementations§
§impl Job
impl Job
pub fn into_raw(self) -> u32
pub fn into_raw(self) -> u32
Return the raw handle’s integer value without closing it when self is dropped.
pub fn duplicate(&self, rights: Rights) -> Result<Job, Status>
pub fn duplicate(&self, rights: Rights) -> Result<Job, Status>
Wraps the
zx_handle_duplicate
syscall.
pub fn signal(
&self,
clear_mask: Signals,
set_mask: Signals,
) -> Result<(), Status>
pub fn signal( &self, clear_mask: Signals, set_mask: Signals, ) -> Result<(), Status>
Wraps the
zx_object_signal
syscall.
pub fn wait_one(
&self,
signals: Signals,
deadline: Instant<MonotonicTimeline>,
) -> WaitResult
pub fn wait_one( &self, signals: Signals, deadline: Instant<MonotonicTimeline>, ) -> WaitResult
Wraps the
zx_object_wait_one
syscall.
§impl Job
impl Job
pub fn create_child_job(&self) -> Result<Job, Status>
pub fn create_child_job(&self) -> Result<Job, Status>
Create a new job as a child of the current job.
Wraps the zx_job_create syscall.
pub fn create_child_process(
&self,
options: ProcessOptions,
name: &[u8],
) -> Result<(Process, Vmar), Status>
pub fn create_child_process( &self, options: ProcessOptions, name: &[u8], ) -> Result<(Process, Vmar), Status>
Create a new process as a child of the current job.
On success, returns a handle to the new process and a handle to the root of the new process’s address space.
Wraps the zx_process_create syscall.
pub fn info(&self) -> Result<JobInfo, Status>
pub fn info(&self) -> Result<JobInfo, Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_JOB topic.
pub fn set_policy(&self, policy: JobPolicy) -> Result<(), Status>
pub fn set_policy(&self, policy: JobPolicy) -> Result<(), Status>
Wraps the zx_job_set_policy syscall.
pub fn set_critical(
&self,
opts: JobCriticalOptions,
process: &Process,
) -> Result<(), Status>
pub fn set_critical( &self, opts: JobCriticalOptions, process: &Process, ) -> Result<(), Status>
Wraps the zx_job_set_critical syscall.
pub fn processes(&self) -> Result<Vec<Koid>, Status>
pub fn processes(&self) -> Result<Vec<Koid>, Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_JOB_PROCESSES topic.
pub fn children(&self) -> Result<Vec<Koid>, Status>
pub fn children(&self) -> Result<Vec<Koid>, Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_JOB_CHILDREN topic.
pub fn get_child(
&self,
koid: &Koid,
rights: Rights,
) -> Result<NullableHandle, Status>
pub fn get_child( &self, koid: &Koid, rights: Rights, ) -> Result<NullableHandle, Status>
Wraps the zx_object_get_child syscall.
Trait Implementations§
§impl AsHandleRef for Job
impl AsHandleRef for Job
§fn as_handle_ref(&self) -> Unowned<'_, NullableHandle>
fn as_handle_ref(&self) -> Unowned<'_, NullableHandle>
object_wait_many.§fn raw_handle(&self) -> u32
fn raw_handle(&self) -> u32
§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<Name, Status>
fn get_name(&self) -> Result<Name, Status>
§fn set_name(&self, name: &Name) -> Result<(), Status>
fn set_name(&self, name: &Name) -> 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>
Source§impl CompatFrom<Job> for Job
Available on crate feature fuchsia only.
impl CompatFrom<Job> for Job
fuchsia only.Source§fn compat_from(value: Job) -> Job
fn compat_from(value: Job) -> Job
value into a value of this type.Source§impl<E> Encode<WireJob, E> for Jobwhere
E: HandleEncoder + ?Sized,
impl<E> Encode<WireJob, E> for Jobwhere
E: HandleEncoder + ?Sized,
Source§fn encode(
self,
encoder: &mut E,
out: &mut MaybeUninit<WireJob>,
constraint: <WireJob as Constrained>::Constraint,
) -> Result<(), EncodeError>
fn encode( self, encoder: &mut E, out: &mut MaybeUninit<WireJob>, constraint: <WireJob as Constrained>::Constraint, ) -> Result<(), EncodeError>
Source§const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
Source§impl<E> EncodeOption<WireOptionalJob, E> for Jobwhere
E: HandleEncoder + ?Sized,
impl<E> EncodeOption<WireOptionalJob, E> for Jobwhere
E: HandleEncoder + ?Sized,
Source§fn encode_option(
this: Option<Job>,
encoder: &mut E,
out: &mut MaybeUninit<WireOptionalJob>,
constraint: (),
) -> Result<(), EncodeError>
fn encode_option( this: Option<Job>, encoder: &mut E, out: &mut MaybeUninit<WireOptionalJob>, constraint: (), ) -> Result<(), EncodeError>
§impl From<Job> for NullableHandle
impl From<Job> for NullableHandle
§fn from(x: Job) -> NullableHandle
fn from(x: Job) -> NullableHandle
§impl From<NullableHandle> for Job
impl From<NullableHandle> for Job
§fn from(handle: NullableHandle) -> Job
fn from(handle: NullableHandle) -> Job
Source§impl FromWire<WireJob> for Job
impl FromWire<WireJob> for Job
Source§const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
Source§impl FromWireOption<WireOptionalJob> for Job
impl FromWireOption<WireOptionalJob> for Job
Source§fn from_wire_option(wire: WireOptionalJob) -> Option<Job>
fn from_wire_option(wire: WireOptionalJob) -> Option<Job>
wire to an option of this type.§impl HandleBased for Job
impl HandleBased for Job
§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) -> NullableHandle
fn into_handle(self) -> NullableHandle
§fn from_handle(handle: NullableHandle) -> Self
fn from_handle(handle: NullableHandle) -> 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 Job
impl Ord for Job
§impl PartialOrd for Job
impl PartialOrd for Job
§impl Task for Job
impl Task for Job
§fn create_exception_channel_with_opts(
&self,
opts: ExceptionChannelOptions,
) -> Result<Channel, Status>
fn create_exception_channel_with_opts( &self, opts: ExceptionChannelOptions, ) -> Result<Channel, Status>
§fn create_exception_channel(&self) -> Result<Channel, Status>
fn create_exception_channel(&self) -> Result<Channel, Status>
§fn get_runtime_info(&self) -> Result<TaskRuntimeInfo, Status>
fn get_runtime_info(&self) -> Result<TaskRuntimeInfo, Status>
impl Eq for Job
impl StructuralPartialEq for Job
Auto Trait Implementations§
impl Freeze for Job
impl RefUnwindSafe for Job
impl Send for Job
impl Sync for Job
impl Unpin for Job
impl UnwindSafe for Job
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
§impl<T> EncodableAsHandle for Twhere
T: HandleBased,
impl<T> EncodableAsHandle for Twhere
T: HandleBased,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T, W> FromWireOption<WireBox<'_, W>> for Twhere
T: FromWire<W>,
impl<T, W> FromWireOption<WireBox<'_, W>> for Twhere
T: FromWire<W>,
Source§fn from_wire_option(wire: WireBox<'_, W>) -> Option<T>
fn from_wire_option(wire: WireBox<'_, W>) -> Option<T>
wire to an option of this type.Source§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
Source§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to Self