#[non_exhaustive]pub enum VarExpandError {
MissingVariable {
name: String,
offset: usize,
},
InvalidVariableName {
got: String,
offset: usize,
},
UnclosedBraceExpansion {
offset: usize,
},
UnclosedPercentExpansion {
offset: usize,
},
EmptyBraceExpansion {
offset: usize,
},
}Expand description
Errors produced by crate::vars::expand.
Each variant is designed to be self-describing when rendered through
Display (via thiserror), so eprintln!("{err}") is sufficient for a
CLI diagnostic. The offset field always points at the first byte of the
offending placeholder ($, ${, or %), never inside it.
Marked #[non_exhaustive] so new diagnostic variants can land without
breaking external match sites.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingVariable
A well-formed placeholder referenced a variable name that was not
present in the crate::vars::VarEnv.
Fields
InvalidVariableName
A placeholder contained a name that does not match
^[A-Za-z_][A-Za-z0-9_]*$.
Fields
UnclosedBraceExpansion
A ${ placeholder was never closed with } before end of input.
UnclosedPercentExpansion
A % opening sigil was never matched by a closing % before end of
input.
EmptyBraceExpansion
A braced placeholder had an empty name: ${}.
Trait Implementations§
Source§impl Debug for VarExpandError
impl Debug for VarExpandError
Source§impl Display for VarExpandError
impl Display for VarExpandError
Source§impl Error for VarExpandError
impl Error for VarExpandError
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 VarExpandError
impl PartialEq for VarExpandError
impl Eq for VarExpandError
impl StructuralPartialEq for VarExpandError
Auto Trait Implementations§
impl Freeze for VarExpandError
impl RefUnwindSafe for VarExpandError
impl Send for VarExpandError
impl Sync for VarExpandError
impl Unpin for VarExpandError
impl UnsafeUnpin for VarExpandError
impl UnwindSafe for VarExpandError
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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