Expand description

OpenDAL is the Open Data Access Layer that connect the whole world together.

Supported Services

azblobAzure Storage Blob services.
fsPOSIX alike file system.
hdfsHadoop Distributed File System(HDFS).
httpHTTP read-only backend.
memoryIn memory backend support.
s3AWS S3 alike services.

Optional features

  • compress: Enable object decompress read support.
  • retry: Enable operator retry support.
  • services-hdfs: Enable hdfs service support.
  • services-http: Enable http service support.


use anyhow::Result;
use futures::StreamExt;
use opendal::services::fs;
use opendal::DirEntry;
use opendal::DirStreamer;
use opendal::Object;
use opendal::ObjectMetadata;
use opendal::ObjectMode;
use opendal::Operator;

async fn main() -> Result<()> {
    // Init Operator
    let op = Operator::new(fs::Backend::build().root("/tmp").finish().await?);

    // Create object handler.
    let o: Object = op.object("test_file");

    // Write data info object;
    let _: () = o.write("Hello, World!").await?;

    // Read data from object;
    let bs: Vec<u8> = o.read().await?;

    // Read range from object;
    let bs: Vec<u8> = o.range_read(1..=11).await?;

    // Get object's Metadata
    let name: &str = o.name();
    let path: &str = o.path();
    let meta: ObjectMetadata = o.metadata().await?;
    let mode: ObjectMode = meta.mode();
    let length: u64 = meta.content_length();
    let content_md5: Option<&str> = meta.content_md5();
    let etag: Option<&str> = meta.etag();

    // Delete object.
    let _: () = o.delete().await?;

    // List dir object.
    let o: Object = op.object("test_dir/");
    let mut obs: DirStreamer = o.list().await?;
    while let Some(entry) = obs.next().await {
        let entry: DirEntry = entry?;



Providing IO utils like into_sink, into_stream.

Operations used by Accessor.

Providing specific services support.


Metadata for accessor, users can use this metadata to get information of underlying backend.

BatchOperator is used to take batch operations like walk_dir and remove_all, should be constructed by Operator::batch().

DirEntry is returned by DirStream during object list.

Metadata carries all object metadata.

Handler for all object related operations.

Metadata carries all object metadata.

User-facing APIs for object and object streams.


ObjectMode represents the corresponding object’s mode.

Backends that OpenDAL supports


Underlying trait of all backends for implementors.

BytesRead represents a reader of bytes.

BytesSink represents a sink of bytes.

BytesStream represents a stream of bytes.

BytesWrite represents a writer of bytes.

DirStream represents a stream of Dir.

Layer is used to intercept the operations on the underlying storage.

Type Definitions

BytesReader is a boxed dyn BytesRead.

BytesWriter is a boxed dyn BytesWrite.

DirStreamer is a boxed dyn DirStream