Crate zx

Source
Expand description

Type-safe bindings for Zircon kernel syscalls.

Modules§

prelude
Prelude containing common utility traits. Designed for use like use zx::prelude::*;
sys

Macros§

assoc_values

Structs§

AddressTaggingFeatureFlags
BootTimeline
A marker type for the system’s boot timeline which continues running during suspend.
Bti
An object representing a Zircon Bus Transaction Initiator object. See BTI Documentation for details.
Channel
An object representing a Zircon channel.
ChannelIoSlice
A reference to a readable slice of memory for channel writes and calls, analogous to std::io::IoSlice but for Zircon channel I/O. ABI-compatible with zx_channel_iovec_t, guaranteeing the pointed-to bytes are readable using lifetimes.
Clock
An object representing a kernel clock, used to track the progress of time. A clock is a one-dimensional affine transformation of the clock monotonic reference timeline which may be atomically adjusted by a maintainer and observed by clients.
ClockDetails
Fine grained details of a Clock object.
ClockOpts
ClockTransformation
A one-dimensional affine transformation that maps points from the reference timeline to the clock timeline. See clock transformations.
ClockUpdate
Specifies an update to zero or more properties of a clock. See [Clock::update]
ClockUpdateBuilder
Builder to specify how zero or more properties of a clock should be updated. See [Clock::update].
CpuFeatureFlags
DebugLog
An object representing a Zircon ‘debuglog’ object.
DebugLogOpts
DebugLogRecord
A record from the kernel’s debuglog.
Duration
Event
An object representing a Zircon event object.
EventPair
An object representing a Zircon event_pair
Exception
An object representing a Zircon exception object.
ExceptionArchData
x64-specific exception data.
ExceptionChannelOptions
Options that may be used with Task::create_exception_channel
ExceptionReport
Information about an exception that occurred in a process.
Fifo
An object representing a Zircon fifo.
Futex
A safe wrapper around zx_futex_t, generally called as part of higher-level synchronization primitives.
GPAddr
Wrapper type for guest physical addresses.
Guest
An object representing a Zircon guest
GuestBellPacket
Contents of a guest bell packet generated by the kernel. This is a type-safe wrapper for zx_packet_guest_bell_t
GuestIoPacket
Contents of a guest I/O packet generated by the kernel. This is a type-safe wrapper for zx_packet_guest_io_t
GuestMemPacket
Contents of a guest memory packet generated by the kernel. This is a type-safe wrapper for zx_packet_guest_memory_t
GuestVcpuPacket
Contents of a guest VCPU packet generated by the kernel. This is a type-safe wrapper for zx_packet_guest_vcpu_t
Handle
An object representing a Zircon handle.
HandleBasicInfo
Basic information about a handle.
HandleCountInfo
HandleDisposition
Operation to perform on handles during write. ABI-compatible with zx_handle_disposition_t.
HandleInfo
Information on handles that were read.
Instant
A timestamp from the kernel. Generic over both the timeline and the units it is measured in.
Interrupt
An object representing a Zircon interrupt.
InterruptPacket
Contents of an interrupt packet (one received because of an interrupt bound to this port). This is a type-safe wrapper for zx_packet_interrupt_t.
Iob
An object representing a Zircon IOBuffer.
IobAccess
IobOptions
IobRegion
IobRegionPrivateOptions
Iommu
An object representing a Zircon iommu
IommuDescDummy
Job
An object representing a Zircon job.
JobCriticalOptions
Options that may be used by Job::set_critical.
JobInfo
Koid
MapInfo
Ergonomic wrapper around zx_info_maps_t.
MappingDetails
MemStats
MemStatsCompression
MemStatsExtended
MemoryStall
MessageBuf
A buffer for receiving messages from a channel.
MessageBufEtc
A buffer for receiving messages from a channel.
MonotonicTimeline
A marker type for the system’s monotonic timeline which pauses during suspend.
Name
A wrapper around zircon name fields.
NsUnit
A marker type representing nanoseconds.
ObjectType
Zircon object types.
Packet
A packet sent through a port. This is a type-safe wrapper for zx_port_packet_t.
Pager
An object representing a Zircon pager.
PagerOptions
Options that may be used when creating a pager.
PagerPacket
Contents of a pager packet generated by the kernel. This is a type-safe wrapper for zx_packet_page_request_t
PagerWritebackBeginOptions
PerCpuStats
Pmt
An object representing a Zircon Pinned Memory Token. See PMT Documentation for details.
Port
An object representing a Zircon port.
PortOptions
Options that may be used when creating a Port.
PowerTransitionPacket
Contents of a power transition packet generated by the kernel. This is a type-safe wrapper for zx_packet_processor_power_level_transition_request_t
Process
An object representing a Zircon process.
ProcessHandleStats
ProcessInfo
ProcessInfoFlags
ProcessOptions
Options that may be used when creating a Process.
Profile
An object representing a Zircon profile.
Property
Object property types for use with [object_get_property()] and [object_set_property].
RaiseExceptionOptions
Options that may be used with Thread::raise_exception
Resource
An object representing a Zircon resource.
ResourceFlag
ResourceInfo
ResourceKind
Rights
Rights associated with a handle.
SignalPacket
Contents of a signal packet (one generated by the kernel). This is a type-safe wrapper for zx_packet_signal_t.
Signals
Signals that can be waited upon.
Socket
An object representing a Zircon socket
SocketInfo
SocketOpts
SocketReadOpts
SocketWriteOpts
Status
Status type indicating the result of a Fuchsia syscall.
Stream
An object representing a Zircon stream.
StreamOptions
StreamReadOptions
StreamWriteOptions
SyntheticTimeline
A marker type representing a synthetic timeline defined by a kernel clock object.
TaskRuntimeInfo
TaskStatsInfo
Thread
An object representing a Zircon thread.
ThreadInfo
ThreadStats
TicksUnit
A marker type representing system ticks.
Timer
An object representing a Zircon timer, such as the one returned by zx_timer_create.
TimerInfo
Topic
TransferDataOptions
Options that may be used when transferring data between VMOs.
Unowned
A borrowed value of type T.
UnspecifiedFifoElement
The default element for fifos, does not support reading or writing. Only used for IPC transfer.
UserPacket
Contents of a user packet (one sent by port_queue). This is a type-safe wrapper for zx_packet_user_t.
Vcpu
VirtualMemoryFeatureFlags
Vmar
An object representing a Zircon virtual memory address region.
VmarFlags
Flags to VMAR routines which are considered safe.
VmarFlagsExtended
Flags to all VMAR routines.
VmarInfo
VmarOp
VM Address Range opcodes
Vmo
An object representing a Zircon virtual memory object.
VmoChildOptions
Options that may be used when creating a Vmo child.
VmoInfo
Ergonomic equivalent of sys::zx_info_vmo_t. Must be ABI-compatible with it.
VmoInfoFlags
Flags that may be set when receiving info on a Vmo.
VmoOp
VM Object opcodes
VmoOptions
Options that may be used when creating a Vmo.
WaitAsyncOpts
Options for wait_async
WaitItem
A “wait item” containing a handle reference and information about what signals to wait on, and, on return from object_wait_many, which are pending.

