Enum BookPnlError
#[non_exhaustive]pub enum BookPnlError {
AcrossDays {
from: NaiveDate,
to: NaiveDate,
},
Backward {
from: NaiveDate,
to: NaiveDate,
},
NothingToRoll {
as_of: NaiveDate,
},
Pricing(PricingError),
Snapshot(SnapshotError),
Pnl(PnlError),
}Expand description
A book’s P&L that could not be produced.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
AcrossDays
The two dates differ, for a P&L that is only taken within one day:
the prediction and the reset P&L. Book::explain_pnl takes the cash
and carry/roll legs across days.
Backward
The ending date is before the starting one.
NothingToRoll
The snapshot at the starting date was not fetched, so there are no quotes to rebuild at the ending date for the carry leg.
Pricing(PricingError)
The book’s market holds no snapshot at the starting date.
Snapshot(SnapshotError)
The fetch of the ending snapshot failed.
Pnl(PnlError)
The attribution itself failed.
Trait Implementations§
§impl Clone for BookPnlError
impl Clone for BookPnlError
§fn clone(&self) -> BookPnlError
fn clone(&self) -> BookPnlError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for BookPnlError
impl Debug for BookPnlError
§impl Display for BookPnlError
impl Display for BookPnlError
§impl Error for BookPnlError
impl Error for BookPnlError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
§impl From<PnlError> for BookPnlError
impl From<PnlError> for BookPnlError
§impl From<PricingError> for BookPnlError
impl From<PricingError> for BookPnlError
§fn from(e: PricingError) -> Self
fn from(e: PricingError) -> Self
Converts to this type from the input type.
§impl From<SnapshotError> for BookPnlError
impl From<SnapshotError> for BookPnlError
§fn from(e: SnapshotError) -> Self
fn from(e: SnapshotError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for BookPnlError
impl RefUnwindSafe for BookPnlError
impl Send for BookPnlError
impl Sync for BookPnlError
impl Unpin for BookPnlError
impl UnsafeUnpin for BookPnlError
impl UnwindSafe for BookPnlError
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