Skip to main content

ContractBody

Trait ContractBody 

Source
pub trait ContractBody:
    Serialize
    + DeserializeOwned
    + Clone
    + Send
    + Sync
    + 'static {
    type Api: ApiVersion;

    const FAMILY: &'static str;
    const TOPIC: &'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). A version-local wire body: a plain serde type bound to exactly one ApiVersion and one contract family/topic (D61).

Every body declared inside a phoxal_api_tree! node gets a generated impl. Handles, SetupContext builders, and the #[derive(Runtime)] assertions all key off Api/FAMILY/TOPIC, which is how a body from the wrong API version is rejected at compile time.

The serde encoding of an implementor is the wire payload; there is no version envelope (D62). Version and family travel as bus metadata, derived from Api and FAMILY.

Required Associated Constants§

Source

const FAMILY: &'static str

Canonical contract family id: the ::-joined node path plus the body type name, with dynamic variables excluded, e.g. "drive::State" or "component::motor::Command".

Source

const TOPIC: &'static str

Versionless topic key: the /-joined node path plus the topic leaf, with each dynamic node contributing a {var} placeholder, e.g. "drive/state" or "component/{instance}/motor/{capability}/command". The runtime key is produced by the api-local topic builder, which fills the placeholders.

Required Associated Types§

Source

type Api: ApiVersion

The single API version this body belongs to. Two bodies from different versions have different Api, so the type system keeps them apart.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl ContractBody for Clock

Source§

const FAMILY: &'static str = "simulation::Clock"

Source§

const TOPIC: &'static str = "simulation/clock"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::mission::Command

Source§

const FAMILY: &'static str = "mission::Command"

Source§

const TOPIC: &'static str = "mission/command"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::power::Command

Source§

const FAMILY: &'static str = "power::Command"

Source§

const TOPIC: &'static str = "power/command"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::motor::Command

Source§

const FAMILY: &'static str = "component::motor::Command"

Source§

const TOPIC: &'static str = "component/{instance}/motor/{capability}/command"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::led::Command

Source§

const FAMILY: &'static str = "component::led::Command"

Source§

const TOPIC: &'static str = "component/{instance}/led/{capability}/command"

Source§

type Api = Api

Source§

impl ContractBody for Contact

Source§

const FAMILY: &'static str = "simulation::Contact"

Source§

const TOPIC: &'static str = "simulation/contact"

Source§

type Api = Api

Source§

impl ContractBody for Control

Source§

const FAMILY: &'static str = "simulation::Control"

Source§

const TOPIC: &'static str = "simulation/control"

Source§

type Api = Api

Source§

impl ContractBody for Detections

Source§

const FAMILY: &'static str = "perception::Detections"

Source§

const TOPIC: &'static str = "perception/detections"

Source§

type Api = Api

Source§

impl ContractBody for EmergencyStopRequest

Source§

const FAMILY: &'static str = "safety::EmergencyStopRequest"

Source§

const TOPIC: &'static str = "safety/estop"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::camera::Frame

Source§

const FAMILY: &'static str = "component::camera::Frame"

Source§

const TOPIC: &'static str = "component/{instance}/camera/{capability}/frame"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::depth::Frame

Source§

const FAMILY: &'static str = "component::depth::Frame"

Source§

const TOPIC: &'static str = "component/{instance}/depth/{capability}/frame"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::microphone::Frame

Source§

const FAMILY: &'static str = "component::microphone::Frame"

Source§

const TOPIC: &'static str = "component/{instance}/microphone/{capability}/frame"

Source§

type Api = Api

Source§

impl ContractBody for Frontiers

Source§

const FAMILY: &'static str = "explore::Frontiers"

Source§

const TOPIC: &'static str = "explore/frontiers"

Source§

type Api = Api

Source§

impl ContractBody for GetRequest

Source§

const FAMILY: &'static str = "asset::GetRequest"

Source§

const TOPIC: &'static str = "asset/get"

