Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion core/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/examples/basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ rust-version.workspace = true
version.workspace = true

[dependencies]
futures = "0.3"
# futures = "0.3"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please just remove it if we don't need it.

opendal = { path = "../..", features = ["tests"] }
tokio = { version = "1.48.0", features = ["macros", "rt-multi-thread"] }
8 changes: 4 additions & 4 deletions core/examples/basic/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ use opendal::Operator;
use opendal::Result;

async fn example(op: Operator) -> Result<()> {
// Write data to S3.
// Write data to fs.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is not quite true since the storage could be any storage configured.

op.write("test.txt", "Hello, World!").await?;
println!("write succeeded");

// Read data from s3.
// Read data from fs.
let bs = op.read("test.txt").await?;

println!("read: {}", String::from_utf8(bs.to_vec()).unwrap());

// Fetch metadata of s3.
// Fetch metadata of file.
let meta = op.stat("test.txt").await?;
println!("stat: {meta:?}");

// Delete data from s3.
// Delete data from fs.
op.delete("test.txt").await?;
println!("delete succeeded");

Expand Down
Loading