pub struct HttpCode {
pub standard_code: u16,
pub standard_name: &'static str,
pub unified_description: &'static str,
pub internal_code: Option<u16>,
pub internal_name: Option<&'static str>,
}Expand description
Represents an HTTP status code with standard and internal identifiers.
This structure combines standard HTTP status codes (like 200, 404) with optional internal application-specific codes for more detailed error tracking and reporting.
Fields§
§standard_code: u16Standard HTTP status code.
standard_name: &'static strStandard HTTP status message.
unified_description: &'static strUnified description of the HTTP response.
internal_code: Option<u16>Optional internal HTTP status code.
internal_name: Option<&'static str>Optional internal HTTP status name.
Implementations§
Source§impl HttpCode
impl HttpCode
Sourcepub fn new(
standard_code: u16,
standard_name: &'static str,
unified_description: &'static str,
internal_code: u16,
internal_name: &'static str,
) -> Self
pub fn new( standard_code: u16, standard_name: &'static str, unified_description: &'static str, internal_code: u16, internal_name: &'static str, ) -> Self
Creates a new HttpCode with both standard and internal identifiers.
§Arguments
standard_code- The standard HTTP status codestandard_name- The standard HTTP status nameunified_description- Human-readable descriptioninternal_code- Application-specific status codeinternal_name- Application-specific status name
Sourcepub fn as_unified_tuple(&self) -> UnifiedTuple
pub fn as_unified_tuple(&self) -> UnifiedTuple
Converts the HttpCode to a UnifiedTuple representation for consistent formatting.
Trait Implementations§
Source§impl IntoThreeFieldsTuple for HttpCode
impl IntoThreeFieldsTuple for HttpCode
fn into_three_fields_tuple(self) -> ThreeFieldsTuple
Source§impl IntoTwoFieldsTuple for HttpCode
impl IntoTwoFieldsTuple for HttpCode
fn into_two_fields_tuple(self) -> TwoFieldsTuple
impl Copy for HttpCode
impl StructuralPartialEq for HttpCode
Auto Trait Implementations§
impl Freeze for HttpCode
impl RefUnwindSafe for HttpCode
impl Send for HttpCode
impl Sync for HttpCode
impl Unpin for HttpCode
impl UnwindSafe for HttpCode
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