Source§

type Api = Api

Source§

impl ContractBody for GetResponse

Source§

const FAMILY: &'static str = "asset::GetResponse"

Source§

const TOPIC: &'static str = "asset/get"

Source§

type Api = Api

Source§

impl ContractBody for Goal

Source§

const FAMILY: &'static str = "mission::Goal"

Source§

const TOPIC: &'static str = "mission/goal"

Source§

type Api = Api

Source§

impl ContractBody for Heartbeat

Source§

const FAMILY: &'static str = "presence::Heartbeat"

Source§

const TOPIC: &'static str = "presence/heartbeat"

Source§

type Api = Api

Source§

impl ContractBody for JointState

Source§

const FAMILY: &'static str = "joint::JointState"

Source§

const TOPIC: &'static str = "joint/{joint}/state"

Source§

type Api = Api

Source§

impl ContractBody for LocalizationState

Source§

const FAMILY: &'static str = "localize::LocalizationState"

Source§

const TOPIC: &'static str = "localize/state"

Source§

type Api = Api

Source§

impl ContractBody for LookupRequest

Source§

const FAMILY: &'static str = "frame::LookupRequest"

Source§

const TOPIC: &'static str = "frame/lookup"

Source§

type Api = Api

Source§

impl ContractBody for LookupResponse

Source§

const FAMILY: &'static str = "frame::LookupResponse"

Source§

const TOPIC: &'static str = "frame/lookup"

Source§

type Api = Api

Source§

impl ContractBody for ManualCommand

Source§

const FAMILY: &'static str = "motion::ManualCommand"

Source§

const TOPIC: &'static str = "motion/manual"

Source§

type Api = Api

Source§

impl ContractBody for OpenRequest

Source§

const FAMILY: &'static str = "video::OpenRequest"

Source§

const TOPIC: &'static str = "video/open"

Source§

type Api = Api

Source§

impl ContractBody for OpenResponse

Source§

const FAMILY: &'static str = "video::OpenResponse"

Source§

const TOPIC: &'static str = "video/open"

Source§

type Api = Api

Source§

impl ContractBody for Path

Source§

const FAMILY: &'static str = "plan::Path"

Source§

const TOPIC: &'static str = "plan/path"

Source§

type Api = Api

Source§

impl ContractBody for Revision

Source§

const FAMILY: &'static str = "map::Revision"

Source§

const TOPIC: &'static str = "map/revision"

Source§

type Api = Api

Source§

impl ContractBody for RobotPose

Source§

const FAMILY: &'static str = "simulation::RobotPose"

Source§

const TOPIC: &'static str = "simulation/robot_pose"

Source§

type Api = Api

Source§

impl ContractBody for SafetyAuthorization

Source§

const FAMILY: &'static str = "safety::SafetyAuthorization"

Source§

const TOPIC: &'static str = "safety/authorization"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::encoder::Sample

Source§

const FAMILY: &'static str = "component::encoder::Sample"

Source§

const TOPIC: &'static str = "component/{instance}/encoder/{capability}/sample"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::accelerometer::Sample

Source§

const FAMILY: &'static str = "component::accelerometer::Sample"

Source§

const TOPIC: &'static str = "component/{instance}/accelerometer/{capability}/sample"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::gyroscope::Sample

Source§

const FAMILY: &'static str = "component::gyroscope::Sample"

Source§

const TOPIC: &'static str = "component/{instance}/gyroscope/{capability}/sample"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::magnetometer::Sample

Source§

const FAMILY: &'static str = "component::magnetometer::Sample"

Source§

const TOPIC: &'static str = "component/{instance}/magnetometer/{capability}/sample"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::imu::Sample

Source§

const FAMILY: &'static str = "component::imu::Sample"

Source§

const TOPIC: &'static str = "component/{instance}/imu/{capability}/sample"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::range::Sample

Source§

const FAMILY: &'static str = "component::range::Sample"

