pub struct SourceInfoResult {
source_info: SourceInfo,
errors: Option<SourceInfoErrors>,
}
Expand description
Wraps the outcome of SourceInfo::from_string
.
While building a SourceInfo
from raw SourceInfoContent
, errors as well as deprecation
and linter warnings may be encountered.
In case no errors are encountered, the resulting SourceInfo
may be accessed via
SourceInfoResult::source_info
.
Fields§
§source_info: SourceInfo
§errors: Option<SourceInfoErrors>
Implementations§
Source§impl SourceInfoResult
impl SourceInfoResult
Sourcepub fn source_info(self) -> Result<SourceInfo, Error>
pub fn source_info(self) -> Result<SourceInfo, Error>
Returns the SourceInfo
as long as no critical errors have been encountered.
§Errors
Returns an error if any kind of unrecoverable logic error is encountered, such as missing properties
Sourcepub fn incomplete_source_info(&self) -> &SourceInfo
pub fn incomplete_source_info(&self) -> &SourceInfo
Returns the generated SourceInfo
regardless of whether there’re any errors or not.
§Warning
This SourceInfo struct may be incomplete, could contain invalid information and/or invalid default values!
Only use this if you know what you’re doing and if you want to do stuff like manual auto-correction.
Sourcepub fn lint(self) -> Result<SourceInfo, Error>
pub fn lint(self) -> Result<SourceInfo, Error>
Returns a the SourceInfo
as long as there’re no errors, lints or warnings of any kind.
§Errors
Any kind of error, warning or lint is encountered.
Sourcepub fn errors(&self) -> Option<&SourceInfoErrors>
pub fn errors(&self) -> Option<&SourceInfoErrors>
Gets a reference to the errors of this result.
Trait Implementations§
Source§impl Clone for SourceInfoResult
impl Clone for SourceInfoResult
Source§fn clone(&self) -> SourceInfoResult
fn clone(&self) -> SourceInfoResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more