pub struct RouteDefinition { /* private fields */ }Expand description
An unresolved route definition. “to” URIs have not been resolved to producers yet.
Implementations§
Source§impl RouteDefinition
impl RouteDefinition
Sourcepub fn new(from_uri: impl Into<String>, steps: Vec<BuilderStep>) -> Self
pub fn new(from_uri: impl Into<String>, steps: Vec<BuilderStep>) -> Self
Create a new route definition with the required route ID.
Sourcepub fn steps(&self) -> &[BuilderStep]
pub fn steps(&self) -> &[BuilderStep]
The steps in this route definition.
Sourcepub fn with_error_handler(self, config: ErrorHandlerConfig) -> Self
pub fn with_error_handler(self, config: ErrorHandlerConfig) -> Self
Set a per-route error handler, overriding the global one.
Sourcepub fn with_circuit_breaker(self, config: CircuitBreakerConfig) -> Self
pub fn with_circuit_breaker(self, config: CircuitBreakerConfig) -> Self
Set a circuit breaker for this route.
Sourcepub fn circuit_breaker_config(&self) -> Option<&CircuitBreakerConfig>
pub fn circuit_breaker_config(&self) -> Option<&CircuitBreakerConfig>
Get the circuit breaker config, if set.
Sourcepub fn concurrency_override(&self) -> Option<&ConcurrencyModel>
pub fn concurrency_override(&self) -> Option<&ConcurrencyModel>
User-specified concurrency override, if any.
Sourcepub fn with_concurrency(self, model: ConcurrencyModel) -> Self
pub fn with_concurrency(self, model: ConcurrencyModel) -> Self
Override the consumer’s concurrency model for this route.
Sourcepub fn auto_startup(&self) -> bool
pub fn auto_startup(&self) -> bool
Whether this route should start automatically when the context starts.
Sourcepub fn startup_order(&self) -> i32
pub fn startup_order(&self) -> i32
Order in which routes are started. Lower values start first.
Sourcepub fn with_route_id(self, id: impl Into<String>) -> Self
pub fn with_route_id(self, id: impl Into<String>) -> Self
Set a unique identifier for this route.
Sourcepub fn with_auto_startup(self, auto: bool) -> Self
pub fn with_auto_startup(self, auto: bool) -> Self
Set whether this route should start automatically.
Sourcepub fn with_startup_order(self, order: i32) -> Self
pub fn with_startup_order(self, order: i32) -> Self
Set the startup order. Lower values start first.
Sourcepub fn to_info(&self) -> RouteDefinitionInfo
pub fn to_info(&self) -> RouteDefinitionInfo
Extract the metadata fields needed for introspection. This is used by RouteController to store route info without the non-Sync steps.