#[non_exhaustive]pub struct SerializeError(/* private fields */);Expand description
JSON serialize error reported by the underlying JSON serializer.
Shape mirrors ParseError; see that type for the SemVer-isolation
rationale. Indicates a caller bug — the data structure passed to a
serializer contains non-serializable values (f64::NAN, a map keyed
by a non-stringifiable type, etc.).
Implementations§
Source§impl SerializeError
impl SerializeError
Sourcepub fn from_serde_json(e: Error) -> Self
pub fn from_serde_json(e: Error) -> Self
Wrap a serde_json::Error into a SerializeError.
Most callers want ClientError::from_serialize which wraps and
classifies in one step.
Sourcepub fn line(&self) -> usize
pub fn line(&self) -> usize
One-based line number where serialization failed, or 0 if the
serializer does not report a line for this category.
Sourcepub fn column(&self) -> usize
pub fn column(&self) -> usize
One-based column number where serialization failed, or 0 if the
serializer does not report a column for this category.
Sourcepub fn classify(&self) -> ParseCategory
pub fn classify(&self) -> ParseCategory
Coarse-grained category of the failure.
Trait Implementations§
Source§impl Debug for SerializeError
impl Debug for SerializeError
Source§impl Display for SerializeError
impl Display for SerializeError
Source§impl Error for SerializeError
impl Error for SerializeError
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for SerializeError
impl !UnwindSafe for SerializeError
impl Freeze for SerializeError
impl Send for SerializeError
impl Sync for SerializeError
impl Unpin for SerializeError
impl UnsafeUnpin for SerializeError
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<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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.