feat(bindings/dotnet): add Exists and Check - #8337
Merged
Merged
Conversation
erickguan
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
None.
Rationale for this change
The .NET binding has no way to test for a path without handling a
NotFoundexception, and no way to verify that an operator can reach its service.Operator::existsandOperator::checkcover both in core, and the Python and Node.js bindings already expose them.Existskeeps theNotFoundhandling on the Rust side, so callers get aboolinstead of an exception for the common "is it there?" question.Checkgives applications a startup probe that fails on wrong credentials or an unreachable endpoint instead of surfacing the problem on the first real operation.What changes are included in this PR?
Add
Operator.ExistsandOperator.ExistsAsync, backed byoperator_existsandoperator_exists_async. They returnfalsewhen the backend reportsNotFoundand throw for any other error, matchingOperator::existsin core. The newOpendalBoolResult/OpenDALBoolResultpair carries the value across the FFI boundary the same way the other result structs do.Add
Operator.CheckandOperator.CheckAsync, backed byoperator_checkandoperator_check_async, which forward toOperator::checkin core.Add behavior tests for both. The
Existstests sit with the stat tests, and theChecktests mirror core'stest_check, which is registered with the list tests and runs when the service supports read, write, and list.Document
Existsunder "Check existence and metadata" andCheckin a new "Verify the connection" section of the .NET guide.Are there any user-facing changes?
Yes. Four public methods are added to
Operator. Nothing existing changes, so no migration is needed.Breaking changes
None.
AI Usage Statement
claude-opus-5)Operatorto find the missing operations, then wrote the FFI functions, the managed API, the tests, and this description under the author's direction. The author chose the scope and the commit layout, decided to keep a dedicated bool result struct rather than reusingOpendalResultwith an out parameter, and reviewed every change. Unknown affecting review: the behavior tests ran against thememoryandfsservices only, so no network service exercised the new calls.