Skip to main content

ApiVersion

Trait ApiVersion 

Source
pub trait ApiVersion: 'static {
    const ID: &'static str;
    const IS_PREVIEW: bool = false;
}
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 API version (D60), implemented only by the zero-variant enum Api {} that phoxal_api_tree! generates inside each version module; its ID is the module name ("v1"). Its IS_PREVIEW const is lifecycle metadata only.
  • ContractBody is a version-local wire body (D61): a plain serde type bound to exactly one ApiVersion and one contract topic. Every body declared inside a phoxal_api_tree! node gets a generated impl; handles, SetupContext builders, and the Service/Driver derive assertions key off its Api/TOPIC. TOPIC is version-qualified (D1) and is the compatibility key - there is no SCHEMA_ID/FAMILY; its serde encoding is the wire payload, with no version envelope (D62). Marker trait identifying one API version (D60).

Implemented only by the zero-variant enum Api {} that phoxal_api_tree! generates inside each version module. The ID is the version module name ("v1") and is carried in bus metadata as informational provenance, never in the wire body or the topic key (D62). IS_PREVIEW records authoring lifecycle only; it has no wire effect.

Required Associated Constants§

Source

const ID: &'static str

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

Provided Associated Constants§

Source

const IS_PREVIEW: bool = false

Whether this generated API version is still in the preview lifecycle.

This is control-plane metadata only. It is not encoded in bus payloads, topics, schema ids, or encoding strings.

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 = "v1"

Source§

const IS_PREVIEW: bool = false