Expand description
§JetStream Derive
This crate provides macros for JetStream.
§service
The service
macro is used to define a JetStream service.
§Basic Usage
ⓘ
#[service]
pub trait Echo {
async fn ping(&mut self, message: String) -> Result<String, Error>;
}
§Tracing Support
Add distributed tracing to your services using the tracing
crate:
ⓘ
#[service(tracing)] // Auto-instrument all methods
pub trait Echo {
// Custom instrumentation
#[instrument(skip(self), fields(msg_len = message.len()))]
async fn ping(&mut self, message: String) -> Result<String, Error>;
}
See the Tracing Guide for detailed documentation on tracing support.
§JetStreamWireFormat
The JetStreamWireFormat
macro is used to derive the WireFormat
trait for a struct.
Attribute Macros§
- service
- Service attribute macro for creating RPC services
Derive Macros§
- JetStream
Wire Format - Derives wire format encoding for structs