@@ -161,21 +161,6 @@ pub fn do_some_io<FD: AsFd>(input: &FD) -> io::Result<()> {
161
161
162
162
For Windows, similar traits, but in ` Handle ` and ` Socket ` forms.
163
163
164
- ## Portability for simple use cases
165
-
166
- Portability in this space isn't easy, since Windows has two different handle
167
- types while Unix has one. However, some use cases can treat ` AsFd ` and
168
- ` AsHandle ` similarly, while some other uses can treat ` AsFd ` and ` AsSocket `
169
- similarly. In these two cases, trivial ` Filelike ` and ` Socketlike ` abstractions
170
- allow code which works in this way to be generic over Unix and Windows.
171
-
172
- On Unix, ` AsFilelike ` and ` AsSocketlike ` have blanket implementations for
173
- any type that implements ` AsFd ` . On Windows, ` AsFilelike ` has a blanket
174
- implementation for any type that implements ` AsHandle ` , and ` AsSocketlike `
175
- has a blanket implementation for any type that implements ` AsSocket ` .
176
-
177
- Similar portability abstractions apply to the ` From* ` and ` Into* ` traits.
178
-
179
164
## Gradual adoption
180
165
181
166
I/O safety and the new types and traits wouldn't need to be adopted
@@ -387,6 +372,15 @@ Some possible future ideas that could build on this RFC include:
387
372
allowing users to "view" a raw file descriptor as a ` File ` , ` TcpStream ` ,
388
373
and so on.
389
374
375
+ - Portability for simple use cases. Portability in this space isn't easy,
376
+ since Windows has two different handle types while Unix has one. However,
377
+ some use cases can treat ` AsFd ` and ` AsHandle ` similarly, while some other
378
+ uses can treat ` AsFd ` and ` AsSocket ` similarly. In these two cases, trivial
379
+ ` Filelike ` and ` Socketlike ` abstractions could allow code which works in
380
+ this way to be generic over Unix and Windows.
381
+
382
+ Similar portability abstractions could apply to the ` From* ` and ` Into* ` traits.
383
+
390
384
# Thanks
391
385
[ thanks ] : #thanks
392
386
0 commit comments