Skip to content

Commit c86f1ce

Browse files
aviramhadtolnayNoratrieb
committed
add InProgress ErrorKind gated behind io_error_inprogress feature
Co-authored-by: David Tolnay <[email protected]> Co-authored-by: nora <[email protected]>
1 parent 194bbc7 commit c86f1ce

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

std/src/io/error.rs

+6
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,11 @@ pub enum ErrorKind {
400400
#[stable(feature = "out_of_memory_error", since = "1.54.0")]
401401
OutOfMemory,
402402

403+
/// The operation was partially successful and needs to be checked
404+
/// later on due to not blocking.
405+
#[unstable(feature = "io_error_inprogress", issue = "none")]
406+
InProgress,
407+
403408
// "Unusual" error kinds which do not correspond simply to (sets
404409
// of) OS error codes, should be added just above this comment.
405410
// `Other` and `Uncategorized` should remain at the end:
@@ -449,6 +454,7 @@ impl ErrorKind {
449454
FilesystemQuotaExceeded => "filesystem quota exceeded",
450455
HostUnreachable => "host unreachable",
451456
Interrupted => "operation interrupted",
457+
InProgress => "in progress",
452458
InvalidData => "invalid data",
453459
InvalidFilename => "invalid filename",
454460
InvalidInput => "invalid input parameter",

std/src/io/error/repr_bitpacked.rs

+1
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ fn kind_from_prim(ek: u32) -> Option<ErrorKind> {
348348
UnexpectedEof,
349349
Unsupported,
350350
OutOfMemory,
351+
InProgress,
351352
Uncategorized,
352353
})
353354
}

std/src/sys/pal/unix/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
279279
libc::ETIMEDOUT => TimedOut,
280280
libc::ETXTBSY => ExecutableFileBusy,
281281
libc::EXDEV => CrossesDevices,
282+
libc::EINPROGRESS => InProgress,
282283

283284
libc::EACCES | libc::EPERM => PermissionDenied,
284285

0 commit comments

Comments
 (0)