#[non_exhaustive]pub struct ResponseMetadata {
pub error: String,
pub headers: Option<Struct>,
pub status_code: String,
pub size_bytes: i32,
pub duration: Option<Duration>,
pub body: String,
/* private fields */
}Expand description
Metadata for the response of an ad request.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.error: StringError message received when making the ad request.
headers: Option<Struct>Headers from the response.
status_code: StringStatus code for the response.
size_bytes: i32Size in bytes of the response.
duration: Option<Duration>Total time elapsed for the response.
body: StringThe body of the response.
Implementations§
Source§impl ResponseMetadata
impl ResponseMetadata
Sourcepub fn set_headers<T>(self, v: T) -> Self
pub fn set_headers<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_headers<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_headers<T>(self, v: Option<T>) -> Self
Sourcepub fn set_status_code<T: Into<String>>(self, v: T) -> Self
pub fn set_status_code<T: Into<String>>(self, v: T) -> Self
Sets the value of status_code.
§Example
ⓘ
let x = ResponseMetadata::new().set_status_code("example");Sourcepub fn set_size_bytes<T: Into<i32>>(self, v: T) -> Self
pub fn set_size_bytes<T: Into<i32>>(self, v: T) -> Self
Sourcepub fn set_duration<T>(self, v: T) -> Self
pub fn set_duration<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_duration<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_duration<T>(self, v: Option<T>) -> Self
Trait Implementations§
Source§impl Clone for ResponseMetadata
impl Clone for ResponseMetadata
Source§fn clone(&self) -> ResponseMetadata
fn clone(&self) -> ResponseMetadata
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 ResponseMetadata
impl Debug for ResponseMetadata
Source§impl Default for ResponseMetadata
impl Default for ResponseMetadata
Source§fn default() -> ResponseMetadata
fn default() -> ResponseMetadata
Returns the “default value” for a type. Read more
Source§impl Message for ResponseMetadata
impl Message for ResponseMetadata
Source§impl PartialEq for ResponseMetadata
impl PartialEq for ResponseMetadata
Source§fn eq(&self, other: &ResponseMetadata) -> bool
fn eq(&self, other: &ResponseMetadata) -> bool
Tests for
self and other values to be equal, and is used by ==.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