mod compat

module compat

Capability handshake: decide from a backend’s Capabilities message whether this build can drive it, before any work is dispatched.

The host states what it speaks as an Expectation. A backend that declares an incompatible protocol family or major, a lower protocol minor than required, a different schema identity, an incompatible eindir bridge or DLPack revision, or that lacks a required operation is refused with a message naming the first mismatch. Metadata a backend leaves unset (empty family, zero bridge major) is not a declaration and is not checked.

Variables

const PROTOCOL_FAMILY: &str

Protocol family this build speaks.

const PROTOCOL_MAJOR: u16

Wire-incompatible protocol revision.

const PROTOCOL_MINOR: u16

Additive protocol revision.

const SCHEMA_ID: &str

Cap’n Proto identity of Potentials.capnp.

Functions

fn check_capabilities(caps: Reader<'_>, want: &Expectation) -> Result<(), String>

Check caps against want; the error names the first incompatibility.

fn check_capabilities_words(words: &[u64], want: &Expectation) -> Result<(), String>

Decode a flat Capabilities message held as aligned words and check it.

async fn check_server(server: &crate::Potentials_capnp::potential::Client, want: &Expectation) -> Result<(), String>

Ask a connected server for its Capabilities and refuse it when they are incompatible. A server that predates Potential.getCapabilities answers UNIMPLEMENTED, which is reported as a missing call with the upgrade path.

fn describe_server(mut caps: Builder<'_>)

Fill caps as the self-description of an rgpot RPC server.

fn fill_compatibility(mut caps: Builder<'_>)

Fill the compatibility fields of caps with what this build speaks.

Structs and Unions

struct Expectation

What the host requires of a backend.

family: &'static str
protocol_major: u16
protocol_minor_min: u16

Lowest protocol minor the host accepts.

schema_id: &'static str
bridge_abi_major: u16
bridge_abi_minor_max: u16

Highest bridge minor the host can consume.

bridge_layout: u32
dlpack_major: u16
dlpack_minor_max: u16

Highest DLPack minor the host can consume.

bridge_features: u64

Bridge feature bits the host understands.

required_operations: Vec<Operation>

Traits implemented

impl Default for Expectation