Skip to main content

ApiErrorBody

Trait ApiErrorBody 

Source
pub trait ApiErrorBody {
    type Body;

    // Required methods
    fn body(&self) -> Option<&Self::Body>;
    fn into_body(self) -> Option<Self::Body>
       where Self: Sized;
}
Expand description

Implemented by the generated error shapes that carry one documented body type, so code generic over operations can reach that body without naming each E.

Three shapes implement it: a multi-status enum whose bodied statuses carry the same body type (one schema, or schemas that generate the same Rust type; its body is None for a documented bodyless status, or a null payload), the single-body newtype (Body is the bare schema type, so a nullable body answers None for null exactly as the enum does), and the uninhabited Infallible shape, so Error::api_body exists on those operations. An enum whose statuses carry different body types has no implementation: there is no single body to hand back, and the compile error is the signal.

Required Associated Types§

Source

type Body

The documented error body type.

Required Methods§

Source

fn body(&self) -> Option<&Self::Body>

The documented body this value carries, if its status documents one.

Source

fn into_body(self) -> Option<Self::Body>
where Self: Sized,

The documented body this value carries, moved out, if its status documents one: Some exactly when body is.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ApiErrorBody for Infallible

Source§

type Body = Infallible

Source§

fn body(&self) -> Option<&Self::Body>

Source§

fn into_body(self) -> Option<Self::Body>

Implementors§

Source§

impl ApiErrorBody for AbortAlbumUpgradeError

Source§

impl ApiErrorBody for AdoptDropError

Source§

impl ApiErrorBody for AlbumUpgradePhaseError

Source§

impl ApiErrorBody for AttestationKeysError

Source§

impl ApiErrorBody for BeginOidcDeviceLoginError

Source§

impl ApiErrorBody for BeginOidcLoginError

Source§

impl ApiErrorBody for ChangePasswordError

Source§

impl ApiErrorBody for CloseEnrollmentChannelError

Source§

impl ApiErrorBody for CompleteOidcLoginError

Source§

impl ApiErrorBody for DeprecationAnnouncementsError

Source§

impl ApiErrorBody for DiscardDropError

Source§

impl ApiErrorBody for DrainEnrollmentChannelError

Source§

impl ApiErrorBody for DropStatusError

Source§

impl ApiErrorBody for FetchEscrowError

Source§

impl ApiErrorBody for FetchSealedIdentityError

Source§

impl ApiErrorBody for GetAssetReceiptsError

Source§

impl ApiErrorBody for GetBlobError

Source§

impl ApiErrorBody for GetProfileError

Source§

impl ApiErrorBody for GetPulledAssetMetadataError

Source§

impl ApiErrorBody for GetQuotaError

Source§

impl ApiErrorBody for GetVersionError

Source§

impl ApiErrorBody for IssueCapabilityError

Source§

impl ApiErrorBody for IssueEnrollmentCodeError

Source§

impl ApiErrorBody for IssueShareError

Source§

impl ApiErrorBody for ListActivityError

Source§

impl ApiErrorBody for ListAlbumKeysError

Source§

impl ApiErrorBody for ListDevicesError

Source§

impl ApiErrorBody for ListInboxError

Source§

impl ApiErrorBody for ListPulledAssetsError

Source§

impl ApiErrorBody for ListSubscriptionsError

Source§

impl ApiErrorBody for ListUploadSessionsError

Source§

impl ApiErrorBody for LoginUserError

Source§

impl ApiErrorBody for LogoutError

Source§

impl ApiErrorBody for ModerationRecordError

Source§

impl ApiErrorBody for PollOidcDeviceLoginError

Source§

impl ApiErrorBody for ProvisionAlbumError

Source§

impl ApiErrorBody for ProvisionLinkError

Source§

impl ApiErrorBody for ReannounceManifestsError

Source§

impl ApiErrorBody for ReauthenticateError

Source§

impl ApiErrorBody for RefreshCapabilityError

Source§

impl ApiErrorBody for RefreshTokenError

Source§

impl ApiErrorBody for RelayEnrollmentPayloadError

Source§

impl ApiErrorBody for RevokeAllChallengeError

Source§

impl ApiErrorBody for RevokeAllError

Source§

impl ApiErrorBody for RevokeCapabilityError

Source§

impl ApiErrorBody for RevokeLinkError

Source§

impl ApiErrorBody for RevokeSessionError

Source§

impl ApiErrorBody for RevokeShareError

Source§

impl ApiErrorBody for RevokedJtiError

Source§

impl ApiErrorBody for ServerInfoError

Source§

impl ApiErrorBody for StoreAlbumKeysError

Source§

impl ApiErrorBody for StoreEscrowError

Source§

impl ApiErrorBody for StoreSealedIdentityError

Source§

impl ApiErrorBody for SubmitFederatedReportError

Source§

impl ApiErrorBody for SubmitPullHintError

Source§

impl ApiErrorBody for SubscribeAlbumError

Source§

impl ApiErrorBody for SyncFeedError

Source§

impl ApiErrorBody for TotpDisableError

Source§

impl ApiErrorBody for TotpEnrollError

Source§

impl ApiErrorBody for TotpVerifyEnrollmentError

Source§

impl ApiErrorBody for TotpVerifyLoginError

Source§

impl ApiErrorBody for UnsubscribeAlbumError

Source§

impl ApiErrorBody for UpdateProfileError