Crates.io | opendal_compat |
lib.rs | opendal_compat |
version | 1.0.1 |
source | src |
created_at | 2024-10-23 03:03:15.975529 |
updated_at | 2024-11-07 06:01:10.347256 |
description | Apache OpenDAL Compat |
homepage | https://opendal.apache.org/ |
repository | https://github.com/apache/opendal |
max_upload_size | |
id | 1419607 |
size | 27,454 |
opendal-compat
provides compatibility functions for opendal.
This crate can make it easier to resolve the compatibility issues between different versions of opendal.
Add the following dependencies to your Cargo.toml
with correct version:
[dependencies]
opendal_compat = { version = "1", features = ["v0_50_to_v0_49"] }
opendal = { version = "0.50.0" }
opendal_v0_49 = { package="opendal", version = "0.49" }
Convert opendal::Operator
to old opendal Operator
:
use opendal_v0_50::Operator;
use opendal_v0_50::services::MemoryConfig;
use opendal_v0_50::Result;
fn i_need_opendal_v0_49_op(op: opendal_v0_49::Operator) {
// do something with old opendal;
}
fn main() -> Result<()> {
let v0_50_op = Operator::from_config(MemoryConfig::default())?.finish();
let v0_49_op = opendal_compat::v0_50_to_v0_49(v0_50_op);
i_need_opendal_v0_49_op(v0_49_op);
Ok(())
}
The first and most prominent mentions must use the full form: Apache OpenDALâ„¢ of the name for any individual usage (webpage, handout, slides, etc.) Depending on the context and writing style, you should use the full form of the name sufficiently often to ensure that readers clearly understand the association of both the OpenDAL project and the OpenDAL software product to the ASF as the parent organization.
For more details, see the Apache Product Name Usage Guide.
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
Apache OpenDAL, OpenDAL, and Apache are either registered trademarks or trademarks of the Apache Software Foundation.