pub enum WebhookError {
NilReader,
EmptyBody,
BodyTooLarge {
limit: usize,
},
ReadBody(String),
DecodeBody(String),
InvalidOrderId,
InvalidAmount,
}Expand description
Things that can go wrong while parsing a webhook.
Variants§
NilReader
Reader is missing where one was expected.
Kept for parity with the original API surface — the typed
Parser::parse_reader signature makes it impossible to hit from
safe Rust code today.
EmptyBody
The body was zero bytes.
BodyTooLarge
The body grew past the configured size cap.
ReadBody(String)
Reading from the supplied source failed. String is the underlying
IO error message, kept by value so WebhookError can stay
Clone + PartialEq.
DecodeBody(String)
JSON decoding failed. String is the underlying serde_json error
message, for the same reason as above.
InvalidOrderId
Event::validate saw an empty order_id.
InvalidAmount
Event::validate saw a non-positive amount.
Trait Implementations§
Source§impl Clone for WebhookError
impl Clone for WebhookError
Source§fn clone(&self) -> WebhookError
fn clone(&self) -> WebhookError
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 WebhookError
impl Debug for WebhookError
Source§impl Display for WebhookError
impl Display for WebhookError
Source§impl Error for WebhookError
impl Error for WebhookError
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 PartialEq for WebhookError
impl PartialEq for WebhookError
Source§fn eq(&self, other: &WebhookError) -> bool
fn eq(&self, other: &WebhookError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for WebhookError
impl StructuralPartialEq for WebhookError
Auto Trait Implementations§
impl Freeze for WebhookError
impl RefUnwindSafe for WebhookError
impl Send for WebhookError
impl Sync for WebhookError
impl Unpin for WebhookError
impl UnsafeUnpin for WebhookError
impl UnwindSafe for WebhookError
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