pub enum OutputError {
IoError {
path: PathBuf,
source: Error,
},
SerializationError {
entity: String,
message: String,
},
SchemaError {
file: String,
column: String,
message: String,
},
ManifestError {
manifest_type: String,
message: String,
},
}Expand description
Errors that can occur during output writing operations.
§Examples
use cobre_io::OutputError;
use std::path::PathBuf;
let err = OutputError::SchemaError {
file: "convergence.parquet".to_string(),
column: "iteration".to_string(),
message: "column type mismatch".to_string(),
};
assert!(err.to_string().contains("convergence.parquet"));
assert!(err.to_string().contains("iteration"));Variants§
IoError
Filesystem I/O failure (read or write) — the variant is shared by the checkpoint reader and the output writers, so the wording is direction-neutral.
Fields
SerializationError
Arrow/Parquet encoding failure.
Fields
SchemaError
Parquet schema validation failure.
Fields
ManifestError
Manifest construction failure.
Implementations§
Source§impl OutputError
impl OutputError
Sourcepub fn io(path: impl AsRef<Path>, source: Error) -> Self
pub fn io(path: impl AsRef<Path>, source: Error) -> Self
Construct an OutputError::IoError from a path and source error.
§Examples
use cobre_io::OutputError;
use std::io;
let io_err = io::Error::new(io::ErrorKind::NotFound, "no such file");
let err = OutputError::io("simulation/costs/data.parquet", io_err);
assert!(err.to_string().contains("simulation/costs/data.parquet"));Sourcepub fn serialization(
entity: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn serialization( entity: impl Into<String>, message: impl Into<String>, ) -> Self
Construct an OutputError::SerializationError with entity context and a message.
§Examples
use cobre_io::OutputError;
let err = OutputError::serialization("hydros", "unsupported field type");
assert!(err.to_string().contains("hydros"));
assert!(err.to_string().contains("unsupported field type"));Trait Implementations§
Source§impl Debug for OutputError
impl Debug for OutputError
Source§impl Display for OutputError
impl Display for OutputError
Source§impl Error for OutputError
impl Error for OutputError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for OutputError
impl !UnwindSafe for OutputError
impl Freeze for OutputError
impl Send for OutputError
impl Sync for OutputError
impl Unpin for OutputError
impl UnsafeUnpin for OutputError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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 more