var searchIndex = {}; searchIndex["tiny_http"] = {"doc":"# Simple usage","items":[[3,"Header","tiny_http","Represents a HTTP header.",null,null],[12,"field","","",0,null],[12,"value","","",0,null],[3,"HeaderField","","Field of a header (eg. `Content-Type`, `Content-Length`, etc.)",null,null],[3,"HTTPVersion","","HTTP version (usually 1.0 or 1.1).",null,null],[12,"0","","",1,null],[12,"1","","",1,null],[3,"Method","","HTTP method (eg. `GET`, `POST`, etc.)",null,null],[3,"StatusCode","","Status code of a request or response.",null,null],[12,"0","","",2,null],[3,"Request","","Represents an HTTP request made by a client.",null,null],[3,"Response","","Object representing an HTTP response whose purpose is to be given to a `Request`.",null,null],[3,"Server","","The main class of this library.",null,null],[3,"IncomingRequests","","",null,null],[3,"ServerBuilder","","Object which allows you to build a server.",null,null],[11,"partial_cmp","","",2,null],[11,"lt","","",2,null],[11,"le","","",2,null],[11,"gt","","",2,null],[11,"ge","","",2,null],[11,"cmp","","",2,null],[11,"fmt","","",2,null],[11,"clone","","",2,null],[11,"eq","","",2,null],[11,"ne","","",2,null],[11,"get_default_reason_phrase","","Returns the default reason phrase for this status code.\nFor example the status code 404 corresponds to "Not Found".",2,null],[11,"from","","",2,{"inputs":[{"name":"i8"}],"output":{"name":"statuscode"}}],[11,"from","","",2,{"inputs":[{"name":"u8"}],"output":{"name":"statuscode"}}],[11,"from","","",2,{"inputs":[{"name":"i16"}],"output":{"name":"statuscode"}}],[11,"from","","",2,{"inputs":[{"name":"u16"}],"output":{"name":"statuscode"}}],[11,"from","","",2,{"inputs":[{"name":"i32"}],"output":{"name":"statuscode"}}],[11,"from","","",2,{"inputs":[{"name":"u32"}],"output":{"name":"statuscode"}}],[11,"as_ref","","",2,null],[11,"eq","","",2,null],[11,"partial_cmp","","",2,null],[11,"clone","","",0,null],[11,"fmt","","",0,null],[11,"from_bytes","","Builds a `Header` from two `Vec<u8>`s or two `&[u8]`s.",0,{"inputs":[{"name":"b1"},{"name":"b2"}],"output":{"name":"result"}}],[11,"from_str","","",0,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"fmt","","",0,null],[11,"clone","","",3,null],[11,"fmt","","",3,null],[11,"from_bytes","","",3,{"inputs":[{"name":"b"}],"output":{"name":"result"}}],[11,"as_str","","",3,null],[11,"equiv","","",3,null],[11,"from_str","","",3,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"fmt","","",3,null],[11,"eq","","",3,null],[11,"clone","","",4,null],[11,"fmt","","",4,null],[11,"equiv","","",4,null],[11,"from_str","","",4,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"fmt","","",4,null],[11,"eq","","",4,null],[11,"cmp","","",1,null],[11,"eq","","",1,null],[11,"ne","","",1,null],[11,"clone","","",1,null],[11,"fmt","","",1,null],[11,"fmt","","",1,null],[11,"partial_cmp","","",1,null],[11,"eq","","",1,null],[11,"partial_cmp","","",1,null],[11,"from","","",1,null],[11,"get_method","","Returns the method requested by the client (eg. `GET`, `POST`, etc.).",5,null],[11,"get_url","","Returns the resource requested by the client.",5,null],[11,"get_headers","","Returns a list of all headers sent by the client.",5,null],[11,"get_http_version","","Returns the HTTP version of the request.",5,null],[11,"get_body_length","","Returns the length of the body in bytes.",5,null],[11,"get_remote_addr","","Returns the length of the body in bytes.",5,null],[11,"as_reader","","Allows to read the body of the request.",5,null],[11,"into_writer","","Turns the `Request` into a writer.",5,null],[11,"respond","","Sends a response to this request.",5,null],[11,"fmt","","",5,null],[11,"drop","","",5,null],[11,"new","","Creates a new Response object.",6,{"inputs":[{"name":"statuscode"},{"name":"vec"},{"name":"r"},{"name":"option"},{"name":"option"}],"output":{"name":"response"}}],[11,"add_header","","Adds a header to the list.\nDoes all the checks.",6,null],[11,"with_header","","Returns the same request, but with an additional header.",6,null],[11,"with_status_code","","Returns the same request, but with a different status code.",6,null],[11,"with_data","","Returns the same request, but with different data.",6,null],[11,"raw_print","","Prints the HTTP response to a writer.",6,null],[11,"boxed","","Turns this response into a `Response<Box<Read + Send>>`.",6,null],[11,"from_file","","Builds a new `Response` from a `File`.",6,{"inputs":[{"name":"file"}],"output":{"name":"response"}}],[11,"from_data","","",6,{"inputs":[{"name":"d"}],"output":{"name":"response"}}],[11,"from_string","","",6,{"inputs":[{"name":"s"}],"output":{"name":"response"}}],[11,"empty","","Builds an empty `Response` with the given status code.",6,{"inputs":[{"name":"s"}],"output":{"name":"response"}}],[11,"new_empty","","DEPRECATED. Use `empty` instead.",6,{"inputs":[{"name":"statuscode"}],"output":{"name":"response"}}],[11,"clone","","",6,null],[6,"ResponseBox","","A `Response` without a template parameter.",null,null],[11,"new","","Creates a new builder.",7,{"inputs":[],"output":{"name":"serverbuilder"}}],[11,"with_port","","The server will use a precise port.",7,null],[11,"with_random_port","","The server will use a random port.",7,null],[11,"with_client_connections_timeout","","The server will use a precise port.",7,null],[11,"build","","Builds the server with the given configuration.",7,null],[11,"incoming_requests","","Returns an iterator for all the incoming requests.",8,null],[11,"get_server_addr","","Returns the address the server is listening to.",8,null],[11,"get_num_connections","","Returns the number of clients currently connected to the server.",8,null],[11,"recv","","Blocks until an HTTP request has been submitted and returns it.",8,null],[11,"try_recv","","Same as `recv()` but doesn't block.",8,null],[11,"next","","",9,null],[11,"drop","","",8,null]],"paths":[[3,"Header"],[3,"HTTPVersion"],[3,"StatusCode"],[3,"HeaderField"],[3,"Method"],[3,"Request"],[3,"Response"],[3,"ServerBuilder"],[3,"Server"],[3,"IncomingRequests"]]}; initSearch(searchIndex);