Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the documentation for {As,Into,From}Raw{Fd,Handle,Socket}. #93562

Merged
merged 10 commits into from
Mar 3, 2022

Commits on Feb 1, 2022

  1. Update the documentation for {As,Into,From}Raw{Fd,Handle,Socket}.

    This change weakens the descriptions of the
    `{as,into,from}_raw_{fd,handle,socket}` descriptions from saying that
    they *do* express ownership relations to say that they are *typically used*
    in ways that express ownership relations. This needed needed since, for
    example, std's own [`RawFd`] implements `{As,From,Into}Fd` without any of
    the ownership relationships.
    
    This adds proper `# Safety` comments to `from_raw_{fd,handle,socket}`,
    adds the requirement that raw handles be not opened with the
    `FILE_FLAG_OVERLAPPED` flag, and merges the `OwnedHandle::from_raw_handle`
    comment into the main `FromRawHandle::from_raw_handle` comment.
    
    And, this changes `HandleOrNull` and `HandleOrInvalid` to not implement
    `FromRawHandle`, since they are intended for limited use in FFI situations,
    and not for generic use, and they have constraints that are stronger than
    the those of `FromRawHandle`.
    
    [`RawFd`]: https://doc.rust-lang.org/stable/std/os/unix/io/type.RawFd.html
    sunfishcode committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    ca42a1b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    713bb19 View commit details
    Browse the repository at this point in the history
  3. Fix two copy+pastos.

    sunfishcode committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    8516895 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6ef7ee3 View commit details
    Browse the repository at this point in the history
  5. Fix errors.

    sunfishcode committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    89544e9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    656d2a3 View commit details
    Browse the repository at this point in the history
  7. x.py fmt

    sunfishcode committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    f88fb2a View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2022

  1. Remove the documentation comment for OwnedSocket::from_raw_socket.

    This function is documented in more detail in the `FromRawSocket` trait.
    sunfishcode committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    ba6050f View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2022

  1. Configuration menu
    Copy the full SHA
    af642bb View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2022

  1. Remove the comment about FILE_FLAG_OVERLAPPED.

    There may eventually be something to say about `FILE_FLAG_OVERLAPPED` here,
    however this appears to be independent of the other changes in this PR,
    so remove them from this PR so that it can be discussed separately.
    sunfishcode committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    8253cfe View commit details
    Browse the repository at this point in the history