pub struct EndpointHandle {
pub force_json: bool,
/* private fields */
}Expand description
The endpoint handle implements the EDA API
Fields§
§force_json: boolImplementations§
Source§impl EndpointHandle
impl EndpointHandle
Sourcepub fn publish_event(
&self,
event: &str,
message: &impl Serialize,
conversation_id: &str,
mandatory: bool,
) -> Result<(), Error>
pub fn publish_event( &self, event: &str, message: &impl Serialize, conversation_id: &str, mandatory: bool, ) -> Result<(), Error>
Send a new Event on the EDA bus.
eventis the name (class name) of the event;messageis the event payload;conversation_idis the mandatory conversation ID;- if
mandatoryis true, aClientMessage::MessageReturned(_)will be sent if the event is unroutable, that is, the exchange did not find any queue to put it in.
Sourcepub fn publish_configuration(
&self,
event: &str,
message: &impl Serialize,
conversation_id: &str,
) -> Result<(), Error>
pub fn publish_configuration( &self, event: &str, message: &impl Serialize, conversation_id: &str, ) -> Result<(), Error>
Send a new Configuration or Configuration Request on the EDA bus.
eventis the name (class name) of the message;messageis the message payload;conversation_idis the mandatory conversation ID;
Sourcepub fn send_command(
&self,
command: &str,
message: &impl Serialize,
conversation_id: &str,
reply_to: &str,
correlation_id: &str,
mandatory: bool,
) -> Result<(), Error>
pub fn send_command( &self, command: &str, message: &impl Serialize, conversation_id: &str, reply_to: &str, correlation_id: &str, mandatory: bool, ) -> Result<(), Error>
Send a new Command on the EDA bus.
commandis the name (class name) of the command;messageis the command payload;conversation_idis the mandatory conversation ID;reply_to: is the routing key to send the result to;correlation_id: is the mandatory correlation ID used to reconcile the result with the command;- if
mandatoryis true, aClientMessage::MessageReturned(_)will be sent if the command is unroutable, that is, the exchange did not find any queue to put it in.
Sourcepub fn return_success(
&self,
destination: &str,
message: &impl Serialize,
conversation_id: &str,
correlation_id: &str,
mandatory: bool,
) -> Result<(), Error>
pub fn return_success( &self, destination: &str, message: &impl Serialize, conversation_id: &str, correlation_id: &str, mandatory: bool, ) -> Result<(), Error>
Send a new successful Result on the EDA bus.
destinationis routing key to which the result is to be sent;messageis the result payload;conversation_idis the mandatory conversation ID;correlation_id: is the mandatory correlation ID used to reconcile the result with the command;- if
mandatoryis true, aClientMessage::MessageReturned(_)will be sent if the result is unroutable, that is, the exchange did not find any queue to put it in.
Sourcepub fn return_error(
&self,
destination: &str,
message: &impl Serialize,
conversation_id: &str,
correlation_id: &str,
mandatory: bool,
) -> Result<(), Error>
pub fn return_error( &self, destination: &str, message: &impl Serialize, conversation_id: &str, correlation_id: &str, mandatory: bool, ) -> Result<(), Error>
Send a new failure Result on the EDA bus.
destinationis routing key to which the result is to be sent;messageis the result payload;conversation_idis the mandatory conversation ID;correlation_id: is the mandatory correlation ID used to reconcile the result with the command;- if
mandatoryis true, aClientMessage::MessageReturned(_)will be sent if the result is unroutable, that is, the exchange did not find any queue to put it in.
Sourcepub fn log_with_extra_fields(
&self,
criticity: Criticity,
short_message: &str,
full_message: &str,
conversation_id: &str,
extra_fields: ExtraFields,
) -> Result<(), Error>
pub fn log_with_extra_fields( &self, criticity: Criticity, short_message: &str, full_message: &str, conversation_id: &str, extra_fields: ExtraFields, ) -> Result<(), Error>
Log on the EDA log bus with custom fields.
Sourcepub fn log(
&self,
criticity: Criticity,
short_message: &str,
full_message: &str,
conversation_id: &str,
) -> Result<(), Error>
pub fn log( &self, criticity: Criticity, short_message: &str, full_message: &str, conversation_id: &str, ) -> Result<(), Error>
Log on the EDA log bus
Sourcepub fn configured(&self) -> Result<(), Error>
pub fn configured(&self) -> Result<(), Error>
Tell the endpoint that the client is configured and ready to accept events and commands.
You don’t need to call this method explicitly if you use the Callback API.
Sourcepub fn ack_delivery(&self, delivery_tag: u64) -> Result<(), Error>
pub fn ack_delivery(&self, delivery_tag: u64) -> Result<(), Error>
Tell the broker to immediately remove the message from the queue.
Use this method only if there is no pending publishes triggered by this message.
If unsure, use Self::delivery_processed() instead.
Sourcepub fn delivery_processed(&self, delivery_tag: u64) -> Result<(), Error>
pub fn delivery_processed(&self, delivery_tag: u64) -> Result<(), Error>
Tell the endpoint that the message was successfully processed and can be safely removed from the queue when all current publishing is actually done.
You don’t need to call this method explicitly if you use the Callback API.
Sourcepub fn nack_delivery(&self, delivery_tag: u64) -> Result<(), Error>
pub fn nack_delivery(&self, delivery_tag: u64) -> Result<(), Error>
Tell the broker that the message was not properly handled (transient error) and should be requeued to be retried later.
You don’t need to call this method explicitly if you use the Callback API.
Sourcepub fn reject_delivery(&self, delivery_tag: u64) -> Result<(), Error>
pub fn reject_delivery(&self, delivery_tag: u64) -> Result<(), Error>
Tell the broker that the message in unprocessable and must be rejected (to dead-letter).
You don’t need to call this method explicitly if you use the Callback API.
Trait Implementations§
Source§impl Clone for EndpointHandle
impl Clone for EndpointHandle
Source§fn clone(&self) -> EndpointHandle
fn clone(&self) -> EndpointHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more