You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "zwpaper (via GitHub)" <gi...@apache.org> on 2023/04/08 11:06:21 UTC

[GitHub] [incubator-opendal] zwpaper commented on a diff in pull request #1881: binding/c: parse opendal to use typed BlockingOperator

zwpaper commented on code in PR #1881:
URL: https://github.com/apache/incubator-opendal/pull/1881#discussion_r1161098334


##########
bindings/c/include/opendal.h:
##########
@@ -79,6 +79,38 @@ typedef enum opendal_code {
   OPENDAL_IS_SAME_FILE,
 } opendal_code;
 
+/*
+ BlockingOperator is the entry for all public blocking APIs.
+
+ Read [`concepts`][docs::concepts] for know more about [`Operator`].
+
+ # Examples
+
+ Read more backend init examples in [`services`]
+
+ ```
+ # use anyhow::Result;
+ use opendal::services::Fs;
+ use opendal::BlockingOperator;
+ use opendal::Operator;
+ #[tokio::main]
+ async fn main() -> Result<()> {
+     // Create fs backend builder.
+     let mut builder = Fs::default();
+     // Set the root for fs, all operations will happen under this root.
+     //
+     // NOTE: the root must be absolute path.
+     builder.root("/tmp");
+
+     // Build an `BlockingOperator` to start operating the storage.
+     let _: BlockingOperator = Operator::new(builder)?.finish().blocking();
+
+     Ok(())

Review Comment:
   it's automatically generated 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org