pub struct BulkheadConfigBuilder { /* private fields */ }Expand description
Builder for bulkhead configuration.
Implementations§
Source§impl BulkheadConfigBuilder
impl BulkheadConfigBuilder
Sourcepub fn max_concurrent_calls(self, max: usize) -> Self
pub fn max_concurrent_calls(self, max: usize) -> Self
Sets the maximum number of concurrent calls.
Default: 25
Sourcepub fn max_wait_duration(self, duration: Option<Duration>) -> Self
pub fn max_wait_duration(self, duration: Option<Duration>) -> Self
Sets the maximum time to wait for a permit.
If None, calls will wait indefinitely.
Default: None
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Sets the name of this bulkhead instance.
Default: “bulkhead”
Sourcepub fn on_call_permitted<F>(self, f: F) -> Self
pub fn on_call_permitted<F>(self, f: F) -> Self
Registers a callback for when a call is permitted.
Sourcepub fn on_call_rejected<F>(self, f: F) -> Self
pub fn on_call_rejected<F>(self, f: F) -> Self
Registers a callback for when a call is rejected.
Sourcepub fn on_call_finished<F>(self, f: F) -> Self
pub fn on_call_finished<F>(self, f: F) -> Self
Registers a callback for when a call finishes successfully.
Sourcepub fn on_call_failed<F>(self, f: F) -> Self
pub fn on_call_failed<F>(self, f: F) -> Self
Registers a callback for when a call fails.
Sourcepub fn build(self) -> BulkheadLayer
pub fn build(self) -> BulkheadLayer
Builds the configuration and returns a BulkheadLayer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BulkheadConfigBuilder
impl !RefUnwindSafe for BulkheadConfigBuilder
impl Send for BulkheadConfigBuilder
impl Sync for BulkheadConfigBuilder
impl Unpin for BulkheadConfigBuilder
impl UnsafeUnpin for BulkheadConfigBuilder
impl !UnwindSafe for BulkheadConfigBuilder
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