Source§

const TOPIC: &'static str = "component/{instance}/range/{capability}/sample"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::gnss::Sample

Source§

const FAMILY: &'static str = "component::gnss::Sample"

Source§

const TOPIC: &'static str = "component/{instance}/gnss/{capability}/sample"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::lidar::Scan

Source§

const FAMILY: &'static str = "component::lidar::Scan"

Source§

const TOPIC: &'static str = "component/{instance}/lidar/{capability}/scan"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::mmwave::Scan

Source§

const FAMILY: &'static str = "component::mmwave::Scan"

Source§

const TOPIC: &'static str = "component/{instance}/mmwave/{capability}/scan"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::drive::State

Source§

const FAMILY: &'static str = "drive::State"

Source§

const TOPIC: &'static str = "drive/state"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::battery::State

Source§

const FAMILY: &'static str = "battery::State"

Source§

const TOPIC: &'static str = "battery/state"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::mission::State

Source§

const FAMILY: &'static str = "mission::State"

Source§

const TOPIC: &'static str = "mission/state"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::power::State

Source§

const FAMILY: &'static str = "power::State"

Source§

const TOPIC: &'static str = "power/state"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::motion::State

Source§

const FAMILY: &'static str = "motion::State"

Source§

const TOPIC: &'static str = "motion/state"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::plan::State

Source§

const FAMILY: &'static str = "plan::State"

Source§

const TOPIC: &'static str = "plan/state"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::follow::State

Source§

const FAMILY: &'static str = "follow::State"

Source§

const TOPIC: &'static str = "follow/state"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::explore::State

Source§

const FAMILY: &'static str = "explore::State"

Source§

const TOPIC: &'static str = "explore/state"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::perception::State

Source§

const FAMILY: &'static str = "perception::State"

Source§

const TOPIC: &'static str = "perception/state"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::component::emergency_stop::State

Source§

const FAMILY: &'static str = "component::emergency_stop::State"

Source§

const TOPIC: &'static str = "component/{instance}/emergency_stop/{capability}/state"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::odometry::State

Source§

const FAMILY: &'static str = "odometry::State"

Source§

const TOPIC: &'static str = "odometry/state"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::presence::State

Source§

const FAMILY: &'static str = "presence::State"

Source§

const TOPIC: &'static str = "presence/state"

Source§

type Api = Api

Source§

impl ContractBody for StaticTransforms

Source§

const FAMILY: &'static str = "frame::StaticTransforms"

Source§

const TOPIC: &'static str = "frame/static_transforms"

Source§

type Api = Api

Source§

impl ContractBody for Status

Source§

const FAMILY: &'static str = "safety::Status"

Source§

const TOPIC: &'static str = "safety/state"

Source§

type Api = Api

Source§

impl ContractBody for StreamState

Source§

const FAMILY: &'static str = "video::stream::StreamState"

Source§

const TOPIC: &'static str = "video/stream/{stream}/state"

Source§

type Api = Api

Source§

impl ContractBody for SubmapRequest

Source§

const FAMILY: &'static str = "map::SubmapRequest"

Source§

const TOPIC: &'static str = "map/submap"

Source§

type Api = Api

Source§

impl ContractBody for SubmapResponse

Source§

const FAMILY: &'static str = "map::SubmapResponse"

Source§

const TOPIC: &'static str = "map/submap"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::drive::Target

Source§

const FAMILY: &'static str = "drive::Target"

Source§

const TOPIC: &'static str = "drive/target"

Source§

type Api = Api

Source§

impl ContractBody for phoxal_api::y2026_1::follow::Target

Source§

const FAMILY: &'static str = "follow::Target"

Source§

const TOPIC: &'static str = "follow/target"

Source§

type Api = Api

Source§

impl ContractBody for Tree

Source§

const FAMILY: &'static str = "frame::Tree"

Source§

const TOPIC: &'static str = "frame/tree"

Source§

type Api = Api