pub struct UnitOfWorkConfig {
pub on_complete: Option<String>,
pub on_failure: Option<String>,
}Expand description
Per-route Unit of Work configuration.
When present on a RouteDefinition, wraps the route’s Tower pipeline with
an ExchangeUoWLayer that tracks in-flight exchanges and fires optional
completion hooks.
The Default implementation yields { on_complete: None, on_failure: None },
which is semantically equivalent to “no UoW behaviour”. A RouteDefinition
only gains UoW overhead when unit_of_work is Some(config) — a default
config wrapped in Some will still install the layer (with no hooks).
Fields§
§on_complete: Option<String>URI of the producer to call when an exchange completes successfully.
Example: "log:on-complete"
on_failure: Option<String>URI of the producer to call when an exchange fails
(inner pipeline returned Err(_) or exchange.has_error() is true).
Example: "log:on-failure"
Trait Implementations§
Source§impl Clone for UnitOfWorkConfig
impl Clone for UnitOfWorkConfig
Source§fn clone(&self) -> UnitOfWorkConfig
fn clone(&self) -> UnitOfWorkConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnitOfWorkConfig
impl Debug for UnitOfWorkConfig
Source§impl Default for UnitOfWorkConfig
impl Default for UnitOfWorkConfig
Source§fn default() -> UnitOfWorkConfig
fn default() -> UnitOfWorkConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UnitOfWorkConfig
impl<'de> Deserialize<'de> for UnitOfWorkConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for UnitOfWorkConfig
impl RefUnwindSafe for UnitOfWorkConfig
impl Send for UnitOfWorkConfig
impl Sync for UnitOfWorkConfig
impl Unpin for UnitOfWorkConfig
impl UnsafeUnpin for UnitOfWorkConfig
impl UnwindSafe for UnitOfWorkConfig
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