pub enum Outcome {
NoError,
OverrideNoForce(String),
RequiredFileFromSubsystemNonexistant {
subsys: &'static str,
fname: String,
},
RequiredDataFromSubsystemNonexistant {
subsys: &'static str,
desc: String,
},
TwitterAPIError(String),
FileParsingFailed {
desc: &'static str,
errors: Vec<String>,
},
}
Enum representing all possible values the application can fail.
No errors occured, everything executed correctly.
The specified file would need to be overriden but was not allowed to.
The specified subsystem needs to be run beforehand to produce the specified file.
Fields of RequiredFileFromSubsystemNonexistant
subsys: &'static str | The subsystem that needs to be run.
|
fname: String | The file the specified subsystem produces.
|
The specified subsystem needs to be run beforehand to produce the specified data.
Fields of RequiredDataFromSubsystemNonexistant
subsys: &'static str | The subsystem that needs to be run.
|
desc: String | The description of what needs to be produced.
|
The Twitter API returned an error.
Failed to parse the specified file because of the specified errors.
Fields of FileParsingFailed
desc: &'static str | The file that failed to parse.
|
errors: Vec<String> | The parsing errors that occured.
|
Get the executable exit value from an Outcome
instance.
let mut out = Vec::new();
Outcome::OverrideNoForce("doctest".to_string()).print_error(&mut out);
assert_eq!(String::from_iter(out.iter().map(|&i| i as char)),
"File \"doctest\" was not overriden to prevent data loss.\n\
Pass --force to override it.\n".to_string());
Get the executable exit value from an Outcome
instance.
exit(Outcome::NoError.exit_value());
Performs copy-assignment from source
. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Get the TypeId
of this object.