opendal 0.42.0

OpenDAL: Access data freely, painlessly, and efficiently.
docs.rs failed to build opendal-0.42.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: opendal-0.46.0

OpenDAL   Build Status Latest Version Crate Downloads chat

OpenDAL is a data access layer that allows users to easily and efficiently retrieve data from various storage services in a unified way.

Services

  • ftp: FTP and FTPS
  • http: HTTP read-only services
  • sftp: SFTP services being worked on
  • webdav: WebDAV Service

Welcome to add any services that are not currently supported here.

Features

Access data freely

  • Access different storage services in the same way
  • Behavior tests for all services

Access data painlessly

Access data efficiently

  • Zero cost: Maps to API calls directly
  • Best effort: Automatically selects best read/seek/next based on services
  • Avoid extra calls: Reuses metadata when possible

Quickstart

use opendal::Result;
use opendal::layers::LoggingLayer;
use opendal::services;
use opendal::Operator;

#[tokio::main]
async fn main() -> Result<()> {
    // Pick a builder and configure it.
    let mut builder = services::S3::default();
    builder.bucket("test");

    // Init an operator
    let op = Operator::new(builder)?
        // Init with logging layer enabled.
        .layer(LoggingLayer::default())
        .finish();

    // Write data
    op.write("hello.txt", "Hello, World!").await?;

    // Read data
    let bs = op.read("hello.txt").await?;

    // Fetch metadata
    let meta = op.stat("hello.txt").await?;
    let mode = meta.mode();
    let length = meta.content_length();

    // Delete
    op.delete("hello.txt").await?;

    Ok(())
}

Examples

The examples are available at here.

Contributing

Check out the CONTRIBUTING guide for more details on getting started with contributing to this project.

License

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0