Enum json5format::Error [−][src]
Errors produced by the json5format library.
Variants
Configuration(String)
A formatter configuration option was invalid.
A syntax error was encountered while parsing a JSON5 document.
The parser or formatter entered an unexpected state. An Error::Internal
likely indicates
there is a software bug in the json5format library.
This error is only produced by internal test functions to indicate a test result did not match expectations.
Implementations
impl Error
[src]
pub fn configuration(err: impl Display) -> Self
[src]
pub fn parse(location: Option<Location>, err: impl Display) -> Self
[src]
Return a parsing error.
Arguments
- location - Optional location in the JSON5 document where the error was detected.
- err - The error message.
pub fn internal(location: Option<Location>, err: impl Into<String>) -> Self
[src]
Return an internal error (indicating an error in the software implementation itself).
Arguments
- location - Optional location in the JSON5 document where the error was detected, which might be available if the error occurred while parsing the document.
- err - The error message.
pub fn test_failure(location: Option<Location>, err: impl Into<String>) -> Self
[src]
Return a TestFailure error.
Arguments
- location - Optional Rust source code location where the test failed.
- err - The error message.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Error
[src]
impl Send for Error
[src]
impl Sync for Error
[src]
impl Unpin for Error
[src]
impl UnwindSafe for Error
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,