Enums§

AccessType
CSDefaultOperandSize
Represents the default operand size as specified by the CS descriptor.
CachePolicy
ChannelReadResult
DebugLogSeverity
The severity a kernel log message can have.
ExceptionChannelType
ExceptionType
The type of an exception observed.
FeatureKind
The types of system features that may be requested.
HandleOp
Handle operation.
IobDiscipline
IobRegionType
JobAction
Represents the ZX_POL_ACTION_* constants
JobCondition
Represents the ZX_POL_* constants
JobDefaultTimerMode
Represents the ZX_TIMER_SLACK_* constants
JobPolicy
Holds a timer policy or a basic policy set for zx_job_set_policy
JobPolicyOption
Represents the ZX_JOB_POL_RELATIVE and ZX_JOB_POL_ABSOLUTE constants
MapDetails
MemAccessSize
MemData
PacketContents
The contents of a Packet.
PagerOp
PolicyCode
PortAccessSize
PortData
SocketWriteDisposition
Write disposition to set on a zircon socket with zx_socket_set_disposition.
ThreadBlockType
ThreadState
VcpuContents

Traits§

AsHandleRef
A trait to get a reference to the underlying handle of an object.
FeatureFlags
HandleBased
A trait implemented by all handle-based types.
Peered
A trait implemented by all handles for objects which have a peer.
Task
TimeUnit
A marker trait for times and durations to prevent accidental comparison between different units.
Timeline
A marker trait for times to prevent accidental comparison between different timelines.

Functions§

cprng_add_entropy
Mix the given entropy into the kernel CPRNG.
cprng_draw
Draw random bytes from the kernel’s CPRNG to fill buffer. This function always fills the buffer.
cprng_draw_raw
Draw random bytes from the kernel’s CPRNG to fill the provided buffer. This function always fills the buffer.
cprng_draw_uninit
Draw random bytes from the kernel’s CPRNG to fill buffer. This function always fills the buffer.
object_wait_many
Wait on multiple handles. The success return value is a bool indicating whether one or more of the provided handle references was closed during the wait.
ok
Convenience re-export of Status::ok.
system_get_feature_count
Get supported hardware capabilities counts.
system_get_feature_flags
Get supported hardware capabilities bitflags.
system_get_num_cpus
Get number of logical processors on the system.
system_get_page_size
Retrieve the system memory page size in bytes.
system_get_physmem
Get the amount of physical memory on the system, in bytes.
system_get_version_string
Return a version string describing the system (kernel). This string never changes.

Type Aliases§

BootDuration
A duration on the boot timeline.
BootDurationTicks
A duration between two system ticks boot timestamps.
BootInstant
A timestamp from the boot clock. Advances while the system is suspended.
BootTicks
A timestamp from system ticks on the boot timeline. Advances while the system is suspended.
BootTimer
A timer that measures its deadlines against the boot clock.
BootTimerInfo
HandleRef
MonotonicDuration
A duration on the monotonic timeline.
MonotonicDurationTicks
A duration between two system ticks monotonic timestamps.
MonotonicInstant
A timestamp from the monontonic clock. Does not advance while the system is suspended.
MonotonicTicks
A timestamp from system ticks on the monotonic timeline. Does not advance while the system is suspended.
MonotonicTimer
A timer that measures its deadlines against the monotonic clock.
MonotonicTimerInfo
SyntheticClock
SyntheticClockOnBoot
SyntheticDuration
A duration from a user-defined clock with arbitrary behavior.
SyntheticInstant
A timestamp from a user-defined clock with arbitrary behavior.
SyntheticTimerInfo
Ticks
A timestamp from system ticks. Has an arbitrary unit that can be measured with Ticks::per_second().