| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations |
| // under the License. |
| |
| // DO NOT EDIT IT MANUALLY. This file is generated by opendal/dev/src/generate/dotnet.rs. |
| |
| /// FFI-safe mirror of `opendal::Capability` used by the .NET binding. |
| /// |
| /// This struct intentionally mirrors fields from OpenDAL core capability, |
| /// but uses a stable C-compatible layout for cross-language interop. |
| /// |
| /// We keep this dedicated mirror because Rust internal type layout is not an |
| /// FFI contract and must not be marshaled directly across the ABI boundary. |
| /// |
| /// Absent `Option<usize>` limits are encoded as `usize::MAX`, which the C# |
| /// side maps back to `null`. |
| #[repr(C)] |
| #[derive(Default, Clone, Copy)] |
| pub struct Capability { |
| /// Indicates if the operator supports metadata retrieval operations. |
| pub stat: bool, |
| /// Indicates if conditional stat operations using If-Match are supported. |
| pub stat_with_if_match: bool, |
| /// Indicates if conditional stat operations using If-None-Match are supported. |
| pub stat_with_if_none_match: bool, |
| /// Indicates if conditional stat operations using version match are supported. |
| pub stat_with_if_version_match: bool, |
| /// Indicates if conditional stat operations using version non-match are supported. |
| pub stat_with_if_version_not_match: bool, |
| /// Indicates if conditional stat operations using If-Modified-Since are supported. |
| pub stat_with_if_modified_since: bool, |
| /// Indicates if conditional stat operations using If-Unmodified-Since are supported. |
| pub stat_with_if_unmodified_since: bool, |
| /// Indicates if Cache-Control header override is supported during stat operations. |
| pub stat_with_override_cache_control: bool, |
| /// Indicates if Content-Disposition header override is supported during stat operations. |
| pub stat_with_override_content_disposition: bool, |
| /// Indicates if Content-Type header override is supported during stat operations. |
| pub stat_with_override_content_type: bool, |
| /// Indicates if versions stat operations are supported. |
| pub stat_with_version: bool, |
| /// Indicates if the operator supports read operations. |
| pub read: bool, |
| /// Indicates if conditional read operations using If-Match are supported. |
| pub read_with_if_match: bool, |
| /// Indicates if conditional read operations using If-None-Match are supported. |
| pub read_with_if_none_match: bool, |
| /// Indicates if conditional read operations using version match are supported. |
| pub read_with_if_version_match: bool, |
| /// Indicates if conditional read operations using version non-match are supported. |
| pub read_with_if_version_not_match: bool, |
| /// Indicates if conditional read operations using If-Modified-Since are supported. |
| pub read_with_if_modified_since: bool, |
| /// Indicates if conditional read operations using If-Unmodified-Since are supported. |
| pub read_with_if_unmodified_since: bool, |
| /// Indicates if Cache-Control header override is supported during read operations. |
| pub read_with_override_cache_control: bool, |
| /// Indicates if Content-Disposition header override is supported during read operations. |
| pub read_with_override_content_disposition: bool, |
| /// Indicates if Content-Type header override is supported during read operations. |
| pub read_with_override_content_type: bool, |
| /// Indicates if versions read operations are supported. |
| pub read_with_version: bool, |
| /// Indicates if suffix read operations are supported. |
| pub read_with_suffix: bool, |
| /// Indicates if the operator supports write operations. |
| pub write: bool, |
| /// Indicates if multiple write operations can be performed on the same object. |
| pub write_can_multi: bool, |
| /// Indicates if writing empty content is supported. |
| pub write_can_empty: bool, |
| /// Indicates if append operations are supported. |
| pub write_can_append: bool, |
| /// Indicates if a non-append writer can natively copy source ranges into an in-progress write. `Writer::copy_from` remains available through streaming fallback when false or when appending. |
| pub write_can_copy_from: bool, |
| /// Indicates if Content-Type can be specified during write operations. |
| pub write_with_content_type: bool, |
| /// Indicates if Content-Disposition can be specified during write operations. |
| pub write_with_content_disposition: bool, |
| /// Indicates if Content-Encoding can be specified during write operations. |
| pub write_with_content_encoding: bool, |
| /// Indicates if Cache-Control can be specified during write operations. |
| pub write_with_cache_control: bool, |
| /// Indicates if conditional write operations using If-Match are supported. |
| pub write_with_if_match: bool, |
| /// Indicates if conditional write operations using If-None-Match are supported. |
| pub write_with_if_none_match: bool, |
| /// Indicates if conditional write operations using version match are supported. |
| pub write_with_if_version_match: bool, |
| /// Indicates if conditional write operations using version non-match are supported. |
| pub write_with_if_version_not_match: bool, |
| /// Indicates if write operations can be conditional on object non-existence. |
| pub write_with_if_not_exists: bool, |
| /// Indicates if custom user metadata can be attached during write operations. |
| pub write_with_user_metadata: bool, |
| /// Maximum size supported for multipart uploads. For example, AWS S3 supports up to 5GiB per part in multipart uploads. |
| pub write_multi_max_size: usize, |
| /// Minimum size required for multipart uploads (except for the last part). For example, AWS S3 requires at least 5MiB per part. |
| pub write_multi_min_size: usize, |
| /// Maximum total size supported for write operations. For example, Cloudflare D1 has a 1MB total size limit. |
| pub write_total_max_size: usize, |
| /// Indicates if directory creation is supported. |
| pub create_dir: bool, |
| /// Indicates if delete operations are supported. |
| pub delete: bool, |
| /// Indicates if versions delete operations are supported. |
| pub delete_with_version: bool, |
| /// Indicates if recursive delete operations are supported. |
| pub delete_with_recursive: bool, |
| /// Indicates if conditional delete operations using If-Match are supported. |
| pub delete_with_if_match: bool, |
| /// Indicates if conditional delete operations using If-None-Match are supported. |
| pub delete_with_if_none_match: bool, |
| /// Indicates if conditional delete operations using version match are supported. |
| pub delete_with_if_version_match: bool, |
| /// Indicates if conditional delete operations using version non-match are supported. |
| pub delete_with_if_version_not_match: bool, |
| /// Maximum size supported for single delete operations. |
| pub delete_max_size: usize, |
| /// Indicates if copy operations are supported. |
| pub copy: bool, |
| /// Indicates if conditional copy operations with if-not-exists are supported. |
| pub copy_with_if_not_exists: bool, |
| /// Indicates if conditional copy operations with if-match are supported. |
| pub copy_with_if_match: bool, |
| /// Indicates if conditional copy operations with if-none-match are supported. |
| pub copy_with_if_none_match: bool, |
| /// Indicates if conditional copy operations using version match are supported. |
| pub copy_with_if_version_match: bool, |
| /// Indicates if conditional copy operations using version non-match are supported. |
| pub copy_with_if_version_not_match: bool, |
| /// Indicates if copy operations from a specific source version are supported. |
| pub copy_with_source_version: bool, |
| /// Indicates if copy operations can be split into multiple server-side tasks. |
| pub copy_can_multi: bool, |
| /// Maximum size supported for segmented copy tasks. |
| pub copy_multi_max_size: usize, |
| /// Minimum size required for segmented copy tasks. |
| pub copy_multi_min_size: usize, |
| /// Indicates if restore operations are supported. |
| pub restore: bool, |
| /// Indicates if restoring a specific version is supported. |
| pub restore_with_version: bool, |
| /// Indicates if conditional restore operations using if-not-exists are supported. |
| pub restore_with_if_not_exists: bool, |
| /// Indicates if rename operations are supported. |
| pub rename: bool, |
| /// Indicates if conditional rename operations with if-not-exists are supported. |
| pub rename_with_if_not_exists: bool, |
| /// Indicates if list operations are supported. |
| pub list: bool, |
| /// Indicates if list operations support result limiting. |
| pub list_with_limit: bool, |
| /// Indicates if list operations support continuation from a specific point. |
| pub list_with_start_after: bool, |
| /// Indicates if recursive listing is supported. |
| pub list_with_recursive: bool, |
| /// Indicates if listing with versions included is supported. |
| pub list_with_versions: bool, |
| /// Indicates if listing with deleted files included is supported. |
| pub list_with_deleted: bool, |
| /// Indicates if presigned URL generation is supported. |
| pub presign: bool, |
| /// Indicates if presigned URLs for read operations are supported. |
| pub presign_read: bool, |
| /// Indicates if presigned URLs for stat operations are supported. |
| pub presign_stat: bool, |
| /// Indicates if presigned URLs for write operations are supported. |
| pub presign_write: bool, |
| /// Indicates if presigned URLs for delete operations are supported. |
| pub presign_delete: bool, |
| /// Indicate if the operator supports shared access. |
| pub shared: bool, |
| } |
| |
| impl Capability { |
| /// Convert OpenDAL core capability into the FFI mirror payload. |
| pub fn new(cap: opendal::Capability) -> Self { |
| Self { |
| stat: cap.stat, |
| stat_with_if_match: cap.stat_with_if_match, |
| stat_with_if_none_match: cap.stat_with_if_none_match, |
| stat_with_if_version_match: cap.stat_with_if_version_match, |
| stat_with_if_version_not_match: cap.stat_with_if_version_not_match, |
| stat_with_if_modified_since: cap.stat_with_if_modified_since, |
| stat_with_if_unmodified_since: cap.stat_with_if_unmodified_since, |
| stat_with_override_cache_control: cap.stat_with_override_cache_control, |
| stat_with_override_content_disposition: cap.stat_with_override_content_disposition, |
| stat_with_override_content_type: cap.stat_with_override_content_type, |
| stat_with_version: cap.stat_with_version, |
| read: cap.read, |
| read_with_if_match: cap.read_with_if_match, |
| read_with_if_none_match: cap.read_with_if_none_match, |
| read_with_if_version_match: cap.read_with_if_version_match, |
| read_with_if_version_not_match: cap.read_with_if_version_not_match, |
| read_with_if_modified_since: cap.read_with_if_modified_since, |
| read_with_if_unmodified_since: cap.read_with_if_unmodified_since, |
| read_with_override_cache_control: cap.read_with_override_cache_control, |
| read_with_override_content_disposition: cap.read_with_override_content_disposition, |
| read_with_override_content_type: cap.read_with_override_content_type, |
| read_with_version: cap.read_with_version, |
| read_with_suffix: cap.read_with_suffix, |
| write: cap.write, |
| write_can_multi: cap.write_can_multi, |
| write_can_empty: cap.write_can_empty, |
| write_can_append: cap.write_can_append, |
| write_can_copy_from: cap.write_can_copy_from, |
| write_with_content_type: cap.write_with_content_type, |
| write_with_content_disposition: cap.write_with_content_disposition, |
| write_with_content_encoding: cap.write_with_content_encoding, |
| write_with_cache_control: cap.write_with_cache_control, |
| write_with_if_match: cap.write_with_if_match, |
| write_with_if_none_match: cap.write_with_if_none_match, |
| write_with_if_version_match: cap.write_with_if_version_match, |
| write_with_if_version_not_match: cap.write_with_if_version_not_match, |
| write_with_if_not_exists: cap.write_with_if_not_exists, |
| write_with_user_metadata: cap.write_with_user_metadata, |
| write_multi_max_size: cap.write_multi_max_size.unwrap_or(usize::MAX), |
| write_multi_min_size: cap.write_multi_min_size.unwrap_or(usize::MAX), |
| write_total_max_size: cap.write_total_max_size.unwrap_or(usize::MAX), |
| create_dir: cap.create_dir, |
| delete: cap.delete, |
| delete_with_version: cap.delete_with_version, |
| delete_with_recursive: cap.delete_with_recursive, |
| delete_with_if_match: cap.delete_with_if_match, |
| delete_with_if_none_match: cap.delete_with_if_none_match, |
| delete_with_if_version_match: cap.delete_with_if_version_match, |
| delete_with_if_version_not_match: cap.delete_with_if_version_not_match, |
| delete_max_size: cap.delete_max_size.unwrap_or(usize::MAX), |
| copy: cap.copy, |
| copy_with_if_not_exists: cap.copy_with_if_not_exists, |
| copy_with_if_match: cap.copy_with_if_match, |
| copy_with_if_none_match: cap.copy_with_if_none_match, |
| copy_with_if_version_match: cap.copy_with_if_version_match, |
| copy_with_if_version_not_match: cap.copy_with_if_version_not_match, |
| copy_with_source_version: cap.copy_with_source_version, |
| copy_can_multi: cap.copy_can_multi, |
| copy_multi_max_size: cap.copy_multi_max_size.unwrap_or(usize::MAX), |
| copy_multi_min_size: cap.copy_multi_min_size.unwrap_or(usize::MAX), |
| restore: cap.restore, |
| restore_with_version: cap.restore_with_version, |
| restore_with_if_not_exists: cap.restore_with_if_not_exists, |
| rename: cap.rename, |
| rename_with_if_not_exists: cap.rename_with_if_not_exists, |
| list: cap.list, |
| list_with_limit: cap.list_with_limit, |
| list_with_start_after: cap.list_with_start_after, |
| list_with_recursive: cap.list_with_recursive, |
| list_with_versions: cap.list_with_versions, |
| list_with_deleted: cap.list_with_deleted, |
| presign: cap.presign, |
| presign_read: cap.presign_read, |
| presign_stat: cap.presign_stat, |
| presign_write: cap.presign_write, |
| presign_delete: cap.presign_delete, |
| shared: cap.shared, |
| } |
| } |
| } |