pub struct FormatStringValidationError {
pub message: String,
pub input: String,
pub start: usize,
pub end: usize,
pub expression_error: Option<Box<ExpressionError>>,
}Expand description
Structured error from FormatString::validate_expressions.
Carries the position of the failing interpolation within the format string so callers can produce caret-style diagnostics or structured error responses.
Fields§
§message: StringDescription of what went wrong (e.g. “Undefined variable ‘Param.X’”).
input: StringThe raw format string that was being validated.
start: usizeByte offset of the {{ that opens the failing interpolation.
end: usizeByte offset of the }} that closes the failing interpolation.
expression_error: Option<Box<ExpressionError>>The original expression error, if available. Contains sub_errors for compound failures (e.g., if/else where both branches fail).
Trait Implementations§
Source§impl Clone for FormatStringValidationError
impl Clone for FormatStringValidationError
Source§fn clone(&self) -> FormatStringValidationError
fn clone(&self) -> FormatStringValidationError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FormatStringValidationError
impl Debug for FormatStringValidationError
Source§impl Error for FormatStringValidationError
impl Error for FormatStringValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for FormatStringValidationError
impl RefUnwindSafe for FormatStringValidationError
impl Send for FormatStringValidationError
impl Sync for FormatStringValidationError
impl Unpin for FormatStringValidationError
impl UnsafeUnpin for FormatStringValidationError
impl UnwindSafe for FormatStringValidationError
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more