Xuanwo commented on code in PR #176:
URL: https://github.com/apache/iceberg-rust/pull/176#discussion_r1492439815
##########
crates/iceberg/src/io.rs:
##########
@@ -240,9 +241,9 @@ impl InputFile {
}
/// Trait for writing file.
-pub trait FileWrite: AsyncWrite {}
+pub trait FileWrite: AsyncWrite + TokioAsyncWrite + Send + Unpin {}
Review Comment:
> Can we remove the futures::AsyncWrite? Since for now, we don't need it.
That's fine to remove `futures::AsyncWrite` here if not needed.
But I want to mention that using `AsyncWrite` is more friendly for users who
don't want to depend on `TokioAsyncWrite` and there are `async_compat` crate to
transform a `futures::AsyncWrite` to `TokioAsyncWrite`.
Maybe we can add our own trait to support both of them? I believe this is
another issue and should not be part of this PR.
##########
crates/iceberg/src/io.rs:
##########
@@ -240,9 +241,9 @@ impl InputFile {
}
/// Trait for writing file.
-pub trait FileWrite: AsyncWrite {}
+pub trait FileWrite: AsyncWrite + TokioAsyncWrite + Send + Unpin {}
Review Comment:
> Can we remove the futures::AsyncWrite? Since for now, we don't need it.
That's fine to remove `futures::AsyncWrite` here if not needed.
But I want to mention that using `AsyncWrite` is more friendly for users who
don't want to depend on `TokioAsyncWrite` and there are `async_compat` crate to
transform a `futures::AsyncWrite` to `TokioAsyncWrite`.
---
Maybe we can add our own trait to support both of them? I believe this is
another issue and should not be part of this PR.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]