apple-quant-algorithmic 0.3.0

Apple Quant's algorithmic library.
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
pub enum StateGoal {
	#[default]
	None,
	CancelAll,
	CancelFlattenAll,
	CancelFlattenAllShutdown,
	CancelFlattenAllRestart,
}

impl StateGoal {
	pub fn as_result(
		&self,
	) -> StateGoalResult {
		match self {
			Self::None => StateGoalResult::Active,
			Self::CancelAll => StateGoalResult::Inactive,
			Self::CancelFlattenAll => StateGoalResult::Inactive,
			Self::CancelFlattenAllShutdown => StateGoalResult::Shutdown,
			Self::CancelFlattenAllRestart => StateGoalResult::Restart,
		}
	}
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum StateGoalResult {
	Active,
	Inactive,
	Shutdown,
	Restart,
}