#[non_exhaustive]pub enum GraphError {
Show 20 variants
Render(String),
Io(Error),
Curve(CurveError),
Surface(SurfaceError),
Decimal(Box<DecimalError>),
Backtest(Box<BacktestError>),
InvalidDimensions {
width: u32,
height: u32,
},
TooSmall {
width: u32,
height: u32,
min_width: u32,
min_height: u32,
},
NoRoom {
width: u32,
height: u32,
},
InvalidLineWidth {
name: String,
width: f64,
},
LengthMismatch {
name: String,
x: usize,
y: usize,
},
SurfaceLengthMismatch {
name: String,
x: usize,
y: usize,
z: usize,
},
DegenerateSurface {
name: String,
columns: usize,
rows: usize,
},
DuplicateSurfacePoint {
name: String,
x: Decimal,
y: Decimal,
},
IncompleteSurface {
name: String,
expected: usize,
found: usize,
},
NotRepresentable(Decimal),
InvalidColor {
color: String,
reason: String,
},
MissingGlyph {
character: char,
code: u32,
text: String,
},
NotXmlText {
character: char,
code: u32,
text: String,
},
UnsupportedText(String),
}Expand description
Represents errors that can occur during graph generation and rendering operations.
This error type encapsulates failures that may happen when creating, rendering, or saving graphical representations of financial data such as option chains, volatility surfaces, or strategy payoffs.
The PNG and SVG export (static_export) reports data it cannot draw
faithfully with its own variants rather than repairing it: a surface
with missing or repeated grid points, series whose coordinate arrays
differ in length, a colour or a label character it cannot reproduce.
The enum is #[non_exhaustive]: match it with a wildcard arm, since
later releases may add variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Render(String)
Represents errors that occur during the rendering process. Contains a descriptive message about what went wrong.
Io(Error)
Represents I/O errors that occur when reading from or writing to files (e.g., when saving graphs to disk).
Curve(CurveError)
Error from curve operations.
Surface(SurfaceError)
Error from surface operations.
Decimal(Box<DecimalError>)
A figure a report derives for display (a total, an average) left the
representable Decimal range.
Backtest(Box<BacktestError>)
The backtest figures a report shows could not be computed, for
example when the statistics of a SimulationStats accumulator
overflow Decimal.
InvalidDimensions
The configured figure width or height is zero or larger than the 16384 pixels the static export draws.
TooSmall
The figure is too small to lay the chart out.
Fields
NoRoom
The title, legend or colour bar leave no pixels to draw the chart in.
InvalidLineWidth
A line width is not a finite number of pixels between 0 and 100.
LengthMismatch
A 2D series has a different number of x and y values. Plotly drew the shorter length; the static export does not drop points.
SurfaceLengthMismatch
A surface has a different number of x, y and z values.
Fields
DegenerateSurface
A surface needs at least two distinct x and two distinct y values.
Fields
DuplicateSurfacePoint
A surface grid point appears more than once. Plotly kept the last value; the static export does not choose.
Fields
IncompleteSurface
A surface grid point is missing: expected is distinct x times
distinct y, found the number of points given. Plotly filled the
gaps with zero; the static export does not invent values.
Fields
NotRepresentable(Decimal)
A value has no f64 representation for drawing.
InvalidColor
A colour string is none of the CSS Color 4 forms the static export
accepts: a named colour, #rgb, #rgba, #rrggbb, #rrggbbaa,
rgb()/rgba() or hsl()/hsla().
MissingGlyph
A label uses a character the bundled font has no glyph for. The static export never substitutes or drops it.
Fields
NotXmlText
A label, or the chart title or description an SVG carries, contains a character XML 1.0 cannot represent: a C0 control other than tab, line feed and carriage return, U+FFFE or U+FFFF.
Fields
UnsupportedText(String)
Text the static export cannot draw: a font style other than the bundled regular face, or SVG text outside the form it converts.
Trait Implementations§
Source§impl Debug for GraphError
impl Debug for GraphError
Source§impl Display for GraphError
impl Display for GraphError
Source§impl Error for GraphError
impl Error for GraphError
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
use the Display impl or to_string()
Source§impl From<BacktestError> for GraphError
impl From<BacktestError> for GraphError
Source§fn from(err: BacktestError) -> Self
fn from(err: BacktestError) -> Self
Source§impl From<CurveError> for GraphError
impl From<CurveError> for GraphError
Source§fn from(err: CurveError) -> Self
fn from(err: CurveError) -> Self
Source§impl From<DecimalError> for GraphError
impl From<DecimalError> for GraphError
Source§fn from(err: DecimalError) -> Self
fn from(err: DecimalError) -> Self
Source§impl From<Error> for GraphError
impl From<Error> for GraphError
Source§impl From<SurfaceError> for GraphError
impl From<SurfaceError> for GraphError
Source§fn from(err: SurfaceError) -> Self
fn from(err: SurfaceError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for GraphError
impl !UnwindSafe for GraphError
impl Freeze for GraphError
impl Send for GraphError
impl Sync for GraphError
impl Unpin for GraphError
impl UnsafeUnpin for GraphError
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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.