This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new 64109d13e fix: expose ListDyn + WriteDyn (#6596)
64109d13e is described below
commit 64109d13e9a3f6af857f7ed797407c526c489c8b
Author: Duncan <[email protected]>
AuthorDate: Thu Sep 25 20:07:01 2025 -0700
fix: expose ListDyn + WriteDyn (#6596)
---
core/src/raw/oio/list/api.rs | 3 +++
core/src/raw/oio/list/mod.rs | 1 +
core/src/raw/oio/write/api.rs | 5 +++++
core/src/raw/oio/write/mod.rs | 1 +
4 files changed, 10 insertions(+)
diff --git a/core/src/raw/oio/list/api.rs b/core/src/raw/oio/list/api.rs
index f42d1cef8..83f8c4609 100644
--- a/core/src/raw/oio/list/api.rs
+++ b/core/src/raw/oio/list/api.rs
@@ -49,7 +49,10 @@ impl<P: List> List for Option<P> {
}
}
+/// ListDyn is the dyn version of [`List`]. Makes it possible to use as
+/// `Box<dyn ListDyn>`.
pub trait ListDyn: Unpin + Send + Sync {
+ /// The dyn version of [`List::next`].
fn next_dyn(&mut self) -> BoxedFuture<'_, Result<Option<Entry>>>;
}
diff --git a/core/src/raw/oio/list/mod.rs b/core/src/raw/oio/list/mod.rs
index c9bb97977..606e51d10 100644
--- a/core/src/raw/oio/list/mod.rs
+++ b/core/src/raw/oio/list/mod.rs
@@ -17,6 +17,7 @@
mod api;
pub use api::List;
+pub use api::ListDyn;
pub use api::Lister;
mod page_list;
diff --git a/core/src/raw/oio/write/api.rs b/core/src/raw/oio/write/api.rs
index b30c91d22..a39fc724e 100644
--- a/core/src/raw/oio/write/api.rs
+++ b/core/src/raw/oio/write/api.rs
@@ -61,11 +61,16 @@ impl Write for () {
}
}
+/// WriteDyn is the dyn version of [`Write`] make it possible to use as
+/// `Box<dyn WriteDyn>`.
pub trait WriteDyn: Unpin + Send + Sync {
+ /// The dyn version of [`Write::write`].
fn write_dyn(&mut self, bs: Buffer) -> BoxedFuture<'_, Result<()>>;
+ /// The dyn version of [`Write::close`].
fn close_dyn(&mut self) -> BoxedFuture<'_, Result<Metadata>>;
+ /// The dyn version of [`Write::abort`].
fn abort_dyn(&mut self) -> BoxedFuture<'_, Result<()>>;
}
diff --git a/core/src/raw/oio/write/mod.rs b/core/src/raw/oio/write/mod.rs
index d05c5ef65..7240ece2c 100644
--- a/core/src/raw/oio/write/mod.rs
+++ b/core/src/raw/oio/write/mod.rs
@@ -17,6 +17,7 @@
mod api;
pub use api::Write;
+pub use api::WriteDyn;
pub use api::Writer;
mod multipart_write;