-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Tracking Issue for RFC 3128: I/O Safety #87074
Copy link
Copy link
Closed
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-waiting-on-fcpStatus: PR is in FCP and is awaiting for FCP to complete.Status: PR is in FCP and is awaiting for FCP to complete.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Metadata
Metadata
Assignees
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-waiting-on-fcpStatus: PR is in FCP and is awaiting for FCP to complete.Status: PR is in FCP and is awaiting for FCP to complete.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Feature gate:
#![feature(io_safety)]This is a tracking issue for RFC 3128: I/O Safety.
Raw OS handles such as
RawFdandRawHandlehave hazards similar to raw pointers; they may be bogus or may dangle, leading to broken encapsulation boundaries and code whose behavior is impossible to bound in general.Introduce a concept of I/O safety, and introduce a new set of types and traits, led by
OwnedFdandBorrowedFd, to support it.Public API
The public API on UNIX platforms consists of the types
OwnedFdandBorrowedFd, the traitAsFd, and implementations ofAsFd,Into<OwnedFd>, andFrom<OwnedFd>for various types (such as files and sockets).The public API on Windows platforms consists of two sets of parallel types and traits and impls for
OwnedHandle,OwnedSocket,BorrowedHandle,BorrowedSocket, etc.Steps / History
Unresolved Questions