Struct rust_web_server::response::Response
source · pub struct Response {
pub http_version: String,
pub status_code: i16,
pub reason_phrase: String,
pub headers: Vec<Header>,
pub content_range_list: Vec<ContentRange>,
}
Fields§
§http_version: String
§status_code: i16
§reason_phrase: String
§headers: Vec<Header>
§content_range_list: Vec<ContentRange>
Implementations§
source§impl Response
impl Response
pub fn build( status: StatusCodeReasonPhrase, header_list: Vec<Header>, body: Vec<ContentRange> ) -> Response
pub fn status_code_reason_phrase_list() -> Vec<&'static StatusCodeReasonPhrase>
pub const _ERROR_UNABLE_TO_PARSE_HTTP_VERSION_STATUS_CODE: &'static str = "Unable to parse status code"
pub const _HTTP_VERSION_AND_STATUS_CODE_AND_REASON_PHRASE_REGEX: &'static str = "(?P<http_version>\\w+/\\w+.\\w)\\s(?P<status_code>\\w+)\\s(?P<reason_phrase>.+)"
pub fn _get_header(&self, name: String) -> Option<&Header>
pub fn generate_body(content_range_list: Vec<ContentRange>) -> Vec<u8>
pub fn generate_response(response: Response, request: Request) -> Vec<u8>
pub fn _parse_response(response_vec_u8: &[u8]) -> Response
pub fn _parse_http_version_status_code_reason_phrase_string( http_version_status_code_reason_phrase: &str ) -> Result<(String, i16, String), String>
pub fn _parse_http_response_header_string(header_string: &str) -> Header
pub fn _parse_raw_response_via_cursor( cursor: &mut Cursor<&[u8]>, iteration_number: usize, response: &mut Response, content_length: usize )
pub fn _is_multipart_byteranges_content_type(content_type: &Header) -> bool
pub fn get_response( status_code_reason_phrase: &StatusCodeReasonPhrase, boxed_header_list: Option<Vec<Header>>, boxed_content_range_list: Option<Vec<ContentRange>> ) -> Response
pub fn generate(&mut self) -> Vec<u8>
pub fn get_header(&self, name: String) -> Option<&Header>
pub fn parse(response_vec_u8: &[u8]) -> Result<Response, String>
pub fn parse_raw_response_via_cursor( cursor: &mut Cursor<&[u8]>, iteration_number: usize, response: &mut Response, content_length: usize, total_bytes: i32, bytes_read: i32 ) -> Result<(), String>
pub fn parse_http_response_header_string( header_string: &str ) -> Result<Header, String>
Trait Implementations§
source§impl PartialEq<Response> for Response
impl PartialEq<Response> for Response
impl Eq for Response
impl StructuralEq for Response
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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