pub struct Route {
pub resource_id: Arc<str>,
pub ingest: IngestFn,
}Expand description
A single routing entry
Maps one (resource_id, type) pair to a fused ingest callback. 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<str> instead of &'static str to avoid memory leaks from Box::leak().
This adds ~8 bytes overhead per route (Arc control block) but enables proper cleanup.
ingest: IngestFnFused ingest callback: deserialize + produce in one typed closure
built at registration time (no Box<dyn Any> per message).
Auto Trait Implementations§
impl !RefUnwindSafe for Route
impl !UnwindSafe for Route
impl Freeze for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl UnsafeUnpin 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