pub struct Rejection {
pub reason: RejectReason,
pub platform: Option<Platform>,
pub source: Option<Box<dyn Error + Send + Sync>>,
}Expand description
A refused request: the reason, plus context for server-side telemetry.
Only the reason may reach the client. The source can name internal endpoints or token internals, and never includes the token, signature or body.
Fields§
§reason: RejectReasonWhy the request was refused.
platform: Option<Platform>The attested platform, once the integrity token has been verified.
source: Option<Box<dyn Error + Send + Sync>>The underlying failure, when there is one.
Implementations§
Source§impl Rejection
impl Rejection
Sourcepub const fn new(reason: RejectReason) -> Self
pub const fn new(reason: RejectReason) -> Self
A rejection for reason with no further context.
Sourcepub fn with_source(
self,
source: impl Into<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn with_source( self, source: impl Into<Box<dyn Error + Send + Sync>>, ) -> Self
Attaches the underlying failure.
Sourcepub const fn with_platform(self, platform: Platform) -> Self
pub const fn with_platform(self, platform: Platform) -> Self
Attaches the attested platform.
Trait Implementations§
Source§impl Error for Rejection
impl Error for Rejection
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<RejectReason> for Rejection
impl From<RejectReason> for Rejection
Source§fn from(reason: RejectReason) -> Self
fn from(reason: RejectReason) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Rejection
impl !UnwindSafe for Rejection
impl Freeze for Rejection
impl Send for Rejection
impl Sync for Rejection
impl Unpin for Rejection
impl UnsafeUnpin for Rejection
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