Skip to main content

Module conversion

Module conversion 

Source
Available on crate feature unstable_protocol_v2 only.
Expand description

Explicit conversion helpers for experimenting with ACP v2 while SDKs still speak v1.

The conversions below intentionally move values field-by-field and variant-by-variant instead of serializing through JSON so v2 shape changes have obvious edit points. Conversions use From when every source value has a target representation and TryFrom when values outside the shared protocol subset must be rejected instead of guessed, dropped, or defaulted. One-to-many fan-out is represented as TryFrom<Source> for Vec<Target>.

These helpers are convenience APIs for code that wants to share internal ACP-shaped values while supporting both protocol versions. They are not a protocol router: SDKs should choose the v1 or v2 implementation for a connection before dispatching JSON-RPC messages.

Structs§

ProtocolConversionError
Error returned when converting between v1 and v2 protocol type namespaces fails.
V1SessionCapabilityParts
The v1 capability fields represented by v2 SessionCapabilities.

Functions§

try_v1_to_v2
Attempts to convert a v1 value into the corresponding v2 draft value type.
try_v2_to_v1
Attempts to convert a v2 draft value into the corresponding v1 value type.
try_v2_to_v1_many
Attempts to convert a v2 draft value into one or more corresponding v1 values.

Type Aliases§

Result
Result type returned by protocol try-conversion helpers.