pub struct FirstOf(pub Vec<Arc<dyn TurnPolicy>>);Expand description
Every policy in turn; the first one that says stop wins.
The second implementation, and the shape a host actually wants: adding a ceiling of your own should not mean reimplementing the engine’s. A stop is never overridden by a later policy — a policy that could veto another’s stop would make “add a limit” mean “hope nobody added a looser one”.
Tuple Fields§
§0: Vec<Arc<dyn TurnPolicy>>Trait Implementations§
Source§impl TurnPolicy for FirstOf
impl TurnPolicy for FirstOf
Source§fn before_model_call(&self, progress: &TurnProgress<'_>) -> TurnStep
fn before_model_call(&self, progress: &TurnProgress<'_>) -> TurnStep
Before spending another model call.
Source§fn after_model_call(&self, progress: &TurnProgress<'_>) -> TurnStep
fn after_model_call(&self, progress: &TurnProgress<'_>) -> TurnStep
After a model call came back, before acting on what it asked for. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for FirstOf
impl !UnwindSafe for FirstOf
impl Forget for FirstOf
impl Freeze for FirstOf
impl Move for FirstOf
impl Send for FirstOf
impl Sync for FirstOf
impl Unpin for FirstOf
impl UnsafeUnpin for FirstOf
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