pub struct FallbackChain<N> { /* private fields */ }Expand description
Tries each strategy in order until one returns a result.
Unlike WithFallback (which is generic and zero-cost), FallbackChain uses
trait objects — suitable when the strategy list is built at runtime.
Implementations§
Trait Implementations§
Source§impl<N> Debug for FallbackChain<N>
impl<N> Debug for FallbackChain<N>
Source§impl<N> Strategy<N> for FallbackChain<N>
impl<N> Strategy<N> for FallbackChain<N>
Source§fn select(&self, candidates: &[N], ctx: &SelectionContext) -> Option<usize>
fn select(&self, candidates: &[N], ctx: &SelectionContext) -> Option<usize>
Pick the next node. Returns
None when candidates is empty or all
candidates are excluded via SelectionContext::exclude.Auto Trait Implementations§
impl<N> Freeze for FallbackChain<N>
impl<N> !RefUnwindSafe for FallbackChain<N>
impl<N> Send for FallbackChain<N>
impl<N> Sync for FallbackChain<N>
impl<N> Unpin for FallbackChain<N>
impl<N> UnsafeUnpin for FallbackChain<N>
impl<N> !UnwindSafe for FallbackChain<N>
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