pub struct ResponseMetadata {
pub status: u16,
pub request_id: Option<String>,
pub headers: HeaderMap,
}Expand description
HTTP metadata associated with a model response.
Fields§
§status: u16HTTP status code of the response.
request_id: Option<String>Request id taken from common provider headers, when present.
headers: HeaderMapAll response headers.
Implementations§
Source§impl ResponseMetadata
impl ResponseMetadata
Sourcepub fn header(&self, name: impl AsRef<str>) -> Option<&HeaderValue>
pub fn header(&self, name: impl AsRef<str>) -> Option<&HeaderValue>
Looks up a header by name. Header names are compared case-insensitively.
Sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Returns the request id, when one was found.
Sourcepub fn from_response(response: &Response) -> Self
pub fn from_response(response: &Response) -> Self
Captures metadata from a completed response. The request id is taken
from the first of x-request-id, request-id, x-ms-request-id, or
cf-ray present in the headers.
Trait Implementations§
Source§impl Clone for ResponseMetadata
impl Clone for ResponseMetadata
Source§impl Debug for ResponseMetadata
impl Debug for ResponseMetadata
Source§impl PartialEq for ResponseMetadata
impl PartialEq for ResponseMetadata
impl StructuralPartialEq for ResponseMetadata
Auto Trait Implementations§
impl Freeze for ResponseMetadata
impl RefUnwindSafe for ResponseMetadata
impl Send for ResponseMetadata
impl Sync for ResponseMetadata
impl Unpin for ResponseMetadata
impl UnsafeUnpin for ResponseMetadata
impl UnwindSafe for ResponseMetadata
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