@@ -81,60 +81,6 @@ typedef enum opendal_code {
81
81
OPENDAL_RANGE_NOT_SATISFIED ,
82
82
} opendal_code ;
83
83
84
- /**
85
- * BlockingOperator is the entry for all public blocking APIs.
86
- *
87
- * Read [`concepts`][docs::concepts] for know more about [`Operator`].
88
- *
89
- * # Examples
90
- *
91
- * ## Init backends
92
- *
93
- * Read more backend init examples in [`services`]
94
- *
95
- * ```rust,no_run
96
- * # use anyhow::Result;
97
- * use opendal::services::Fs;
98
- * use opendal::BlockingOperator;
99
- * use opendal::Operator;
100
- *
101
- * fn main() -> Result<()> {
102
- * // Create fs backend builder.
103
- * let builder = Fs::default().root("/tmp");
104
- *
105
- * // Build an `BlockingOperator` to start operating the storage.
106
- * let _: BlockingOperator = Operator::new(builder)?.finish().blocking();
107
- *
108
- * Ok(())
109
- * }
110
- * ```
111
- *
112
- * ## Init backends with blocking layer
113
- *
114
- * Some services like s3, gcs doesn't have native blocking supports, we can use [`layers::BlockingLayer`]
115
- * to wrap the async operator to make it blocking.
116
- * # use anyhow::Result;
117
- * use opendal::layers::BlockingLayer;
118
- * use opendal::services::S3;
119
- * use opendal::BlockingOperator;
120
- * use opendal::Operator;
121
- *
122
- * async fn test() -> Result<()> {
123
- * // Create fs backend builder.
124
- * let mut builder = S3::default().bucket("test").region("us-east-1");
125
- *
126
- * // Build an `BlockingOperator` with blocking layer to start operating the storage.
127
- * let _: BlockingOperator = Operator::new(builder)?
128
- * .layer(BlockingLayer::create()?)
129
- * .finish()
130
- * .blocking();
131
- *
132
- * Ok(())
133
- * }
134
- * ```
135
- */
136
- typedef struct BlockingOperator BlockingOperator ;
137
-
138
84
/**
139
85
* \brief opendal_bytes carries raw-bytes with its length
140
86
*
@@ -188,6 +134,10 @@ typedef struct opendal_error {
188
134
* @see opendal_list_entry_name()
189
135
*/
190
136
typedef struct opendal_entry {
137
+ /**
138
+ * The pointer to the opendal::Entry in the Rust code.
139
+ * Only touch this on judging whether it is NULL.
140
+ */
191
141
void * inner ;
192
142
} opendal_entry ;
193
143
@@ -219,6 +169,10 @@ typedef struct opendal_result_lister_next {
219
169
* @see opendal_operator_list()
220
170
*/
221
171
typedef struct opendal_lister {
172
+ /**
173
+ * The pointer to the opendal::BlockingLister in the Rust code.
174
+ * Only touch this on judging whether it is NULL.
175
+ */
222
176
void * inner ;
223
177
} opendal_lister ;
224
178
@@ -259,7 +213,7 @@ typedef struct opendal_operator {
259
213
* The pointer to the opendal::BlockingOperator in the Rust code.
260
214
* Only touch this on judging whether it is NULL.
261
215
*/
262
- const struct BlockingOperator * ptr ;
216
+ const void * inner ;
263
217
} opendal_operator ;
264
218
265
219
/**
@@ -297,7 +251,7 @@ typedef struct opendal_result_operator_new {
297
251
*/
298
252
typedef struct opendal_operator_options {
299
253
/**
300
- * The pointer to the Rust HashMap<String, String>
254
+ * The pointer to the HashMap<String, String> in the Rust code.
301
255
* Only touch this on judging whether it is NULL.
302
256
*/
303
257
void * inner ;
@@ -329,6 +283,10 @@ typedef struct opendal_result_read {
329
283
* a opendal::BlockingReader, which is inside the Rust core code.
330
284
*/
331
285
typedef struct opendal_reader {
286
+ /**
287
+ * The pointer to the opendal::StdReader in the Rust code.
288
+ * Only touch this on judging whether it is NULL.
289
+ */
332
290
void * inner ;
333
291
} opendal_reader ;
334
292
@@ -355,6 +313,10 @@ typedef struct opendal_result_operator_reader {
355
313
* an opendal::BlockingWriter, which is inside the Rust core code.
356
314
*/
357
315
typedef struct opendal_writer {
316
+ /**
317
+ * The pointer to the opendal::BlockingWriter in the Rust code.
318
+ * Only touch this on judging whether it is NULL.
319
+ */
358
320
void * inner ;
359
321
} opendal_writer ;
360
322
@@ -436,6 +398,10 @@ typedef struct opendal_result_list {
436
398
* of operator.
437
399
*/
438
400
typedef struct opendal_operator_info {
401
+ /**
402
+ * The pointer to the opendal::OperatorInfo in the Rust code.
403
+ * Only touch this on judging whether it is NULL.
404
+ */
439
405
void * inner ;
440
406
} opendal_operator_info ;
441
407
@@ -658,7 +624,7 @@ void opendal_error_free(struct opendal_error *ptr);
658
624
* For examples, please see the comment section of opendal_operator_list()
659
625
* @see opendal_operator_list()
660
626
*/
661
- struct opendal_result_lister_next opendal_lister_next (const struct opendal_lister * self );
627
+ struct opendal_result_lister_next opendal_lister_next (struct opendal_lister * self );
662
628
663
629
/**
664
630
* \brief Free the heap-allocated metadata used by opendal_lister
@@ -752,7 +718,7 @@ int64_t opendal_metadata_last_modified_ms(const struct opendal_metadata *self);
752
718
* opendal_operator_free(op);
753
719
* ```
754
720
*/
755
- void opendal_operator_free (const struct opendal_operator * op );
721
+ void opendal_operator_free (const struct opendal_operator * ptr );
756
722
757
723
/**
758
724
* \brief Construct an operator based on `scheme` and `options`
@@ -1343,7 +1309,7 @@ struct opendal_capability opendal_operator_info_get_native_capability(const stru
1343
1309
/**
1344
1310
* \brief Frees the heap memory used by the opendal_bytes
1345
1311
*/
1346
- void opendal_bytes_free (struct opendal_bytes * bs );
1312
+ void opendal_bytes_free (struct opendal_bytes * ptr );
1347
1313
1348
1314
/**
1349
1315
* \brief Construct a heap-allocated opendal_operator_options
@@ -1411,7 +1377,7 @@ void opendal_entry_free(struct opendal_entry *ptr);
1411
1377
/**
1412
1378
* \brief Read data from the reader.
1413
1379
*/
1414
- struct opendal_result_reader_read opendal_reader_read (const struct opendal_reader * self ,
1380
+ struct opendal_result_reader_read opendal_reader_read (struct opendal_reader * self ,
1415
1381
uint8_t * buf ,
1416
1382
uintptr_t len );
1417
1383
@@ -1423,7 +1389,7 @@ void opendal_reader_free(struct opendal_reader *ptr);
1423
1389
/**
1424
1390
* \brief Write data to the writer.
1425
1391
*/
1426
- struct opendal_result_writer_write opendal_writer_write (const struct opendal_writer * self ,
1392
+ struct opendal_result_writer_write opendal_writer_write (struct opendal_writer * self ,
1427
1393
struct opendal_bytes bytes );
1428
1394
1429
1395
/**
0 commit comments