pub struct ApiResponseMetadata { /* private fields */ }Expand description
Standard HTTP response metadata used by browser, native, and machine clients.
The wrapper is intentionally transport-only. It does not implement rate limiting, token validation, or API lifecycle policy for the application.
Implementations§
Source§impl ApiResponseMetadata
impl ApiResponseMetadata
pub const fn new() -> Self
Sourcepub fn retry_after(self, value: HeaderValue) -> Self
pub fn retry_after(self, value: HeaderValue) -> Self
Adds either a delay-seconds value or an HTTP-date supplied by the application.
pub fn retry_after_seconds(self, seconds: u64) -> Self
pub fn www_authenticate(self, value: HeaderValue) -> Self
pub fn bearer_challenge(self, challenge: BearerChallenge) -> Self
Sourcepub fn deprecation_at(
self,
deprecation: SystemTime,
) -> Result<Self, ApiResponseMetadataError>
pub fn deprecation_at( self, deprecation: SystemTime, ) -> Result<Self, ApiResponseMetadataError>
Adds an RFC 9745 Structured Field Date (@<unix-seconds>).
Sourcepub fn sunset(self, sunset: HeaderValue) -> Self
pub fn sunset(self, sunset: HeaderValue) -> Self
Adds an RFC 8594 Sunset HTTP-date supplied by the application.
Sourcepub fn link(self, link: HeaderValue) -> Self
pub fn link(self, link: HeaderValue) -> Self
Adds one Link field value. Repeated calls preserve separate field values.
pub fn apply(self, response: &mut Response)
pub const fn wrap<T>(self, inner: T) -> ApiResponse<T>
Trait Implementations§
Source§impl Clone for ApiResponseMetadata
impl Clone for ApiResponseMetadata
Source§fn clone(&self) -> ApiResponseMetadata
fn clone(&self) -> ApiResponseMetadata
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 ApiResponseMetadata
impl Debug for ApiResponseMetadata
Source§impl Default for ApiResponseMetadata
impl Default for ApiResponseMetadata
Source§fn default() -> ApiResponseMetadata
fn default() -> ApiResponseMetadata
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ApiResponseMetadata
impl RefUnwindSafe for ApiResponseMetadata
impl Send for ApiResponseMetadata
impl Sync for ApiResponseMetadata
impl Unpin for ApiResponseMetadata
impl UnsafeUnpin for ApiResponseMetadata
impl UnwindSafe for ApiResponseMetadata
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