#[non_exhaustive]pub enum PlotError {
Show 15 variants
InvalidRange {
min: f64,
max: f64,
message: &'static str,
suggestion: &'static str,
},
LogScaleNonPositive {
value: f64,
suggestion: &'static str,
},
EmptyFigure {
suggestion: &'static str,
},
UnsupportedFormat {
path: String,
suggestion: &'static str,
},
Io {
message: String,
suggestion: &'static str,
},
Render {
message: String,
suggestion: &'static str,
},
Text {
message: String,
suggestion: &'static str,
},
LengthMismatch {
x_len: usize,
y_len: usize,
suggestion: &'static str,
},
HeatmapSizeMismatch {
nrows: usize,
ncols: usize,
expected: usize,
got: usize,
suggestion: &'static str,
},
ColumnNotFound {
name: String,
suggestion: &'static str,
},
ColumnNotNumeric {
name: String,
dtype: String,
suggestion: &'static str,
},
LatexUnavailable {
message: String,
suggestion: &'static str,
},
LatexFailed {
message: String,
suggestion: &'static str,
},
ExternalToolUnavailable {
tool: &'static str,
message: String,
suggestion: &'static str,
},
ExternalToolFailed {
tool: &'static str,
message: String,
suggestion: &'static str,
},
}Expand description
Library-wide error type. Every variant carries a human/agent-readable suggestion.
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.
InvalidRange
LogScaleNonPositive
EmptyFigure
UnsupportedFormat
Io
Render
Text
LengthMismatch
HeatmapSizeMismatch
ColumnNotFound
ColumnNotNumeric
LatexFailed
ExternalToolFailed
Implementations§
Source§impl PlotError
impl PlotError
pub fn invalid_range(min: f64, max: f64) -> Self
pub fn log_non_positive(value: f64) -> Self
pub fn empty_figure() -> Self
pub fn unsupported_format(path: impl Into<String>) -> Self
pub fn io(message: impl Into<String>) -> Self
pub fn render(message: impl Into<String>) -> Self
pub fn text(message: impl Into<String>) -> Self
pub fn length_mismatch(x_len: usize, y_len: usize) -> Self
pub fn heatmap_size_mismatch(nrows: usize, ncols: usize, got: usize) -> Self
pub fn column_not_found(name: impl Into<String>) -> Self
pub fn column_not_numeric( name: impl Into<String>, dtype: impl Into<String>, ) -> Self
pub fn latex_failed(message: impl Into<String>) -> Self
pub fn external_tool_failed( tool: &'static str, message: impl Into<String>, ) -> Self
Sourcepub fn suggestion(&self) -> &str
pub fn suggestion(&self) -> &str
Extract the agent-facing fix hint from any error variant.
Trait Implementations§
Source§impl Error for PlotError
impl Error for PlotError
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 StructuralPartialEq for PlotError
Auto Trait Implementations§
impl Freeze for PlotError
impl RefUnwindSafe for PlotError
impl Send for PlotError
impl Sync for PlotError
impl Unpin for PlotError
impl UnsafeUnpin for PlotError
impl UnwindSafe for PlotError
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