apple-quant-algorithmic 0.3.0

Apple Quant's algorithmic library.
use apple_quant_core::{AddReleaseUnchecked, SubReleaseUnchecked};

use crate::volume::FromVolumeTypeError;

use super::Zeroable;

pub trait ZeroableVolume:
	  AddReleaseUnchecked<Self, Self, Result<Self, FromVolumeTypeError>>
	+ SubReleaseUnchecked<Self, Self, Result<Self, FromVolumeTypeError>>
	+ std::fmt::Debug
	+ Clone
	+ Copy
	+ PartialEq
	+ Eq
	+ PartialOrd
	+ Ord
where
	Self: Into<Result<Self, FromVolumeTypeError>>,
{
	const ZERO: Self;

	fn is_zero(
		&self,
	) -> bool;

	fn as_zeroable(
		&self,
	) -> Zeroable<Self> {
		Zeroable::from_zeroable(*self)
	}

	fn into_zeroable(
		self,
	) -> Zeroable<Self> {
		Zeroable::from_zeroable(self)
	}
}