pub enum PublicRedemptionError {
InvalidOrExpired,
RateLimited,
TemporarilyUnavailable,
}Expand description
Public-safe redemption failure (RFC-012 §4, RFC-021).
All enumeration-sensitive reasons (NotFound, Expired, Revoked,
AlreadyUsed, InvalidFormat) collapse to InvalidOrExpired. The caller
must not expose the internal RedemptionFailReason to end users.
Variants§
InvalidOrExpired
The code was not accepted. Reason intentionally omitted.
RateLimited
The caller has exceeded the rate limit. Safe to surface as a throttle hint (does not reveal code existence).
A transient problem prevented the check. The code was not consumed.
Implementations§
Source§impl PublicRedemptionError
impl PublicRedemptionError
Sourcepub fn from_reason(reason: &RedemptionFailReason) -> Self
pub fn from_reason(reason: &RedemptionFailReason) -> Self
Map an internal reason to its public-safe equivalent (RFC-012 §4).
Trait Implementations§
Source§impl Clone for PublicRedemptionError
impl Clone for PublicRedemptionError
Source§fn clone(&self) -> PublicRedemptionError
fn clone(&self) -> PublicRedemptionError
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 PublicRedemptionError
impl Debug for PublicRedemptionError
Source§impl Display for PublicRedemptionError
impl Display for PublicRedemptionError
impl Eq for PublicRedemptionError
Source§impl Error for PublicRedemptionError
impl Error for PublicRedemptionError
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 PublicRedemptionError
impl PartialEq for PublicRedemptionError
Source§fn eq(&self, other: &PublicRedemptionError) -> bool
fn eq(&self, other: &PublicRedemptionError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PublicRedemptionError
Auto Trait Implementations§
impl Freeze for PublicRedemptionError
impl RefUnwindSafe for PublicRedemptionError
impl Send for PublicRedemptionError
impl Sync for PublicRedemptionError
impl Unpin for PublicRedemptionError
impl UnsafeUnpin for PublicRedemptionError
impl UnwindSafe for PublicRedemptionError
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