bytedance/monoio
View on GitHubTracking issue: impl `AsyncReadRent` and `AsyncWriteRent` for in-memory std buffer types
Open
#310 opened on Oct 21, 2024
F-feature-requestgood first issue
Repository metrics
- Stars
- (5,000 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
Is your feature request related to a problem? Please describe.
I want to have AsyncReadRent and AsyncWriteRent implemented for in-memory std buffer types, like Vec<u8>, Cursor for testing purposes.
Describe the solution you'd like
Similar to what Tokio does:
- write: https://docs.rs/tokio/latest/tokio/io/trait.AsyncWrite.html#foreign-impls
-
Vec<u8> -
Cursor<&mut Vec<u8>> -
Cursor<&mut [u8]> -
Cursor<Box<[u8]>> -
Cursor<Vec<u8>> -
&mut T -
Box<T>
-
- read: https://docs.rs/tokio/latest/tokio/io/trait.AsyncRead.html#foreign-impls
-
&[u8] -
Cursor<T> -
&mut [T] -
Box<T>
-
Describe alternatives you've considered
No
Additional context
AsyncReadRent has been implemented for &[u8]