pub struct DecodeError {
pub kind: DecodeErrorKind,
pub path: String,
pub reason: String,
}Expand description
A decoding failure, carrying enough detail to fill an OCPP CALLERROR.
Fields§
§kind: DecodeErrorKindWhich OCPP error code this maps to.
path: StringRFC 6901 pointer to the offending member, empty for whole-payload failures.
reason: StringHuman-readable reason, suitable for errorDescription.
Implementations§
Source§impl DecodeError
impl DecodeError
Sourcepub fn new(
kind: DecodeErrorKind,
path: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn new( kind: DecodeErrorKind, path: impl Into<String>, reason: impl Into<String>, ) -> Self
Builds a decoding failure.
Sourcepub fn unsupported_action(action: &str) -> Self
pub fn unsupported_action(action: &str) -> Self
The action is not valid for this direction or version.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
Source§impl Error for DecodeError
Available on crate feature std only.
impl Error for DecodeError
Available on crate feature
std only.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()
Source§impl From<DecodeError> for CallError
impl From<DecodeError> for CallError
Source§fn from(error: DecodeError) -> Self
fn from(error: DecodeError) -> Self
Maps a decoding failure onto the error code the specification prescribes, and puts
the offending JSON pointer into errorDetails so the peer can find it.
Source§impl PartialEq for DecodeError
impl PartialEq for DecodeError
impl StructuralPartialEq for DecodeError
Auto Trait Implementations§
impl Forget for DecodeError
impl Freeze for DecodeError
impl RefUnwindSafe for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl UnsafeUnpin for DecodeError
impl UnwindSafe for DecodeError
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