pub enum EpochError {
Show 40 variants
ConfigRead(Error),
ConfigWrite(Error),
ConfigCreation(String, Error),
AlreadyInitialized {
advice: Option<String>,
},
FolderNotEmpty {
name: String,
show_label: Option<(usize, usize)>,
},
EpochInfoParse(EpochId, PathBuf, Error),
EpochInfoWrite {
id: EpochId,
path: PathBuf,
help: Option<String>,
src: Option<Error>,
},
EpochNotFound(String),
AmbiguousTag(String),
EpochFolderMissing(EpochId, PathBuf),
FutureEpochExist,
EpochAlreadyExists(EpochId),
SwitchPastEpoch(EpochId),
InvalidEpochId(EpochId),
TagAlreadyExists(EpochId, String),
ParentEpochMissing(EpochId, EpochId),
Io {
source: Error,
help: Option<String>,
error_line: u32,
},
Serde {
source: Error,
file_name: String,
version: String,
},
TreeInvalid(EpochId, String),
MainFolderInvalid(String),
ParsingEpochId(ParseIntError),
LoadingEpochId(EpochId),
Unknown(String),
UnknownStatAcronim(String),
IllFormedStatQualifier(String),
UserError(UserErrors),
RNGPickError {
cause: String,
help: Option<String>,
},
EpochHashingImpossible(&'static str, u32),
EntityNotFoundById(EntityIdentifier, Option<EntityType>),
EntityNotFound(EntityType, Option<EntityIdentifier>),
UniformRngCreation(Error),
InvalidPositionFormat(String),
ParsePositionError(String),
TableStringConversionError {
name: String,
id: Uuid,
},
ParsingDuration(&'static str, String),
ParsingBounds(&'static str, String),
EmptyIdentifier,
EntityAlreadyExist(Option<EntityIdentifier>),
ParsingArgument {
argument_parsed: String,
while_parsing: &'static str,
},
IncorrectArgumentCombinaison {
category: &'static str,
e_type: EntityType,
advice: Option<String>,
},
}Expand description
All errors that can occur while working with epochs.
The enum is deliberately small - each variant is self-contained and carries the information you need to surface a friendly message to the user (and to the test-suite).
Variants§
ConfigRead(Error)
Problems with the .epochconfig file.
ConfigWrite(Error)
Failed to write the epoch configuration.
ConfigCreation(String, Error)
Failed to create the epoch configuration.
AlreadyInitialized
This directory is already an epoch folder and thus cannot be initialized.
FolderNotEmpty
This directory isn’t empty and thus cannot be initialized.
Fields
EpochInfoParse(EpochId, PathBuf, Error)
Problems while serialising / deserialising an EpochInfo.
EpochInfoWrite
Failed to write .epochinfo in epoch {id} ({path}).
Fields
EpochNotFound(String)
The user supplied an epoch id or tag that does not exist.
AmbiguousTag(String)
The user attempted to resolve an epoch that is ambiguous.
EpochFolderMissing(EpochId, PathBuf)
The epoch folder for the target id is missing.
FutureEpochExist
A future epoch exists, forbidding you to compute next and overriding them.
EpochAlreadyExists(EpochId)
A specific epoch exists, forbidding the further execution of the command.
SwitchPastEpoch(EpochId)
Attempt to switch to an epoch that has already been advanced past.
InvalidEpochId(EpochId)
The supplied epoch id is out of bounds (negative, zero or too large).
TagAlreadyExists(EpochId, String)
A tag that the user tried to assign already exists.
ParentEpochMissing(EpochId, EpochId)
The parent epoch referenced in an EpochInfo cannot be found.
Io
Generic I/O errors that bubble up from other sub-tasks.
Fields
Serde
Serialization / deserialization errors that are not caught above.
Fields
TreeInvalid(EpochId, String)
The epoch tree is in an incorrect state.
MainFolderInvalid(String)
The main folder is not an epoch folder.
ParsingEpochId(ParseIntError)
Couldn’t parse an EpochId.
LoadingEpochId(EpochId)
Impossible to load the given epoch
Unknown(String)
Any other error that didn’t fit into the above categories.
UnknownStatAcronim(String)
The user tried to parse an acronim that doen’t match any stats known to the system.
IllFormedStatQualifier(String)
The user gave a stat:identifier pair that was incorrect
UserError(UserErrors)
User error, meant to be very explicit over what happened and what to do.
RNGPickError
An error happened when picking a rng event
EpochHashingImpossible(&'static str, u32)
A non-recoverable error while hashing an epoch identifier.
This error should never happen in normal operation. It is surfaced only when the hashing routine fails to produce a unique identifier for a given epoch index.
EntityNotFoundById(EntityIdentifier, Option<EntityType>)
The entity with id {0} could not be found.
EntityNotFound(EntityType, Option<EntityIdentifier>)
The entity could not be found
UniformRngCreation(Error)
The requested uniform RNG could not be created because the supplied distribution parameters were invalid.
InvalidPositionFormat(String)
The string did not contain exactly two comma-separated values.
ParsePositionError(String)
One of the components failed to parse as an isize.
TableStringConversionError
Failed to render a table into its string representation.
Fields
ParsingDuration(&'static str, String)
Failed to parse a duration string.
ParsingBounds(&'static str, String)
Failed to parse a bounds string.
EmptyIdentifier
The value started with @ but the remainder was not a valid id or the name was empty.
EntityAlreadyExist(Option<EntityIdentifier>)
The entity already exists.
ParsingArgument
The argument could not be parsed.
Fields
IncorrectArgumentCombinaison
Indicates that the user supplied mutually‑exclusive arguments.
The command line parser accepts a number of optional arguments that belong to
argument groups – e.g. --force, --dry-run, --verbose, etc.
Some of these groups are incompatible with each other. If the user
specifies an argument from one group together with an argument from a
conflicting group, this error is returned.
Trait Implementations§
Source§impl Debug for EpochError
impl Debug for EpochError
Source§impl Diagnostic for EpochError
impl Diagnostic for EpochError
Source§fn code(&self) -> Option<Box<dyn Display + '_>>
fn code(&self) -> Option<Box<dyn Display + '_>>
Diagnostic. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz) is recommended, but more classic codes like
E0123 or enums will work just fine.Source§fn help(&self) -> Option<Box<dyn Display + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
Diagnostic. Do you have any
advice for the poor soul who’s just run into this issue?Source§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic’s Diagnostic::source_codeSource§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic’s Diagnostic::labels to.Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandlers to change the display format
of this diagnostic. Read moreSource§fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
Diagnostic.Diagnostics.Source§fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
Source§impl Display for EpochError
impl Display for EpochError
Source§impl Error for EpochError
impl Error for EpochError
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<Error> for EpochError
impl From<Error> for EpochError
Source§impl From<ParseIntError> for EpochError
impl From<ParseIntError> for EpochError
Source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Auto Trait Implementations§
impl Freeze for EpochError
impl !RefUnwindSafe for EpochError
impl Send for EpochError
impl Sync for EpochError
impl Unpin for EpochError
impl !UnwindSafe for EpochError
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> Cell for Twhere
T: Display,
impl<T> Cell for Twhere
T: Display,
Source§fn cell(self) -> CellStruct
fn cell(self) -> CellStruct
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more