var searchIndex = {}; searchIndex["milstian_http"] = {"doc":"Milstian HTTP","items":[[0,"request","milstian_http","Handles everything related to HTTP requests.",null,null],[3,"Message","milstian_http::request","",null,null],[12,"body","","",0,null],[12,"headers","","",0,null],[12,"request_line","","",0,null],[3,"Line","","",null,null],[12,"method","","",1,null],[12,"protocol","","",1,null],[12,"request_uri","","",1,null],[12,"request_uri_base","","",1,null],[12,"query_arguments","","",1,null],[12,"query_string","","",1,null],[3,"HeaderValueParts","","",null,null],[12,"parts","","",2,null],[3,"MultiPartValue","","",null,null],[12,"body","","",3,null],[12,"headers","","",3,null],[4,"BodyContentType","","",null,null],[13,"SinglePart","","",4,null],[13,"MultiPart","","",4,null],[4,"Method","","",null,null],[13,"Connect","","",5,null],[13,"Delete","","",5,null],[13,"Get","","",5,null],[13,"Head","","",5,null],[13,"Invalid","","",5,null],[13,"Options","","",5,null],[13,"Patch","","",5,null],[13,"Post","","",5,null],[13,"Put","","",5,null],[13,"Trace","","",5,null],[4,"HeaderContentType","","",null,null],[13,"MultiPart","","",6,null],[13,"SinglePart","","",6,null],[4,"HeaderValuePart","","",null,null],[13,"Single","","",7,null],[13,"KeyValue","","",7,null],[4,"Protocol","","",null,null],[13,"Invalid","","",8,null],[13,"V1_0","","",8,null],[13,"V1_1","","",8,null],[13,"V2_0","","",8,null],[13,"V0_9","","",8,null],[11,"fmt","","",4,{"i":[{"n":"self"},{"n":"formatter"}],"o":{"n":"result"}}],[11,"fmt","","",0,{"i":[{"n":"self"},{"n":"formatter"}],"o":{"n":"result"}}],[11,"fmt","","",1,{"i":[{"n":"self"},{"n":"formatter"}],"o":{"n":"result"}}],[11,"fmt","","",5,{"i":[{"n":"self"},{"n":"formatter"}],"o":{"n":"result"}}],[11,"eq","","",5,{"i":[{"n":"self"},{"n":"method"}],"o":{"n":"bool"}}],[11,"fmt","","",6,{"i":[{"n":"self"},{"n":"formatter"}],"o":{"n":"result"}}],[11,"fmt","","",7,{"i":[{"n":"self"},{"n":"formatter"}],"o":{"n":"result"}}],[11,"fmt","","",2,{"i":[{"n":"self"},{"n":"formatter"}],"o":{"n":"result"}}],[11,"get_key_value","","",2,{"i":[{"n":"self"},{"n":"str"}],"o":{"g":["string"],"n":"option"}}],[11,"to_string","","",2,{"i":[{"n":"self"}],"o":{"n":"string"}}],[11,"fmt","","",3,{"i":[{"n":"self"},{"n":"formatter"}],"o":{"n":"result"}}],[11,"fmt","","",8,{"i":[{"n":"self"},{"n":"formatter"}],"o":{"n":"result"}}],[11,"eq","","",8,{"i":[{"n":"self"},{"n":"protocol"}],"o":{"n":"bool"}}],[11,"get_protocol_text","","",0,{"i":[{"n":"protocol"}],"o":{"n":"string"}}],[11,"get_message_body","","",0,{"i":[{"n":"str"}],"o":{"g":["bodycontenttype"],"n":"option"}}],[11,"get_header_field","","",0,{"i":[{"n":"str"}],"o":{"n":"option"}}],[11,"get_request_line","","",0,{"i":[{"n":"str"}],"o":{"g":["line"],"n":"option"}}],[11,"from_tcp_stream","","Try to decode a byte stream into a HTTP Message ## Usage `rust use milstian_http::request::{Message, Method, Protocol}; let response = Message::from_tcp_stream(b\"GET / HTTP/2.0\\r\\n\"); let response_unwrapped = response.expect(\"A decoded HTTP Message\"); assert_eq!(response_unwrapped.request_line.method, Method::Get); assert_eq!(response_unwrapped.request_line.request_uri, \"/\".to_string()); assert_eq!(response_unwrapped.request_line.protocol, Protocol::V2_0);`",0,null],[0,"response","milstian_http","Handles everything related to HTTP responses.",null,null],[3,"Message","milstian_http::response","A request message",null,null],[11,"new","","Create a new HTTP Message",9,{"i":[{"n":"string"},{"n":"string"},{"g":["string","string"],"n":"hashmap"},{"g":["u8"],"n":"vec"}],"o":{"n":"message"}}],[11,"set_status","","",9,{"i":[{"n":"self"},{"n":"string"}]}],[11,"header_to_string","","Get the HTTP header as a new string `rust use milstian_http::response::Message; use std::collections::HashMap; assert_eq!( Message::new( \"HTTP/1.0\".to_string(), \"200 OK\".to_string(), HashMap::new(), b\"Nothing here\".to_vec() ).header_to_string(), \"HTTP/1.0 200 OK\\r\\n\\r\\n\".to_string() );`",9,{"i":[{"n":"self"}],"o":{"n":"string"}}],[11,"to_string","","Convert response message into a string `rust use milstian_http::response::Message; use std::collections::HashMap; assert_eq!( Message::new( \"HTTP/1.0\".to_string(), \"200 OK\".to_string(), HashMap::new(), b\"Nothing here\".to_vec() ).to_string(), \"HTTP/1.0 200 OK\\r\\n\\r\\nNothing here\".to_string() );`",9,{"i":[{"n":"self"}],"o":{"n":"string"}}],[11,"to_bytes","","Convert message into bytes `rust use milstian_http::response::Message; use std::collections::HashMap; assert_eq!( Message::new( \"HTTP/1.0\".to_string(), \"200 OK\".to_string(), HashMap::new(), b\"Nothing here\".to_vec() ).to_bytes(), b\"HTTP/1.0 200 OK\\r\\n\\r\\nNothing here\".to_vec() );`",9,{"i":[{"n":"self"}],"o":{"g":["u8"],"n":"vec"}}]],"paths":[[3,"Message"],[3,"Line"],[3,"HeaderValueParts"],[3,"MultiPartValue"],[4,"BodyContentType"],[4,"Method"],[4,"HeaderContentType"],[4,"HeaderValuePart"],[4,"Protocol"],[3,"Message"]]}; initSearch(searchIndex);