Skip to content

Tracking Issue for Borrowed{Fd,Handle} view types #160402

Description

@the8472

Feature gate: #![feature(fd_view)]

This is a tracking issue for turning &BorrowedFd and &BorrowedHandle into &File and similar.

Public API

impl std::os::fd::BorrowedFd {
    pub fn to_view<T>(&self) -> &T where Self: AsRef<T>;
}

impl AsRef<File> for BorrowedFd {}
impl AsRef<TcpStream> for BorrowedFd {}
impl AsRef<TcpListener> for BorrowedFd {}
impl AsRef<UdpSocket> for BorrowedFd {}
impl AsRef<UnixDatagram> for BorrowedFd {}
impl AsRef<UnixListener> for BorrowedFd {}
impl AsRef<UnixStream> for BorrowedFd {}
impl AsRef<PipeReader> for BorrowedFd {}
impl AsRef<PipeWriter> for BorrowedFd {}
// ... TBD


impl std::os::windows::io::BorrowedHandle {
    pub fn to_view<T>(&self) -> &T where Self: AsRef<T>;
}

impl AsRef<File> for BorrowedHandle {}
impl AsRef<PipeReader> for BorrowedHandle {}
impl AsRef<PipeWriter> for BorrowedHandle {}
// ... TBD

Steps / History

(Remember to update the S-tracking-* label when checking boxes.)

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions