pub enum FileRef {
Raw(HANDLE),
Registered(RegisteredFile),
}Expand description
A file, addressed either by a raw HANDLE or by the index a prior
Batch::register_files assigned it (M5.1).
This enum is the _raw pushes’ addressing parameter. A safe push takes a
FileTarget instead – a SharedHandle or a RegisteredFile – so
reaching a registered file has not required unsafe since M10.4 (D-29,
D-33). Constructing a FileRef directly is only necessary for the _raw
pushes, whose reason to exist is a bare HANDLE this crate cannot keep
alive for you.
A distinct type per addressing mode – rather than one method accepting
either a HANDLE or a bare u32 – is what makes “read against a
registered file” and “read against an unregistered one” impossible to
confuse by accident: a RegisteredFile cannot be mistaken for a raw
HANDLE, or vice versa, because they are different types.
Variants§
Raw(HANDLE)
IORING_REF_RAW: the caller’s own open handle.
Registered(RegisteredFile)
IORING_REF_REGISTERED: an index from Batch::register_files.