pub struct CfApiResponse<T> {
pub success: bool,
pub errors: Vec<CfApiError>,
pub result: Option<T>,
}Expand description
Standard Cloudflare API response envelope: { success, errors, result }.
Fields§
§success: boolWhether Cloudflare considered the request successful.
errors: Vec<CfApiError>API errors returned by Cloudflare when success is false.
result: Option<T>Successful response payload.
Implementations§
Source§impl<T> CfApiResponse<T>
impl<T> CfApiResponse<T>
Sourcepub fn into_result(self) -> Result<T, CloudflareError>
pub fn into_result(self) -> Result<T, CloudflareError>
Convert into Result<T, CloudflareError>, joining every error
message into one string for display.
§Errors
Returns an error when Cloudflare reported failure or omitted the expected result payload.
Trait Implementations§
Source§impl<T: Debug> Debug for CfApiResponse<T>
impl<T: Debug> Debug for CfApiResponse<T>
Source§impl<'de, T> Deserialize<'de> for CfApiResponse<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for CfApiResponse<T>where
T: Deserialize<'de>,
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<T> Freeze for CfApiResponse<T>where
T: Freeze,
impl<T> RefUnwindSafe for CfApiResponse<T>where
T: RefUnwindSafe,
impl<T> Send for CfApiResponse<T>where
T: Send,
impl<T> Sync for CfApiResponse<T>where
T: Sync,
impl<T> Unpin for CfApiResponse<T>where
T: Unpin,
impl<T> UnsafeUnpin for CfApiResponse<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for CfApiResponse<T>where
T: UnwindSafe,
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