pub enum ResponsesTypes {
Informational(ResponsesInformationalCodes),
Success(ResponsesSuccessCodes),
Redirection(ResponsesRedirectionCodes),
ClientError(ResponsesClientCodes),
ServerError(ResponsesServerCodes),
ServiceError(ResponsesServiceCodes),
CrawlerError(ResponsesCrawlerCodes),
LocalApiError(ResponsesLocalApiCodes),
}Expand description
Enum representing the main categories of HTTP response codes. Combines multiple categories into a unified type for simplified handling.
Variants§
Informational(ResponsesInformationalCodes)
Enum representing all HTTP response families.
Success(ResponsesSuccessCodes)
Redirection(ResponsesRedirectionCodes)
ClientError(ResponsesClientCodes)
ServerError(ResponsesServerCodes)
ServiceError(ResponsesServiceCodes)
CrawlerError(ResponsesCrawlerCodes)
LocalApiError(ResponsesLocalApiCodes)
Implementations§
Source§impl ResponsesTypes
impl ResponsesTypes
Sourcepub fn get_code(&self) -> u16
pub fn get_code(&self) -> u16
Converts the enum variant to its corresponding HTTP status code as u16.
Sourcepub fn from_u16(code: u16) -> Option<Self>
pub fn from_u16(code: u16) -> Option<Self>
Attempts to construct a ResponsesTypes variant from a given u16 code.
Sourcepub fn get_description(&self) -> &'static str
pub fn get_description(&self) -> &'static str
Returns the description associated with a response code.
Sourcepub fn get_response_get_description(&self) -> (u16, &'static str)
pub fn get_response_get_description(&self) -> (u16, &'static str)
Returns the code and description associated with a response code.
Sourcepub fn as_normalized_json(&self) -> Value
pub fn as_normalized_json(&self) -> Value
Returns a normalized JSON representation of the response.
Trait Implementations§
Source§impl Clone for ResponsesTypes
impl Clone for ResponsesTypes
Source§fn clone(&self) -> ResponsesTypes
fn clone(&self) -> ResponsesTypes
Returns a duplicate of the value. Read more
1.0.0 · 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 ResponsesTypes
impl Debug for ResponsesTypes
Source§impl From<ResponsesTypes> for UnifiedTuple
Implements automatic conversion from ResponsesTypes to UnifiedTuple.
impl From<ResponsesTypes> for UnifiedTuple
Implements automatic conversion from ResponsesTypes to UnifiedTuple.
This allows for seamless integration between the enum-based response types and the structured tuple representation.
Source§fn from(response: ResponsesTypes) -> Self
fn from(response: ResponsesTypes) -> Self
Converts to this type from the input type.
Source§impl GetDescription for ResponsesTypes
impl GetDescription for ResponsesTypes
Source§impl PartialEq for ResponsesTypes
impl PartialEq for ResponsesTypes
impl Copy for ResponsesTypes
impl StructuralPartialEq for ResponsesTypes
Auto Trait Implementations§
impl Freeze for ResponsesTypes
impl RefUnwindSafe for ResponsesTypes
impl Send for ResponsesTypes
impl Sync for ResponsesTypes
impl Unpin for ResponsesTypes
impl UnwindSafe for ResponsesTypes
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