Skip to main content

ApiVersion

Trait ApiVersion 

Source
pub trait ApiVersion: 'static {
    const ID: &'static str;
}
Expand description

The contract primitive traits, re-exported from the phoxal-bus crate (the ABI floor) so they stay addressable at phoxal_api::ApiVersion / phoxal_api::ContractBody.

  • ApiVersion is the marker trait identifying one dated API version (D60), implemented only by the zero-variant enum Api {} that phoxal_api_tree! generates inside each version module; its ID is the dated module name ("y2026_1") and the canonical version identity, carried in bus metadata.
  • ContractBody is a version-local wire body (D61): a plain serde type bound to exactly one ApiVersion and one contract family/topic. Every body declared inside a phoxal_api_tree! node gets a generated impl; handles, SetupContext builders, and the #[derive(Runtime)] assertions key off its Api/FAMILY/TOPIC to reject a body from the wrong API version at compile time. Its serde encoding is the wire payload; there is no version envelope (D62). Marker trait identifying one dated API version (D60).

Implemented only by the zero-variant enum Api {} that phoxal_api_tree! generates inside each version module. The ID is the dated module name ("y2026_1") and is the canonical version identity: it is carried in bus metadata, never in the wire body or the topic key (D62).

Required Associated Constants§

Source

const ID: &'static str

The dated API-version identifier, equal to the version module name, e.g. "y2026_1".

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl ApiVersion for Api

Source§

const ID: &'static str = "y2026_1"