opendal_compat

Crates.ioopendal_compat
lib.rsopendal_compat
version1.0.1
sourcesrc
created_at2024-10-23 03:03:15.975529
updated_at2024-11-07 06:01:10.347256
descriptionApache OpenDAL Compat
homepagehttps://opendal.apache.org/
repositoryhttps://github.com/apache/opendal
max_upload_size
id1419607
size27,454
Xuanwo (Xuanwo)

documentation

README

Apache OpenDALâ„¢ Compat integration

Build Status Latest Version Crate Downloads chat

opendal-compat provides compatibility functions for opendal.

This crate can make it easier to resolve the compatibility issues between different versions of opendal.

Useful Links

Examples

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(())
}

Branding

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.

License and Trademarks

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.

Commit count: 3022

cargo fmt