Skip to content

Clearly document lifetime requirements on SQE arguments #29

Open
@withoutboats

Description

@withoutboats

Any argument to an SQE prep method which is a reference (e.g. buffers, the mutable references in prep_accept) must outlive the completion of the IO event that is being prepared. There's no way to directly express this lifetime, as the completion of the IO is dynamic and unpredictable. This is the core reason these prep APIs are marked unsafe.

Users of iou are responsible for guaranteeing that these values will not be invalidated until after the completion occurs. We should provide clear, precise, and comprehensible documentation about the safety requirements of these methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions