pub struct Route {
pub resource_id: Arc<str>,
pub producer: Box<dyn ProducerTrait>,
pub deserializer: DeserializerFn,
}Expand description
A single routing entry
Maps one (resource_id, type) pair to a producer and deserializer. Multiple routes can exist for the same resource_id (different types).
§Resource ID Examples
- MQTT: “sensors/temperature” (topic)
- Kafka: “events:0” (topic:partition)
- HTTP: “/api/v1/sensors” (path)
- DDS: “TelemetryData” (topic name)
- Shmem: “temperature_buffer” (segment name)
Fields§
§resource_id: Arc<str>Resource identifier to match (reference-counted for proper memory management)
Examples: MQTT topic, Kafka topic, HTTP path, DDS topic, shmem segment
Uses Arc
producer: Box<dyn ProducerTrait>Type-erased producer for this route
deserializer: DeserializerFnDeserializer for converting bytes → typed value
Auto Trait Implementations§
impl Freeze for Route
impl !RefUnwindSafe for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl !UnwindSafe for Route
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more