pub struct SmartFallbackChain<'a> { /* private fields */ }Expand description
Smart fallback chain orchestrator.
Tries each TransportTarget in order, checking circuit breaker health
before each attempt. Records all attempts in a FallbackNegotiationHistory.
Implementations§
Source§impl<'a> SmartFallbackChain<'a>
impl<'a> SmartFallbackChain<'a>
Sourcepub fn new(
client: &'a Client,
health_tracker: &'a TransportHealthTracker,
per_attempt_timeout: Duration,
total_timeout: Duration,
) -> Self
pub fn new( client: &'a Client, health_tracker: &'a TransportHealthTracker, per_attempt_timeout: Duration, total_timeout: Duration, ) -> Self
Create a new fallback chain.
Sourcepub fn with_stdio(&self, command: String) -> Result<Self, String>
pub fn with_stdio(&self, command: String) -> Result<Self, String>
Enable stdio fallback with the given command.
Sourcepub async fn execute(
&self,
targets: &[TransportTarget],
body: Bytes,
headers: &HeaderMap,
) -> Result<SmartFallbackResult, SmartFallbackError>
pub async fn execute( &self, targets: &[TransportTarget], body: Bytes, headers: &HeaderMap, ) -> Result<SmartFallbackResult, SmartFallbackError>
Execute the fallback chain, trying each target in order.
Auto Trait Implementations§
impl<'a> Freeze for SmartFallbackChain<'a>
impl<'a> !RefUnwindSafe for SmartFallbackChain<'a>
impl<'a> Send for SmartFallbackChain<'a>
impl<'a> Sync for SmartFallbackChain<'a>
impl<'a> Unpin for SmartFallbackChain<'a>
impl<'a> UnsafeUnpin for SmartFallbackChain<'a>
impl<'a> !UnwindSafe for SmartFallbackChain<'a>
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