| 1 | #[cfg(not(feature = "std"))] |
| 2 | use allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::{ |
| 3 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!, |
| 4 | stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/::{Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, ToStringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/ToString#}, |
| 5 | }; |
| 6 | #[cfg(not(feature = "std"))] |
| 7 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#; |
| 8 | #[cfg(feature = "std")] |
| 9 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#; |
| 10 | |
| 11 | use thiserrorrust-analyzer cargo thiserror 2.0.16 crate/::Errorrust-analyzer cargo thiserror-impl 2.0.16 Error:; |
| 12 | |
| 13 | /// An encoding or decoding error |
| 14 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Ordrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord:, PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Errorrust-analyzer cargo thiserror-impl 2.0.16 Error:)] |
| 15 | pub enum StructureErrorrust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError# { |
| 16 | /// Wrong type of token detected. |
| 17 | #[errorrust-analyzer cargo thiserror-impl 2.0.16 error:("Saw the wrong type of token: {state}")] |
| 18 | InvalidStaterust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError#InvalidState# { staterust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError#InvalidState#state.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# }, |
| 19 | |
| 20 | /// Keys were not sorted. |
| 21 | #[errorrust-analyzer cargo thiserror-impl 2.0.16 error:("Keys were not sorted")] |
| 22 | UnsortedKeysrust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError#UnsortedKeys#, |
| 23 | |
| 24 | /// EOF reached to early. |
| 25 | #[errorrust-analyzer cargo thiserror-impl 2.0.16 error:("Reached EOF in the middle of a message")] |
| 26 | UnexpectedEofrust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError#UnexpectedEof#, |
| 27 | |
| 28 | /// Unexpected characters detected. |
| 29 | #[errorrust-analyzer cargo thiserror-impl 2.0.16 error:("Malformed number of unexpected character: {unexpected}")] |
| 30 | SyntaxErrorrust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError#SyntaxError# { unexpectedrust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError#SyntaxError#unexpected.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# }, |
| 31 | |
| 32 | /// Exceeded the recursion limit. |
| 33 | #[errorrust-analyzer cargo thiserror-impl 2.0.16 error:("Maximum nesting depth exceeded")] |
| 34 | NestingTooDeeprust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError#NestingTooDeep#, |
| 35 | } |
| 36 | |
| 37 | impl StructureErrorrust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError# { |
| 38 | pub fn unexpectedrust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/impl#[StructureError]unexpected().(expected: impl Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#, got: char, offset: usize) -> Selfrust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/impl#[StructureError] { |
| 39 | StructureErrorrust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError#::SyntaxErrorrust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError#SyntaxError# { |
| 40 | unexpectedrust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError#SyntaxError#unexpected.: formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Expected {expected}, got {got:?} at offset {offset}"), |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | pub fn invalid_staterust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/impl#[StructureError]invalid_state().(expected: impl Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#) -> Selfrust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/impl#[StructureError] { |
| 45 | StructureErrorrust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError#::InvalidStaterust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError#InvalidState# { |
| 46 | staterust-analyzer cargo bendy 0.6.1 state_tracker/structure_error/StructureError#InvalidState#state.: expected.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 47 | } |
| 48 | } |
| 49 | } |