pub struct Fallback {
pub candidates: Vec<Composable>,
/* private fields */
}Expand description
Fallback chain: try each agent in sequence until one succeeds.
Fields§
§candidates: Vec<Composable>Candidate composables tried in order until one succeeds.
Implementations§
Source§impl Fallback
impl Fallback
Sourcepub fn new(candidates: Vec<Composable>) -> Self
pub fn new(candidates: Vec<Composable>) -> Self
Create a fallback chain from the given candidates.
Sourcepub fn middleware(self, composite: MiddlewareComposite) -> Self
pub fn middleware(self, composite: MiddlewareComposite) -> Self
Attach middleware to the fallback agent (e.g. M::on_fallback(|name| …)),
observed when a fallback branch activates.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fallback
impl !RefUnwindSafe for Fallback
impl Send for Fallback
impl Sync for Fallback
impl Unpin for Fallback
impl !UnwindSafe for Fallback
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