pub struct ResolveError {
pub detail: String,
pub file: Option<String>,
pub line: Option<u32>,
pub column: Option<u32>,
}Expand description
A failure of a PackageResolver that recognized a package name but could
not produce the package’s factory (for example, an unreadable file or a
malformed definition): what failed and, for a failure in a file, where.
A resolver that has no package of that name returns Ok(None) instead; that
is not a failure.
§Examples
use flm_core::core::registry::ResolveError;
let error = ResolveError::new("the file is not valid YAML").in_file("mystyle.yaml").at(3, 5);
assert_eq!((error.line, error.column), (Some(3), Some(5)));Fields§
§detail: StringWhat failed, as text for a person to read.
file: Option<String>The file the failure is in, written the way the resolver shows files to a person, when the failure is in a file.
line: Option<u32>The line in that file, counted from 1, when known.
column: Option<u32>The column in that line, counted from 1, when known.
Implementations§
Source§impl ResolveError
impl ResolveError
Sourcepub fn new(detail: impl Into<String>) -> ResolveError
pub fn new(detail: impl Into<String>) -> ResolveError
The failure detail, not located in any file.
Sourcepub fn in_file(self, file: impl Into<String>) -> ResolveError
pub fn in_file(self, file: impl Into<String>) -> ResolveError
The same failure, located in the file file. Returns self, for
chaining.
Sourcepub fn at(self, line: u32, column: u32) -> ResolveError
pub fn at(self, line: u32, column: u32) -> ResolveError
The same failure, located at line and column (both counted from 1)
of its file. Returns self, for chaining.
Trait Implementations§
Source§impl Clone for ResolveError
impl Clone for ResolveError
Source§impl Debug for ResolveError
impl Debug for ResolveError
Source§impl Display for ResolveError
impl Display for ResolveError
impl Eq for ResolveError
Source§impl Error for ResolveError
impl Error for ResolveError
1.30.0 · 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()
Source§impl PartialEq for ResolveError
impl PartialEq for ResolveError
impl StructuralPartialEq for ResolveError
Auto Trait Implementations§
impl Forget for ResolveError
impl Freeze for ResolveError
impl Move for ResolveError
impl RefUnwindSafe for ResolveError
impl Send for ResolveError
impl Sync for ResolveError
impl Unpin for ResolveError
impl UnsafeUnpin for ResolveError
impl UnwindSafe for ResolveError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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