pub struct EgressBuilder { /* private fields */ }Expand description
Builds an Egress incrementally and validates it on the final stage.
Implementations§
Source§impl EgressBuilder
impl EgressBuilder
Sourcepub fn with_name(self, name: impl AsRef<str>) -> Self
pub fn with_name(self, name: impl AsRef<str>) -> Self
Recreates this egress definition builder with the given name.
Sourcepub fn with_exchange(self, exchange: impl AsRef<str>) -> Self
pub fn with_exchange(self, exchange: impl AsRef<str>) -> Self
Recreates this egress definition builder with the given exchange name.
Sourcepub fn with_routing_key(self, routing_key: impl AsRef<str>) -> Self
pub fn with_routing_key(self, routing_key: impl AsRef<str>) -> Self
Recreates this egress definition builder with the given routing key.
Sourcepub fn with_confirmation(self, confirmation: ConfirmationLevel) -> Self
pub fn with_confirmation(self, confirmation: ConfirmationLevel) -> Self
Recreates this egress definition builder with the given confirmation level.
Sourcepub fn with_force_durable(self, force_durable: bool) -> Self
pub fn with_force_durable(self, force_durable: bool) -> Self
Recreates this egress definition builder with the given force_durable
flag.
Sourcepub fn build(self) -> Result<Egress, EgressError>
pub fn build(self) -> Result<Egress, EgressError>
Finalizes the builder, validates its state, and, assuming valid state,
returns the [Ingress].
In case the exchange name is the name of one of the known built-in RabbitMQ exchanges, some validation is applied on the given values. The built-in exchanges either require a non-empty routing key, or, on the opposite, ignore the routing key. For built-in exchanges, this method will return an error if the given routing key does not match the requirement.