tonbo-io / fusio

Fusio provides file operations on multiple storages across various async runtimes.
Apache License 2.0
192 stars 8 forks source link

Implement `Read::read_exact` #40

Open ethe opened 1 month ago

ethe commented 1 month ago

In the current, Read trait does not have read_exact method, it should be supported like https://docs.rs/monoio/latest/monoio/io/trait.AsyncReadRentExt.html#tymethod.read_exact

PhVHoang commented 1 month ago

Hi @ethe , for S3File struct, will the behavior of read_exact be the same as read?

ethe commented 1 month ago

Yes, I think so, S3File always read exactly.

PhVHoang commented 1 month ago

Thanks @ethe . Is fusio open for contributions at this moment? If yes I would love to take this issue.

ethe commented 1 month ago

Sure, I would love to.

ethe commented 1 month ago

I open a PR for the basic default implementation of read_exact: https://github.com/tonbo-io/fusio/pull/51, but this PR is still valid and needs to be continue:

PhVHoang commented 1 month ago

I open a PR for the basic default implementation of read_exact: #51, but this PR is still valid and needs to be continue:

  • [ ] specific Read implementations, for example there are more efficient way to read exactly on S3
  • [ ] ReadDyn support

RE: specific Read implementations Does it mean the implementations for all backend storages (S3File, TokioFile, MonoioFile)? If it's the case I'm working on it now.

RE: ReadDyn support Could you please elaborate more on this part?

ethe commented 1 month ago

Does it mean the implementations for all backend storages (S3File, TokioFile, MonoioFile)? If it's the case I'm working on it now.

Yes, I think so

Could you please elaborate more on this part?

in #51 , I just implemented read_exact for Read, fusio has another set of object safe traits which includes DynRead, we should also define and implement read_exact for it.

PhVHoang commented 1 month ago

Does it mean the implementations for all backend storages (S3File, TokioFile, MonoioFile)? If it's the case I'm working on it now.

Yes, I think so

Could you please elaborate more on this part?

in #51 , I just implemented read_exact for Read, fusio has another set of object safe traits which includes DynRead, we should also implement define and implement read_exact for it.

Ah okay, got it. So it's DynRead not ReadDyn 👍