Xuanwo commented on code in PR #5591:
URL: https://github.com/apache/opendal/pull/5591#discussion_r1948975247


##########
bindings/dart/lib/src/rust/api/opendal_api.dart:
##########
@@ -0,0 +1,176 @@
+// This file is automatically generated, so please do not edit it.
+// @generated by `flutter_rust_bridge`@ 2.7.1.
+
+// ignore_for_file: invalid_use_of_internal_member, unused_import, 
unnecessary_import
+
+import '../frb_generated.dart';
+import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
+
+// Rust type: 
RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<Capability>>
+abstract class Capability implements RustOpaqueInterface {
+  /// If operator supports blocking.
+  bool get blocking;
+
+  /// If operator supports copy.
+  bool get copy;
+
+  /// If operator supports create dir.
+  bool get createDir;
+
+  /// If operator supports delete.
+  bool get delete;
+
+  /// If operator supports list.
+  bool get list;
+
+  /// If backend supports list with limit.
+  bool get listWithLimit;
+
+  /// If backend supports list with recursive.
+  bool get listWithRecursive;
+
+  /// If backend supports list with start after.
+  bool get listWithStartAfter;
+
+  /// If operator supports presign.
+  bool get presign;
+
+  /// If operator supports presign read.
+  bool get presignRead;
+
+  /// If operator supports presign stat.
+  bool get presignStat;
+
+  /// If operator supports presign write.
+  bool get presignWrite;
+
+  /// If operator supports read.
+  bool get read;
+
+  /// If operator supports read with if matched.
+  bool get readWithIfMatch;
+
+  /// If operator supports read with if not match.
+  bool get readWithIfNoneMatch;
+
+  /// if operator supports read with override cache control.
+  bool get readWithOverrideCacheControl;
+
+  /// if operator supports `read` with override content disposition.
+  bool get readWithOverrideContentDisposition;
+
+  /// if operator supports read with override content type.
+  bool get readWithOverrideContentType;
+
+  /// If operator supports rename.
+  bool get rename;
+
+  /// If operator supports shared.
+  bool get shared;
+
+  /// If operator supports stat.
+  bool get stat;
+
+  /// If operator supports stat with if matched.
+  bool get statWithIfMatch;
+
+  /// If operator supports stat with if not match.
+  bool get statWithIfNoneMatch;
+
+  /// If operator supports write.
+  bool get write;
+
+  /// If operator supports write by append.
+  bool get writeCanAppend;
+
+  /// If operator supports write with empty content.
+  bool get writeCanEmpty;
+
+  /// If operator supports write can be called in multi times.
+  bool get writeCanMulti;
+
+  /// write_multi_max_size is the max size that services support in 
write_multi.
+  ///
+  /// For example, AWS S3 supports 5GiB as max in write_multi.
+  BigInt? get writeMultiMaxSize;
+
+  /// write_multi_min_size is the min size that services support in 
write_multi.
+  ///
+  /// For example, AWS S3 requires at least 5MiB in write_multi expect the 
last one.
+  BigInt? get writeMultiMinSize;
+
+  /// write_total_max_size is the max size that services support in 
write_total.
+  ///
+  /// For example, Cloudflare D1 supports 1MB as max in write_total.
+  BigInt? get writeTotalMaxSize;
+
+  /// If operator supports write with cache control.
+  bool get writeWithCacheControl;
+
+  /// If operator supports write with content disposition.
+  bool get writeWithContentDisposition;
+
+  /// If operator supports write with content type.
+  bool get writeWithContentType;
+}
+
+// Rust type: 
RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<Metadata>>
+abstract class Metadata implements RustOpaqueInterface {
+  /// Content-Disposition of this object
+  String? get contentDisposition;
+
+  /// Content Length of this object
+  BigInt? get contentLength;
+
+  /// Content MD5 of this object.
+  String? get contentMd5;
+
+  /// Content Type of this object.
+  String? get contentType;
+
+  /// ETag of this object.
+  String? get etag;
+
+  /// Returns true if the <op.stat> object describes a file system directory.
+  bool get isDirectory;
+
+  /// Returns true if the <op.stat> object describes a regular file.
+  bool get isFile;
+
+  /// Last Modified of this object.
+  ///
+  /// We will output this time in RFC3339 format like 
`1996-12-19T16:39:57+08:00`.
+  String? get lastModified;
+}
+
+// Rust type: 
RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<Operator>>
+abstract class Operator implements RustOpaqueInterface {
+  Capability capability();
+
+  Future<void> check();
+
+  Future<void> createDir({required String path});
+
+  void createDirSync({required String path});
+
+  Future<void> delete({required String path});
+
+  void deleteSync({required String path});
+
+  Future<bool> isExist({required String path});
+
+  bool isExistSync({required String path});
+
+  factory Operator(
+          {required String schemeStr, required Map<String, String> map}) =>
+      RustLib.instance.api
+          .crateApiOpendalApiOperatorNew(schemeStr: schemeStr, map: map);
+
+  Future<void> rename({required String from, required String to});
+
+  void renameSync({required String from, required String to});
+
+  Future<Metadata> stat({required String path});
+
+  Metadata statSync({required String path});
+}

Review Comment:
   Hi, sorry for not making my statement clearer. What I want to know is how 
native Dart users perceive these APIs. Does our current API design meet their 
expectations?
   
   For example, `dart-io`'s API looks in this way: 
https://api.dart.dev/dart-io/dart-io-library.html
   
   ```
   import 'dart:io';
   
   void main() async {
     final filename = 'file.txt';
     var file = await File(filename).writeAsString('some content');
     // Do something with the file.
   }
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to