clients/rust: SDK methods for AcknowledgeAlarm + QueryActiveAlarms (PR E.6) #110

Merged
dohertj2 merged 1 commits from track-e6-rust-alarm-sdk into main 2026-04-30 17:08:39 -04:00
Owner

Summary

Eleventh PR of the alarms-over-gateway epic (docs/plans/alarms-over-gateway.md). Mirrors PR E.2's .NET surface on the Rust async SDK. Depends on PR E.1 (#105, merged).

  • GatewayClient::acknowledge_alarm — async unary call. Uses the existing unary_request helper (call timeout) and routes failures through Error mapping; non-OK protocol status promotes to Error::ProtocolStatus via ensure_protocol_success.
  • GatewayClient::query_active_alarms — async server-streaming call returning a new ActiveAlarmStream type alias (parallel to EventStream). Errors are pre-mapped from tonic::Status; dropping the stream cancels the call cooperatively.
  • GATEWAY_PROTOCOL_VERSION bumped 2 → 3 to match the .NET contract.
  • FakeGateway test impl extends to satisfy the new trait methods so client_behavior.rs builds. Two new integration tests cover the new SDK methods.

Test plan

  • 12 unit + 10 client_behavior + 4 proto_fixtures = 26 tests, all pass under cargo test
  • cargo build clean (2 pre-existing missing-doc warnings, unrelated to this change)

This closes the per-language Track E SDK work (E.2 .NET → E.6 Rust). E.7 (lmxopcua OPC UA-facing client refresh) is still pending and depends on B.2 + B.3.

## Summary Eleventh PR of the **alarms-over-gateway** epic (docs/plans/alarms-over-gateway.md). Mirrors PR E.2's .NET surface on the Rust async SDK. Depends on PR E.1 (#105, merged). - `GatewayClient::acknowledge_alarm` — async unary call. Uses the existing `unary_request` helper (call timeout) and routes failures through `Error` mapping; non-OK protocol status promotes to `Error::ProtocolStatus` via `ensure_protocol_success`. - `GatewayClient::query_active_alarms` — async server-streaming call returning a new `ActiveAlarmStream` type alias (parallel to `EventStream`). Errors are pre-mapped from `tonic::Status`; dropping the stream cancels the call cooperatively. - `GATEWAY_PROTOCOL_VERSION` bumped 2 → 3 to match the .NET contract. - `FakeGateway` test impl extends to satisfy the new trait methods so `client_behavior.rs` builds. Two new integration tests cover the new SDK methods. ## Test plan - [x] 12 unit + 10 `client_behavior` + 4 `proto_fixtures` = 26 tests, all pass under `cargo test` - [x] `cargo build` clean (2 pre-existing missing-doc warnings, unrelated to this change) This closes the per-language Track E SDK work (E.2 .NET → E.6 Rust). E.7 (lmxopcua OPC UA-facing client refresh) is still pending and depends on B.2 + B.3.
dohertj2 added 1 commit 2026-04-30 17:08:36 -04:00
Eleventh PR of the alarms-over-gateway epic
(docs/plans/alarms-over-gateway.md). Mirrors PR E.2's .NET surface
on the Rust async SDK. Depends on PR E.1 (regen, merged).

- GatewayClient::acknowledge_alarm — async unary call. Uses the
  existing unary_request helper (call timeout) and routes failures
  through Error mapping; non-OK protocol status promotes to
  Error::ProtocolStatus via ensure_protocol_success.
- GatewayClient::query_active_alarms — async server-streaming call
  returning a new ActiveAlarmStream type alias (parallel to
  EventStream). Errors are pre-mapped from tonic::Status; dropping
  the stream cancels the call cooperatively.
- GATEWAY_PROTOCOL_VERSION bumped 2 → 3 to match the .NET contract.
- FakeGateway test impl extends to satisfy the new trait methods so
  client_behavior.rs builds. Two new integration tests cover the
  new SDK methods.

Tests:
- 12 unit + 10 client_behavior + 4 proto_fixtures = 26 tests, all
  pass under cargo test (Rust 1.x via existing toolchain).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dohertj2 merged commit 9ca200f814 into main 2026-04-30 17:08:39 -04:00
dohertj2 deleted branch track-e6-rust-alarm-sdk 2026-04-30 17:08:39 -04:00
Sign in to join this conversation.