pub struct StrategyDecision { /* private fields */ }Expand description
The decision made by a strategy, containing multiple possible actions.
Implementations§
Source§impl StrategyDecision
impl StrategyDecision
Sourcepub fn single(action: StrategyAction) -> Self
pub fn single(action: StrategyAction) -> Self
Creates a decision with a single action.
Sourcepub fn hold_with_reason(reason: impl Into<String>) -> Self
pub fn hold_with_reason(reason: impl Into<String>) -> Self
Creates a hold decision with a reason.
Sourcepub fn add_action(&mut self, action: StrategyAction)
pub fn add_action(&mut self, action: StrategyAction)
Adds an action to the decision.
Sourcepub fn with_reason(self, reason: impl Into<String>) -> Self
pub fn with_reason(self, reason: impl Into<String>) -> Self
Sets the reason for the decision.
Sourcepub fn actions(&self) -> &[StrategyAction]
pub fn actions(&self) -> &[StrategyAction]
Returns the actions.
Sourcepub fn is_hold(&self) -> bool
pub fn is_hold(&self) -> bool
Checks if this is a hold decision (no actions or only hold actions).
Sourcepub fn action_count(&self) -> usize
pub fn action_count(&self) -> usize
Returns the number of actions.
Trait Implementations§
Source§impl Clone for StrategyDecision
impl Clone for StrategyDecision
Source§impl Debug for StrategyDecision
impl Debug for StrategyDecision
Auto Trait Implementations§
impl Forget for StrategyDecision
impl Freeze for StrategyDecision
impl Move for StrategyDecision
impl RefUnwindSafe for StrategyDecision
impl Send for StrategyDecision
impl Sync for StrategyDecision
impl Unpin for StrategyDecision
impl UnsafeUnpin for StrategyDecision
impl UnwindSafe for StrategyDecision
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