#[non_exhaustive]pub enum CustomTripleCreateError {
CustomJsonUnavailable,
CustomCfgUnavailable,
DeserializeJson {
triple: String,
input: String,
error: Arc<Error>,
},
ParseCfg {
triple: String,
input: String,
message: String,
line: usize,
},
ConflictingCustomPlatformSources {
triple: String,
},
}Expand description
An error returned while creating a custom platform.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
A custom JSON platform was asked to be created, but the
custom feature is currently disabled.
Currently, this can only happen if a custom platform is
deserialized from a
PlatformSummary.
A custom cfg platform was asked to be created, but the
custom-cfg feature is currently disabled.
Currently, this can only happen if a custom platform is
deserialized from a
PlatformSummary.
DeserializeJson
custom only.An error occurred while deserializing serde data.
Fields
ParseCfg
custom-cfg only.An error occurred while parsing rustc --print=cfg output.
Fields
ConflictingCustomPlatformSources
Both custom_json and custom_cfg were specified for a
platform summary, but only one is allowed.
Implementations§
Source§impl CustomTripleCreateError
impl CustomTripleCreateError
Sourcepub fn input(&self) -> Option<&str>
pub fn input(&self) -> Option<&str>
Returns the provided input that caused the error, if available.
Sourcepub fn input_string(&self) -> Option<&String>
pub fn input_string(&self) -> Option<&String>
A version of Self::input that returns a &String rather than a
&str.
This is a workaround for a miette limitation – &str can’t be cast to
&dyn SourceCode, but &String can.
Sourcepub fn line_and_column(&self) -> Option<(usize, usize)>
pub fn line_and_column(&self) -> Option<(usize, usize)>
Returns the line and column number that caused the error, if available and the error is not an I/O error.
The line and column number are 1-based, though the column number can be 0 if the error occurred between lines.
Sourcepub fn label(&self) -> Option<String>
pub fn label(&self) -> Option<String>
Returns a label suitable for the error message to label at
Self::line_and_column.
This label drops line and column information if available.
Trait Implementations§
Source§impl Clone for CustomTripleCreateError
impl Clone for CustomTripleCreateError
Source§fn clone(&self) -> CustomTripleCreateError
fn clone(&self) -> CustomTripleCreateError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CustomTripleCreateError
impl Debug for CustomTripleCreateError
Source§impl Display for CustomTripleCreateError
impl Display for CustomTripleCreateError
Source§impl Error for CustomTripleCreateError
impl Error for CustomTripleCreateError
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()