Expand description
This crate contains utility functions used in GIDL tests and benchmarks.
Structs§
- Handle
Def - Specifies a handle to be created with
create_handles. Corresponds toHandleDefin //tools/fidl/gidl/ir/test_case.go.
Enums§
- Handle
Subtype - Handle subtypes that can be created via
create_handles. Each subtypeXcorresponds to afidl::Xtype that implementsHandleBased.
Functions§
- copy_
handle - Copies a raw handle into an owned
HandleBasedhandle. - create_
handles - Creates a vector of raw handles based on
defs. Panics if creating any of the handles fails. The caller is responsible for closing the handles. - decode_
value - Decodes
Tfrom the given bytes and handles. Panics on failure. - get_
handle_ koid - Gets the koid of a handle from its raw handle info. Panics if the
zx_object_get_infosyscall fails. - get_
info_ handle_ valid - Returns the result of the
zx_object_get_infosyscall with topicZX_INFO_HANDLE_VALID. In particular, returnsStatus::BAD_HANDLEif the handle is dangling because it was already closed or never assigned to the process in the first place. - repeat
- Returns a vector of
valuerepeatedlentimes. - select_
handle_ infos - Copies raw handles from the given indices to a new vector of owned
HandleInfos. The caller must ensure handles are closed exactly once. - select_
raw_ handle_ infos - Copies raw handles from the given indices to a new vector.
- to_
zx_ handle_ disposition_ t - Converts a
HandleDispositionto a rawzx_handle_disposition_t.