#[repr(u8)]pub enum AsianAveragingType {
Arithmetic = 0,
Geometric = 1,
}Expand description
Describes how the average price is calculated for Asian options.
§Examples
use option_type::AsianAveragingType;
let avg = AsianAveragingType::Arithmetic;
assert_eq!(format!("{avg}"), "Arithmetic Averaging");Variants§
Arithmetic = 0
Arithmetic averaging sums all observed prices and divides by the number of observations.
Geometric = 1
Geometric averaging takes the nth root of the product of n observed prices.
Implementations§
Source§impl AsianAveragingType
impl AsianAveragingType
Sourcepub const fn is_arithmetic(&self) -> bool
pub const fn is_arithmetic(&self) -> bool
Returns true if this is Arithmetic averaging.
Sourcepub const fn is_geometric(&self) -> bool
pub const fn is_geometric(&self) -> bool
Returns true if this is Geometric averaging.
Trait Implementations§
Source§impl Clone for AsianAveragingType
impl Clone for AsianAveragingType
Source§fn clone(&self) -> AsianAveragingType
fn clone(&self) -> AsianAveragingType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AsianAveragingType
impl Debug for AsianAveragingType
Source§impl<'de> Deserialize<'de> for AsianAveragingType
impl<'de> Deserialize<'de> for AsianAveragingType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for AsianAveragingType
impl Display for AsianAveragingType
Source§impl Hash for AsianAveragingType
impl Hash for AsianAveragingType
Source§impl PartialEq for AsianAveragingType
impl PartialEq for AsianAveragingType
Source§impl Serialize for AsianAveragingType
impl Serialize for AsianAveragingType
impl Copy for AsianAveragingType
impl Eq for AsianAveragingType
impl StructuralPartialEq for AsianAveragingType
Auto Trait Implementations§
impl Freeze for AsianAveragingType
impl RefUnwindSafe for AsianAveragingType
impl Send for AsianAveragingType
impl Sync for AsianAveragingType
impl Unpin for AsianAveragingType
impl UnsafeUnpin for AsianAveragingType
impl UnwindSafe for AsianAveragingType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.