pub enum Error {
Show 19 variants
ContractNotFound {
symbol: String,
},
ExpirationNotFound {
expiration: String,
},
StrikeNotFound {
strike: u64,
},
UnderlyingNotFound {
underlying: String,
},
NoDataAvailable {
message: String,
},
OrderBookError {
message: String,
},
PricingError {
message: String,
},
GreeksError {
message: String,
},
InventoryLimitExceeded {
limit_type: String,
limit: Decimal,
current: Decimal,
},
RiskLimitBreached {
limit_type: String,
},
HedgingError {
message: String,
},
QuotingError {
message: String,
},
MarketDataError {
message: String,
},
AdapterError {
exchange: String,
message: String,
},
ConfigurationError {
message: String,
},
ValidationError {
message: String,
},
SerializationError(Error),
DecimalError {
message: String,
},
OptionStratLibDecimal(DecimalError),
}Expand description
Main error type for the Option-Chain-OrderBook library.
Variants§
ContractNotFound
Error when an option contract is not found.
ExpirationNotFound
Error when an expiration date is not found.
StrikeNotFound
Error when a strike price is not found.
UnderlyingNotFound
Error when an underlying is not found.
NoDataAvailable
Error when no data is available.
OrderBookError
Error when an order book operation fails.
PricingError
Error when pricing calculation fails.
GreeksError
Error when Greeks calculation fails.
InventoryLimitExceeded
Error when inventory limits are exceeded.
Fields
RiskLimitBreached
Error when risk limits are breached.
HedgingError
Error when hedging operation fails.
QuotingError
Error when quote generation fails.
MarketDataError
Error when market data is invalid or missing.
AdapterError
Error when exchange adapter operation fails.
Fields
ConfigurationError
Error when configuration is invalid.
ValidationError
Error when a validation check fails.
SerializationError(Error)
Error when serialization/deserialization fails.
DecimalError
Error when a decimal conversion fails.
OptionStratLibDecimal(DecimalError)
Error from optionstratlib decimal operations.
Implementations§
Source§impl Error
impl Error
Sourcepub fn contract_not_found(symbol: impl Into<String>) -> Self
pub fn contract_not_found(symbol: impl Into<String>) -> Self
Creates a new contract not found error.
Sourcepub fn expiration_not_found(expiration: impl Into<String>) -> Self
pub fn expiration_not_found(expiration: impl Into<String>) -> Self
Creates a new expiration not found error.
Sourcepub fn strike_not_found(strike: u64) -> Self
pub fn strike_not_found(strike: u64) -> Self
Creates a new strike not found error.
Sourcepub fn underlying_not_found(underlying: impl Into<String>) -> Self
pub fn underlying_not_found(underlying: impl Into<String>) -> Self
Creates a new underlying not found error.
Sourcepub fn inventory_limit_exceeded(
limit_type: impl Into<String>,
limit: Decimal,
current: Decimal,
) -> Self
pub fn inventory_limit_exceeded( limit_type: impl Into<String>, limit: Decimal, current: Decimal, ) -> Self
Creates a new inventory limit exceeded error.
Sourcepub fn risk_limit_breached(limit_type: impl Into<String>) -> Self
pub fn risk_limit_breached(limit_type: impl Into<String>) -> Self
Creates a new risk limit breached error.
Sourcepub fn market_data(message: impl Into<String>) -> Self
pub fn market_data(message: impl Into<String>) -> Self
Creates a new market data error.
Sourcepub fn adapter(exchange: impl Into<String>, message: impl Into<String>) -> Self
pub fn adapter(exchange: impl Into<String>, message: impl Into<String>) -> Self
Creates a new adapter error.
Sourcepub fn configuration(message: impl Into<String>) -> Self
pub fn configuration(message: impl Into<String>) -> Self
Creates a new configuration error.
Sourcepub fn validation(message: impl Into<String>) -> Self
pub fn validation(message: impl Into<String>) -> Self
Creates a new validation error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<DecimalError> for Error
impl From<DecimalError> for Error
Source§fn from(source: DecimalError) -> Self
fn from(source: DecimalError) -> Self
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.