#[non_exhaustive]pub struct DefaultMeta {
pub request_id: Option<String>,
pub user: Option<UserMeta>,
pub pagination: Option<Pagination>,
pub rate_limit: Option<RateLimit>,
pub cost: Option<Cost>,
pub api_version: Option<String>,
/* private fields */
}
Expand description
Default meta type
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.request_id: Option<String>
§user: Option<UserMeta>
§pagination: Option<Pagination>
§rate_limit: Option<RateLimit>
§cost: Option<Cost>
§api_version: Option<String>
Implementations§
Source§impl DefaultMeta
impl DefaultMeta
pub fn new() -> Self
pub fn with_request_id(self, request_id: impl Into<MaybeString>) -> Self
pub fn with_user(self, user: Option<UserMeta>) -> Self
pub const fn with_pagination(self, pagination: Option<Pagination>) -> Self
pub const fn with_rate_limit(self, rate_limit: Option<RateLimit>) -> Self
pub const fn with_cost(self, cost: Option<Cost>) -> Self
pub fn with_api_version(self, api_version: impl Into<MaybeString>) -> Self
pub fn insert_custom( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
pub const fn request_id(&self) -> Option<&String>
pub const fn user(&self) -> Option<&UserMeta>
pub const fn pagination(&self) -> Option<&Pagination>
pub const fn rate_limit(&self) -> Option<&RateLimit>
pub const fn cost(&self) -> Option<&Cost>
pub const fn api_version(&self) -> Option<&String>
pub fn custom(&self) -> &HashMap<String, String>
pub fn custom_kv(&self, key: impl AsRef<str>) -> Option<&String>
Trait Implementations§
Source§impl Debug for DefaultMeta
impl Debug for DefaultMeta
Source§impl Default for DefaultMeta
impl Default for DefaultMeta
Source§impl<'de> Deserialize<'de> for DefaultMeta
impl<'de> Deserialize<'de> for DefaultMeta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DefaultMeta
impl RefUnwindSafe for DefaultMeta
impl Send for DefaultMeta
impl Sync for DefaultMeta
impl Unpin for DefaultMeta
impl UnwindSafe for DefaultMeta
Blanket Implementations§
Source§impl<Data> ApiSuccessResponse for Data
impl<Data> ApiSuccessResponse for Data
fn api_response<Meta>(self, meta: Option<Meta>) -> ApiResponse<Self, Meta>
fn api_response_without_meta<Meta>(self) -> ApiResponse<Self, Meta>
fn api_response_with_meta<Meta>(self, meta: Meta) -> ApiResponse<Self, Meta>
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