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,"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,"ServerConfig","","Represents the parameters required to create a server.",null,null],[12,"addr","","The addresses to listen to.",3,null],[12,"ssl","","If `Some`, then the server will use SSL to encode the communications.",3,null],[3,"SslConfig","","Configuration of the server for SSL.",null,null],[12,"certificate","","Contains the public certificate to send to clients.",4,null],[12,"private_key","","Contains the ultra-secret private key used to decode communications.",4,null],[4,"Method","","HTTP request methods",null,null],[13,"Get","","`GET`",5,null],[13,"Head","","`HEAD`",5,null],[13,"Post","","`POST`",5,null],[13,"Put","","`PUT`",5,null],[13,"Delete","","`DELETE`",5,null],[13,"Connect","","`CONNECT`",5,null],[13,"Options","","`OPTIONS`",5,null],[13,"Trace","","`TRACE`",5,null],[13,"Patch","","`PATCH`",5,null],[13,"NonStandard","","Request methods not standardized by the IETF",5,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,"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","","",6,null],[11,"fmt","","",6,null],[11,"from_bytes","","",6,{"inputs":[{"name":"b"}],"output":{"name":"result"}}],[11,"as_str","","",6,null],[11,"equiv","","",6,null],[11,"from_str","","",6,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"fmt","","",6,null],[11,"eq","","",6,null],[11,"clone","","",5,null],[11,"fmt","","",5,null],[11,"as_str","","",5,null],[11,"from_str","","",5,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"fmt","","",5,null],[11,"eq","","",5,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,"secure","","Returns true if the request was made through HTTPS.",7,null],[11,"method","","Returns the method requested by the client (eg. `GET`, `POST`, etc.).",7,null],[11,"url","","Returns the resource requested by the client.",7,null],[11,"headers","","Returns a list of all headers sent by the client.",7,null],[11,"http_version","","Returns the HTTP version of the request.",7,null],[11,"body_length","","Returns the length of the body in bytes.",7,null],[11,"remote_addr","","Returns the address of the client that sent this request.",7,null],[11,"as_reader","","Allows to read the body of the request.",7,null],[11,"into_writer","","Turns the `Request` into a writer.",7,null],[11,"respond","","Sends a response to this request.",7,null],[11,"fmt","","",7,null],[11,"drop","","",7,null],[11,"new","","Creates a new Response object.",8,{"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.",8,null],[11,"with_header","","Returns the same request, but with an additional header.",8,null],[11,"with_status_code","","Returns the same request, but with a different status code.",8,null],[11,"with_data","","Returns the same request, but with different data.",8,null],[11,"raw_print","","Prints the HTTP response to a writer.",8,null],[11,"boxed","","Turns this response into a `Response<Box<Read + Send>>`.",8,null],[11,"from_file","","Builds a new `Response` from a `File`.",8,{"inputs":[{"name":"file"}],"output":{"name":"response"}}],[11,"from_data","","",8,{"inputs":[{"name":"d"}],"output":{"name":"response"}}],[11,"from_string","","",8,{"inputs":[{"name":"s"}],"output":{"name":"response"}}],[11,"empty","","Builds an empty `Response` with the given status code.",8,{"inputs":[{"name":"s"}],"output":{"name":"response"}}],[11,"new_empty","","DEPRECATED. Use `empty` instead.",8,{"inputs":[{"name":"statuscode"}],"output":{"name":"response"}}],[11,"clone","","",8,null],[6,"ResponseBox","","A `Response` without a template parameter.",null,null],[11,"clone","","",3,null],[11,"fmt","","",3,null],[11,"clone","","",4,null],[11,"fmt","","",4,null],[11,"http","","Shortcut for a simple server on a specific address.",9,{"inputs":[{"name":"a"}],"output":{"name":"result"}}],[11,"new","","Builds a new server that listens on the specified address.",9,{"inputs":[{"name":"serverconfig"}],"output":{"name":"result"}}],[11,"incoming_requests","","Returns an iterator for all the incoming requests.",9,null],[11,"server_addr","","Returns the address the server is listening to.",9,null],[11,"num_connections","","Returns the number of clients currently connected to the server.",9,null],[11,"recv","","Blocks until an HTTP request has been submitted and returns it.",9,null],[11,"recv_timeout","","Same as `recv()` but doesn't block longer than timeout",9,null],[11,"try_recv","","Same as `recv()` but doesn't block.",9,null],[11,"next","","",10,null],[11,"drop","","",9,null]],"paths":[[3,"Header"],[3,"HTTPVersion"],[3,"StatusCode"],[3,"ServerConfig"],[3,"SslConfig"],[4,"Method"],[3,"HeaderField"],[3,"Request"],[3,"Response"],[3,"Server"],[3,"IncomingRequests"]]}; initSearch(searchIndex);