Xuanwo opened a new pull request, #3474:
URL: https://github.com/apache/incubator-opendal/pull/3474
Python users don't know about reader and writer, they are using File-like
objects and context manager.
This PR add `Operator::open` and `AsnycFile` to make our API more native to
python users.
Async version:
```rust
async with await op.open(filename, "rb") as r:
content = await r.read()
```
Blocking version:
```rust
with op.open(filename, "rb") as r:
content = r.read()
```
Writer is also supported in the same way:
```rust
async with await op.open(filename, "wb") as w:
await w.write("Hello, World!")
```
Close https://github.com/apache/incubator-opendal/issues/2570
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]