### Create a basic HTTP server Source: https://docs.rs/fire-http Demonstrates how to define a GET route and start a server using the fire-http framework. ```rust use fire::{get, Res}; struct GlobalName(String); // handle a simple get request #[get("/")] fn root(global_name: Res) -> String { format!("Hi, this is {}", global_name.0) } #[tokio::main] async fn main() { let mut server = fire::build("0.0.0.0:3000").await .expect("Failed to parse address"); server.add_data(GlobalName("fire".into())); server.add_route(root); server.ignite().await.unwrap(); } ``` -------------------------------- ### Server Initialization Source: https://docs.rs/fire-http/0.5.0/fire_http/index.html Methods for building and starting the HTTP server instance. ```APIDOC ## Server Initialization ### build(address: &str) Prepares a server instance. Returns a `FireBuilder`. ### FireBuilder::add_route(handler) Registers a handler function defined with a route macro to the server. ### FireBuilder::add_data(data) Adds shared state or resources to the server. ### Fire::ignite() Starts the server and begins listening for requests. ``` -------------------------------- ### Method Usage Examples Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Method.html Demonstrates creating a method from bytes, checking idempotency, and converting to a string representation. ```rust use http::Method; assert_eq!(Method::GET, Method::from_bytes(b"GET").unwrap()); assert!(Method::GET.is_idempotent()); assert_eq!(Method::POST.as_str(), "POST"); ``` -------------------------------- ### Import HeaderName constant Source: https://docs.rs/fire-http/0.5.0/fire_http/header/values/struct.HeaderName.html Example of importing a predefined header name constant for use in the application. ```rust use http::header::CONTENT_LENGTH; ``` -------------------------------- ### Using memory_file for Static Files Source: https://docs.rs/fire-http/0.5.0/fire_http/macro.memory_file.html Examples of defining static files with and without a cache duration using the memory_file macro. ```rust use std::time::Duration; use fire::fs::MemoryFile; use fire::memory_file; const INDEX: MemoryFile = memory_file!( "/", "../../examples/www/hello_world.html" ); const INDEX_WITH_CACHE: MemoryFile = memory_file!( "/", "../../examples/www/hello_world.html", Duration::from_secs(10) ); ``` -------------------------------- ### Register a static file route Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.StaticFileOwned.html Example of adding a static file route to a fire-http server using StaticFileOwned. ```rust use fire::fs::StaticFileOwned; #[tokio::main] async fn main() { let mut server = fire::build("127.0.0.1:0").await.unwrap(); server.add_route( StaticFileOwned::new("/files/file".into(), "./www/file".into()) ); } ``` -------------------------------- ### Usage of the get attribute macro Source: https://docs.rs/fire-http/0.5.0/fire_http/attr.get.html Apply this attribute to a function to register it as a handler for HTTP GET requests. ```rust #[get] ``` -------------------------------- ### IntoHeaderName Implementations Source: https://docs.rs/fire-http/0.5.0/fire_http/header/values/trait.IntoHeaderName.html Examples of types that implement the IntoHeaderName trait. ```rust impl IntoHeaderName for &'static str ``` ```rust impl IntoHeaderName for &HeaderName ``` ```rust impl IntoHeaderName for HeaderName ``` -------------------------------- ### Get Canonical Reason Phrase Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.StatusCode.html Retrieves the standard human-readable reason phrase for a status code. ```rust let status = http::StatusCode::OK; assert_eq!(status.canonical_reason(), Some("OK")); ``` -------------------------------- ### Get Path Component Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Retrieves the path component from a parsed Uri. ```rust let uri: Uri = "/hello/world".parse().unwrap(); assert_eq!(uri.path(), "/hello/world"); ``` ```rust let uri: Uri = "http://example.org/hello/world".parse().unwrap(); ``` -------------------------------- ### Server Initialization Source: https://docs.rs/fire-http The server is initialized using the `fire::build` function and configured via the `FireBuilder` struct. ```APIDOC ## Server Initialization ### Description Initialize the server by calling `fire::build` with an address string, then use the returned builder to add routes and data before calling `ignite()`. ### Methods - `fire::build(address: &str)`: Prepares the server builder. - `server.add_data(data)`: Adds shared state to the server. - `server.add_route(handler)`: Registers a handler function. - `server.ignite()`: Starts the server. ``` -------------------------------- ### Get HeaderValue length Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.HeaderValue.html Returns the length of the HeaderValue in bytes. ```rust let val = HeaderValue::from_static("hello"); assert_eq!(val.len(), 5); ``` -------------------------------- ### Build a server instance Source: https://docs.rs/fire-http/0.5.0/fire_http/fn.build.html Initializes a server builder using the provided socket address. ```rust pub async fn build(addr: impl ToSocketAddrs) -> Result ``` -------------------------------- ### Initialize and use StaticFiles Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.StaticFiles.html Create a new StaticFiles instance and add it to the server routes. Requires the 'fs' feature flag. ```rust use fire::fs::StaticFiles; const FILES: StaticFiles = StaticFiles::new("/files", "./www/"); #[tokio::main] async fn main() { let mut server = fire::build("127.0.0.1:0").await.unwrap(); server.add_route(FILES); } ``` -------------------------------- ### Range Struct Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.Range.html The structure definition for Range, containing start and end fields. ```rust pub struct Range { pub start: usize, pub end: Option, } ``` -------------------------------- ### Initialize a StaticFile Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.StaticFile.html Create a new StaticFile instance to serve a file at a specific URI. ```rust use fire::fs::StaticFile; const INDEX: StaticFile = StaticFile::new("/", "./www/index.html"); ``` -------------------------------- ### pub async fn build(addr: impl ToSocketAddrs) -> Result Source: https://docs.rs/fire-http/0.5.0/fire_http/fn.build.html Initializes a new server instance bound to the specified address. Returns a FireBuilder that can be used to configure the server. ```APIDOC ## build ### Description Prepares a server instance for the fire_http framework. ### Signature `pub async fn build(addr: impl ToSocketAddrs) -> Result` ### Parameters - **addr** (impl ToSocketAddrs) - Required - The socket address to bind the server to. ``` -------------------------------- ### Create New GraphQl Instance Source: https://docs.rs/fire-http/0.5.0/fire_http/graphql/struct.GraphQl.html Constructor for initializing a new GraphQl instance with a URI and a root node. ```rust pub fn new( uri: &'static str, root_node: RootNode<'static, Q, M, Sub, S>, ) -> Self ``` -------------------------------- ### Creating HeaderName from static strings Source: https://docs.rs/fire-http/0.5.0/fire_http/header/values/struct.HeaderName.html Shows how to create HeaderName instances from static strings, noting that invalid characters will cause a panic. ```rust // Parsing a standard header let hdr = HeaderName::from_static("content-length"); assert_eq!(CONTENT_LENGTH, hdr); // Parsing a custom header let CUSTOM_HEADER: &'static str = "custom-header"; let a = HeaderName::from_lowercase(b"custom-header").unwrap(); let b = HeaderName::from_static(CUSTOM_HEADER); assert_eq!(a, b); ``` ```rust // Parsing a header that contains invalid symbols: HeaderName::from_static("content{}{}length"); // This line panics! ``` -------------------------------- ### StaticFilesOwned::new Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.StaticFilesOwned.html Creates a new StaticFilesOwned instance with default caching settings. ```APIDOC ## StaticFilesOwned::new(uri: String, path: String) -> Self ### Description Creates a new static file handler that serves files from the specified local path at the given URI prefix, using default caching settings. ### Parameters - **uri** (String) - The URI prefix where files will be served. - **path** (String) - The local directory path to serve files from. ``` -------------------------------- ### State::new Source: https://docs.rs/fire-http/0.5.0/fire_http/state/struct.State.html Creates a new, empty State container. ```APIDOC ## pub fn new() -> Self ### Description Creates a new instance of the State container. ``` -------------------------------- ### Create a new Request Source: https://docs.rs/fire-http/0.5.0/fire_http/routes/type.HyperRequest.html Initializes a new Request with a specified body and default components. ```rust let request = Request::new("hello world"); assert_eq!(*request.method(), Method::GET); assert_eq!(*request.body(), "hello world"); ``` -------------------------------- ### MemoryFile::new Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.MemoryFile.html Creates a new MemoryFile instance with default caching settings. ```APIDOC ## MemoryFile::new(uri, path, bytes) ### Description Creates a new MemoryFile instance with default caching settings. ### Parameters - **uri** (&'static str) - The URI path for the file. - **path** (&'static str) - The file system path to the source file. - **bytes** (&'static [u8]) - The file content as a static byte slice. ``` -------------------------------- ### StaticFile::new Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.StaticFile.html Creates a new StaticFile handler with default caching settings. ```APIDOC ## StaticFile::new ### Description Creates a `StaticFile` instance that maps a URI to a local file path with default caching settings. ### Signature `pub const fn new(uri: &'static str, path: &'static str) -> Self` ### Parameters - **uri** (&'static str) - The URI path to serve the file from. - **path** (&'static str) - The local file system path to the file. ``` -------------------------------- ### GraphiQl::new Source: https://docs.rs/fire-http/0.5.0/fire_http/graphql/struct.GraphiQl.html Creates a new instance of the GraphiQl handler. ```APIDOC ## pub const fn new(uri: &'static str, graphql_uri: &'static str) -> Self ### Description Creates a new GraphiQl instance. The `uri` parameter specifies the path where the GraphiQL interface will be served, and `graphql_uri` specifies the endpoint where the GraphQL queries should be sent. ### Parameters - **uri** (&'static str) - Required - The path to serve the GraphiQL interface. - **graphql_uri** (&'static str) - Required - The endpoint for GraphQL requests. ``` -------------------------------- ### WebSocket::new Source: https://docs.rs/fire-http/0.5.0/fire_http/ws/struct.WebSocket.html Creates a new WebSocket instance from an upgraded connection. ```APIDOC ## pub async fn new(upgraded: Upgraded) -> Self ### Description Creates a new WebSocket instance from an upgraded connection. ### Parameters - **upgraded** (Upgraded) - Required - The upgraded connection object. ``` -------------------------------- ### StaticFiles::new Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.StaticFiles.html Creates a new StaticFiles handler with default caching settings. ```APIDOC ## pub const fn new(uri: &'static str, path: &'static str) -> Self ### Description Creates a `StaticFiles` handler that serves files from a local directory at a specific URI path with default caching settings. ### Parameters - **uri** (&'static str) - The base URI path where files will be served. - **path** (&'static str) - The local filesystem path to serve files from. ``` -------------------------------- ### pub async fn route(&self, req: &mut Request) -> Option> Source: https://docs.rs/fire-http/0.5.0/fire_http/struct.FirePit.html Routes an incoming request to the appropriate handler. ```APIDOC ### Method `route(&self, req: &mut Request) -> Option>` ### Description Routes the provided request to the configured routes and returns the result. This is useful for testing or niche applications where manual request routing is required. Returns `None` if no matching route is found. ``` -------------------------------- ### Create Request from parts Source: https://docs.rs/fire-http/0.5.0/fire_http/routes/type.HyperRequest.html Constructs a Request using existing parts and a body. ```rust let request = Request::new("hello world"); let (mut parts, body) = request.into_parts(); parts.method = Method::POST; let request = Request::from_parts(parts, body); ``` -------------------------------- ### Create a new GraphiQl instance Source: https://docs.rs/fire-http/0.5.0/fire_http/graphql/struct.GraphiQl.html Constructor for creating a new GraphiQl instance with specified URIs. ```rust pub const fn new(uri: &'static str, graphql_uri: &'static str) -> Self ``` -------------------------------- ### pub fn host(&self) -> Option<&str> Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Retrieves the host subcomponent of the authority. ```APIDOC ## pub fn host(&self) -> Option<&str> ### Description Get the host of this `Uri`. The host subcomponent is identified by an IP literal, an IPv4 address, or a registered name. ### Returns - **Option<&str>** - The host string if present, otherwise None. ``` -------------------------------- ### pub fn query(&self) -> Option<&str> Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Retrieves the query string component of the URI. ```APIDOC ## pub fn query(&self) -> Option<&str> ### Description Get the query string of this `Uri`, starting after the `?`. The query component contains non-hierarchical data. ### Returns - **Option<&str>** - The query string if present, otherwise None. ``` -------------------------------- ### GraphQl::new Source: https://docs.rs/fire-http/0.5.0/fire_http/graphql/struct.GraphQl.html Creates a new instance of the GraphQl handler for a specific URI and root node. ```APIDOC ## GraphQl::new ### Description Initializes a new GraphQL route handler. ### Signature `pub fn new(uri: &'static str, root_node: RootNode<'static, Q, M, Sub, S>) -> Self` ### Parameters - **uri** (&'static str) - The URI path for the GraphQL endpoint. - **root_node** (RootNode) - The GraphQL root node containing query, mutation, and subscription definitions. ``` -------------------------------- ### Build a Uri Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Creates a new Uri instance using the builder pattern. ```rust use http::Uri; let uri = Uri::builder() .scheme("https") .authority("hyper.rs") .path_and_query("/") .build() .unwrap(); ``` -------------------------------- ### Mime Instance Methods Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Mime.html Methods available on Mime instances to retrieve string representations. ```APIDOC ## Mime Instance Methods ### extension() Returns the file extension associated with the Mime type as a &'static str. ### as_str() Returns the MIME type string representation as a &'static str. ### as_str_with_maybe_charset() Returns the MIME type string representation, potentially including charset information, as a &'static str. ``` -------------------------------- ### PartialFile::open Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.PartialFile.html Opens a file at the specified path for a given byte range. This method is available when the 'fs' feature is enabled. ```APIDOC ## pub async fn open

(path: P, range: Range) -> Result ### Description Opens a file at the specified path for a given byte range. Returns a Result containing the PartialFile instance or an error if the path is not found. ### Parameters - **path** (P: AsRef) - Required - The path to the file to be opened. - **range** (Range) - Required - The byte range to access within the file. ``` -------------------------------- ### serve_file Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/fn.serve_file.html Serves a file from the specified path as an HTTP response. This function is available under the 'fs' crate feature. ```APIDOC ## serve_file ### Description Serves a file from the filesystem. Returns an io::Error if the path is a directory. ### Signature `pub async fn serve_file(path: impl AsRef, req: &Request, caching: Option) -> Result` ### Parameters - **path** (impl AsRef) - Required - The path to the file to be served. - **req** (&Request) - Required - The incoming HTTP request. - **caching** (Option) - Optional - Configuration for file caching. ### Requirements - **Feature Flag**: Requires the `fs` feature to be enabled. ``` -------------------------------- ### Mime::from_extension Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Mime.html Creates a Mime type instance from a given file extension string. ```APIDOC ## pub fn from_extension(ext: &str) -> Option ### Description Creates a Mime Type from a file extension. ### Parameters - **ext** (&str) - Required - The file extension string (e.g., "json", "html"). ### Returns - **Option** - Returns Some(Mime) if the extension is recognized, otherwise None. ``` -------------------------------- ### serve_file Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/index.html A function to serve a file from the filesystem. Returns an io::Error if the path is a directory. ```APIDOC ## serve_file ### Description Serves a file from the filesystem. If the provided path points to a directory, it returns an io::Error indicating the file was not found. ``` -------------------------------- ### Initialize StaticFilesOwned in a route Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.StaticFilesOwned.html Demonstrates how to add a StaticFilesOwned handler to a fire-http server route. ```rust use fire::fs::StaticFilesOwned; #[tokio::main] async fn main() { let mut server = fire::build("127.0.0.1:0").await.unwrap(); server.add_route( StaticFilesOwned::new("/files".into(), "./www/".into()) ); } ``` -------------------------------- ### Create a new FireService Source: https://docs.rs/fire-http/0.5.0/fire_http/service/struct.FireService.html Initializes a new instance of FireService to be used with a hyper server. ```rust pub fn new(pit: FirePit, address: SocketAddr) -> Self ``` -------------------------------- ### serve_memory_file Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/fn.serve_memory_file.html Serves a file from a static byte slice in memory as an HTTP response. ```APIDOC ## serve_memory_file ### Description Serves a file from memory. This function is available when the `fs` feature is enabled. ### Signature `pub fn serve_memory_file(path: &'static str, bytes: &'static [u8], req: &Request, caching: Option) -> Result` ### Parameters - **path** (&'static str) - The path associated with the file. - **bytes** (&'static [u8]) - The file content stored in memory. - **req** (&Request) - The incoming HTTP request. - **caching** (Option) - Optional caching configuration for the response. ``` -------------------------------- ### serve_file function signature Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/fn.serve_file.html The function signature for serving a file, requiring a path, request, and optional caching configuration. ```rust pub async fn serve_file( path: impl AsRef, req: &Request, caching: Option, ) -> Result ``` -------------------------------- ### Basic StatusCode Usage Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.StatusCode.html Demonstrates creating status codes from integers, accessing their numeric values, and checking success status. ```rust use http::StatusCode; assert_eq!(StatusCode::from_u16(200).unwrap(), StatusCode::OK); assert_eq!(StatusCode::NOT_FOUND.as_u16(), 404); assert!(StatusCode::OK.is_success()); ``` -------------------------------- ### Parse HeaderName from static string Source: https://docs.rs/fire-http/0.5.0/fire_http/header/values/struct.HeaderName.html Demonstrates creating a HeaderName from a static string. Note that providing uppercase characters will cause a panic. ```rust // Parsing a header that contains invalid uppercase characters. let a = HeaderName::from_static("foobar"); let b = HeaderName::from_static("FOOBAR"); // This line panics! ``` -------------------------------- ### StaticFileOwned::new Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.StaticFileOwned.html Creates a new static file handler with default caching settings. ```APIDOC ## pub const fn new(uri: String, path: String) -> Self ### Description Creates a `StaticFile` handler with default caching settings. This handler can be added to a server route to serve a file from the local filesystem. ### Parameters - **uri** (String) - The URI path to map the file to. - **path** (String) - The local filesystem path to the file. ``` -------------------------------- ### Verify URI Query String Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Check the query component of a URI. ```rust assert_eq!(uri.query(), Some("key=value&foo=bar")); ``` -------------------------------- ### Define a MemoryFile with the memory_file! macro Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.MemoryFile.html Use the memory_file! macro to associate a URI with a file path for static serving. ```rust use fire::fs::MemoryFile; use fire::memory_file; const INDEX: MemoryFile = memory_file!( "/", "../../examples/www/hello_world.html" ); ``` -------------------------------- ### pub fn data(&self) -> &Resources Source: https://docs.rs/fire-http/0.5.0/fire_http/struct.FirePit.html Retrieves the resources associated with the FirePit instance. ```APIDOC ### Method `data(&self) -> &Resources` ### Description Returns a reference to the resources managed by this FirePit instance. ``` -------------------------------- ### X_DNS_PREFETCH_CONTROL Constant Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/header/constant.X_DNS_PREFETCH_CONTROL.html The constant definition for the DNS prefetch control header name. ```rust pub const X_DNS_PREFETCH_CONTROL: HeaderName; ``` -------------------------------- ### TryFrom> for Uri Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Converts a byte vector into a Uri instance. ```APIDOC ## fn try_from(vec: Vec) -> Result>>::Error> ### Description Performs the conversion from a byte vector to a Uri. ### Parameters - **vec** (Vec) - The input byte vector to convert. ### Returns - **Result** - Returns the Uri on success, or an error if the bytes are invalid. ``` -------------------------------- ### StaticFilesOwned::no_cache Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.StaticFilesOwned.html Creates a new StaticFilesOwned instance with no caching enabled. ```APIDOC ## StaticFilesOwned::no_cache(uri: String, path: String) -> Self ### Description Creates a new static file handler that serves files from the specified local path at the given URI prefix, explicitly disabling caching. ### Parameters - **uri** (String) - The URI prefix where files will be served. - **path** (String) - The local directory path to serve files from. ``` -------------------------------- ### ignite Source: https://docs.rs/fire-http/0.5.0/fire_http/struct.Fire.html Ignites the Fire instance. ```APIDOC ## pub async fn ignite(self) -> Result<()> ### Description Consumes the Fire instance and performs the ignition process asynchronously. ### Returns - **Result<()>** - Returns Ok(()) on success, or an error if ignition fails. ``` -------------------------------- ### TryFrom for Uri Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Converts a String into a Uri instance. ```APIDOC ## fn try_from(t: String) -> Result>::Error> ### Description Performs the conversion from a String to a Uri. ### Parameters - **t** (String) - The input string to convert. ### Returns - **Result** - Returns the Uri on success, or an error if the string is invalid. ``` -------------------------------- ### Parse and Inspect URIs Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Demonstrates parsing string literals into Uri objects and accessing their components. ```rust use http::Uri; let uri = "/foo/bar?baz".parse::().unwrap(); assert_eq!(uri.path(), "/foo/bar"); assert_eq!(uri.query(), Some("baz")); assert_eq!(uri.host(), None); let uri = "https://www.rust-lang.org/install.html".parse::().unwrap(); assert_eq!(uri.scheme_str(), Some("https")); assert_eq!(uri.host(), Some("www.rust-lang.org")); assert_eq!(uri.path(), "/install.html"); ``` -------------------------------- ### GraphQlContext Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/graphql/struct.GraphQlContext.html The structure definition for GraphQlContext. ```rust pub struct GraphQlContext { /* private fields */ } ``` -------------------------------- ### Prepare Struct Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/extractor/struct.Prepare.html The definition of the Prepare struct, which is marked as non-exhaustive. ```rust #[non_exhaustive] pub struct Prepare<'a> { pub name: &'a str, pub header: &'a RequestHeader, pub params: &'a PathParams, pub state: &'a mut State, pub resources: &'a Resources, } ``` -------------------------------- ### GraphiQl Source: https://docs.rs/fire-http/0.5.0/fire_http/graphql/index.html A structure providing the GraphiQL interface for testing and exploration. ```APIDOC ## GraphiQl Interface ### Description Provides the GraphiQL interactive environment for GraphQL queries. ### Usage Available on crate feature `graphql` only. ``` -------------------------------- ### pub fn port(&self) -> Option> Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Retrieves the port subcomponent of the authority. ```APIDOC ## pub fn port(&self) -> Option> ### Description Get the port part of this `Uri`. The port subcomponent is designated by an optional port number following the host. ### Returns - **Option>** - The port object if present, otherwise None. ``` -------------------------------- ### pub fn scheme_str(&self) -> Option<&str> Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Retrieves the scheme component of the URI as a string slice. ```APIDOC ## pub fn scheme_str(&self) -> Option<&str> ### Description Get the scheme of this `Uri` as a `&str`. ### Returns - **Option<&str>** - The scheme string if present, otherwise None. ``` -------------------------------- ### pub fn scheme(&self) -> Option<&Scheme> Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Retrieves the scheme component of the URI, such as 'http' or 'https'. Returns None if the URI is relative or lacks a scheme. ```APIDOC ## pub fn scheme(&self) -> Option<&Scheme> ### Description Get the scheme of this `Uri`. The URI scheme refers to a specification for assigning identifiers within that scheme. Only absolute URIs contain a scheme component. ### Returns - **Option<&Scheme>** - The scheme if present, otherwise None. ``` -------------------------------- ### MemoryFile::no_cache Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.MemoryFile.html Creates a new MemoryFile instance configured with no caching. ```APIDOC ## MemoryFile::no_cache(uri, path, bytes) ### Description Creates a new MemoryFile instance configured with no caching. ### Parameters - **uri** (&'static str) - The URI path for the file. - **path** (&'static str) - The file system path to the source file. - **bytes** (&'static [u8]) - The file content as a static byte slice. ``` -------------------------------- ### Create Uri from Parts Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Converts a Parts struct into a Uri for both relative and absolute URIs. ```rust let mut parts = Parts::default(); parts.path_and_query = Some("/foo".parse().unwrap()); let uri = Uri::from_parts(parts).unwrap(); assert_eq!(uri.path(), "/foo"); assert!(uri.scheme().is_none()); assert!(uri.authority().is_none()); ``` ```rust let mut parts = Parts::default(); parts.scheme = Some("http".parse().unwrap()); parts.authority = Some("foo.com".parse().unwrap()); parts.path_and_query = Some("/foo".parse().unwrap()); let uri = Uri::from_parts(parts).unwrap(); assert_eq!(uri.scheme().unwrap().as_str(), "http"); assert_eq!(uri.authority().unwrap(), "foo.com"); assert_eq!(uri.path(), "/foo"); ``` -------------------------------- ### pub fn port_u16(&self) -> Option Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Retrieves the port number as a u16 integer. ```APIDOC ## pub fn port_u16(&self) -> Option ### Description Get the port of this `Uri` as a `u16`. ### Returns - **Option** - The port number if present, otherwise None. ``` -------------------------------- ### Accessing the URI host Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Retrieve the host subcomponent of the authority, which is case-insensitive. ```rust let uri: Uri = "http://example.org:80/hello/world".parse().unwrap(); assert_eq!(uri.host(), Some("example.org")); ``` ```rust let uri: Uri = "/hello/world".parse().unwrap(); assert!(uri.host().is_none()); ``` -------------------------------- ### Implement Sync for GraphQl Source: https://docs.rs/fire-http/0.5.0/fire_http/graphql/struct.GraphQl.html Implementation of the Sync trait for the GraphQl struct. ```rust impl Sync for GraphQl where Q: Sync, >::TypeInfo: Sync, M: Sync, >::TypeInfo: Sync, Sub: Sync, >::TypeInfo: Sync, S: Sync, ``` -------------------------------- ### Chain results with and Source: https://docs.rs/fire-http/0.5.0/fire_http/error/type.Result.html Returns the provided result if the current result is Ok, otherwise returns the current Err. ```rust let x: Result = Ok(2); let y: Result<&str, &str> = Err("late error"); assert_eq!(x.and(y), Err("late error")); let x: Result = Err("early error"); let y: Result<&str, &str> = Ok("foo"); assert_eq!(x.and(y), Err("early error")); let x: Result = Err("not a 2"); let y: Result<&str, &str> = Err("late error"); assert_eq!(x.and(y), Err("not a 2")); let x: Result = Ok(2); let y: Result<&str, &str> = Ok("different result type"); assert_eq!(x.and(y), Ok("different result type")); ``` -------------------------------- ### ACCEPT Constant Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/header/constant.ACCEPT.html The definition of the ACCEPT constant as a HeaderName. ```rust pub const ACCEPT: HeaderName; ``` -------------------------------- ### #[head] Source: https://docs.rs/fire-http/0.5.0/fire_http/attr.head.html The head attribute macro is used to annotate functions that handle HTTP HEAD requests. ```APIDOC ## #[head] ### Description The `#[head]` attribute macro is used to register a function as a handler for HTTP HEAD requests within the `fire-http` framework. ### Usage ```rust #[head("/path")] async fn handler() { // Logic for HEAD request } ``` ``` -------------------------------- ### Displaying a StatusCode Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.StatusCode.html Formats the status code as a string, including its canonical reason phrase. ```rust assert_eq!(format!("{}", StatusCode::OK), "200 OK"); ``` -------------------------------- ### Access and modify extensions Source: https://docs.rs/fire-http/0.5.0/fire_http/routes/type.HyperRequest.html Methods to manage request-level extensions. ```rust let request: Request<()> = Request::default(); assert!(request.extensions().get::().is_none()); ``` ```rust let mut request: Request<()> = Request::default(); request.extensions_mut().insert("hello"); assert_eq!(request.extensions().get(), Some(&"hello")); ``` -------------------------------- ### extractor_prepare macro definition Source: https://docs.rs/fire-http/0.5.0/fire_http/macro.extractor_prepare.html The syntax definition for the extractor_prepare macro, showing the available patterns. ```rust macro_rules! extractor_prepare { () => { ... }; (|$prepare:ident| $block:block) => { ... }; } ``` -------------------------------- ### SEC_WEBSOCKET_ACCEPT Constant Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/header/constant.SEC_WEBSOCKET_ACCEPT.html The constant definition for the Sec-WebSocket-Accept header name. ```rust pub const SEC_WEBSOCKET_ACCEPT: HeaderName; ``` -------------------------------- ### pub fn authority(&self) -> Option<&Authority> Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Retrieves the authority component of the URI, which typically includes the host and port. ```APIDOC ## pub fn authority(&self) -> Option<&Authority> ### Description Get the authority of this `Uri`. The authority is a hierarchical element for naming authority such that the remainder of the URI is delegated to that authority. ### Returns - **Option<&Authority>** - The authority component if present, otherwise None. ``` -------------------------------- ### Accessing the URI query string Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Retrieve the query string component of the URI. ```rust let uri: Uri = "http://example.org/hello/world?key=value".parse().unwrap(); assert_eq!(uri.query(), Some("key=value")); ``` ```rust let uri: Uri = "/hello/world?key=value&foo=bar".parse().unwrap(); ``` -------------------------------- ### TryFrom Conversions Source: https://docs.rs/fire-http/0.5.0/fire_http/header/values/struct.HeaderName.html HeaderName can be created from various input types using the TryFrom trait. These conversions may return an InvalidHeaderName error if the input is not a valid HTTP header name. ```APIDOC ## TryFrom Implementations ### Description Converts various types into a `HeaderName` instance. These methods are fallible and return a `Result`. ### Supported Types - `&String` - `&[u8]` - `&str` - `String` - `Vec` ### Example ```rust let header = HeaderName::try_from("Content-Type"); ``` ``` -------------------------------- ### memory_file Macro Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/macro.memory_file.html The macro signature for defining memory-backed files with optional cache duration. ```rust macro_rules! memory_file { ($uri:expr, $path:expr) => { ... }; ($uri:expr, $path:expr, $duration:expr) => { ... }; } ``` -------------------------------- ### Accessing the URI path Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Retrieve the path component of a URI. ```rust assert_eq!(uri.path(), "/hello/world"); ``` -------------------------------- ### Compare HeaderName with Strings Source: https://docs.rs/fire-http/0.5.0/fire_http/header/values/struct.HeaderName.html Demonstrates case-insensitive comparison between a HeaderName constant and string literals. ```rust assert_eq!(CONTENT_LENGTH, "content-length"); assert_eq!(CONTENT_LENGTH, "Content-Length"); assert_ne!(CONTENT_LENGTH, "content length"); ``` ```rust use http::header::CONTENT_LENGTH; assert_eq!(CONTENT_LENGTH, "content-length"); assert_eq!(CONTENT_LENGTH, "Content-Length"); assert_ne!(CONTENT_LENGTH, "content length"); ``` -------------------------------- ### Expect Result Value Source: https://docs.rs/fire-http/0.5.0/fire_http/error/type.Result.html Returns the Ok value or panics with a provided message. ```rust let x: Result = Err("emergency failure"); x.expect("Testing expect"); // panics with `Testing expect: emergency failure` ``` ```rust let path = std::env::var("IMPORTANT_PATH") .expect("env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`"); ``` -------------------------------- ### Implement Caching in a Route Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.Caching.html Use Caching to check for Etag matches in request headers and set appropriate response headers. Requires the 'fs' feature flag. ```rust use fire::{get, Request}; use fire::fs::Caching; use fire::into::IntoResponse; use std::cell::LazyCell; const INDEX_CACHE: LazyCell = LazyCell::new(|| { Caching::default() }); #[get("/")] fn index(req: &mut Request) -> Response { let cache = INDEX_CACHE.clone(); if cache.if_none_match(req.header()) { return cache.into_response() } let mut resp = Response::html("

Hello, World!

"); cache.complete_header(&mut resp.header); resp } ``` -------------------------------- ### UPGRADE Header Constant Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/header/constant.UPGRADE.html The constant represents the standard HTTP Upgrade header name. ```rust pub const UPGRADE: HeaderName; ``` -------------------------------- ### Accessing the URI port Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Retrieve the port subcomponent of the authority. ```rust let uri: Uri = "http://example.org:80/hello/world".parse().unwrap(); let port = uri.port().unwrap(); assert_eq!(port.as_u16(), 80); ``` ```rust let uri: Uri = "http://example.org/hello/world".parse().unwrap(); assert!(uri.port().is_none()); ``` ```rust let uri: Uri = "/hello/world".parse().unwrap(); assert!(uri.port().is_none()); ``` -------------------------------- ### Define a POST handler with the post attribute Source: https://docs.rs/fire-http/0.5.0/fire_http/attr.post.html Apply the post attribute to a function to register it as a handler for POST requests. ```rust #[post] ``` -------------------------------- ### GraphiQl Struct Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/graphql/struct.GraphiQl.html The internal structure definition for GraphiQl. ```rust pub struct GraphiQl { /* private fields */ } ``` -------------------------------- ### ACCESS_CONTROL_ALLOW_CREDENTIALS Constant Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/header/constant.ACCESS_CONTROL_ALLOW_CREDENTIALS.html The constant definition for the Access-Control-Allow-Credentials header name. ```rust pub const ACCESS_CONTROL_ALLOW_CREDENTIALS: HeaderName; ``` -------------------------------- ### StaticFile::no_cache Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.StaticFile.html Creates a new StaticFile handler with no caching enabled. ```APIDOC ## StaticFile::no_cache ### Description Creates a `StaticFile` instance that maps a URI to a local file path with caching disabled. ### Signature `pub const fn no_cache(uri: &'static str, path: &'static str) -> Self` ### Parameters - **uri** (&'static str) - The URI path to serve the file from. - **path** (&'static str) - The local file system path to the file. ``` -------------------------------- ### Copying and Cloning Result Contents Source: https://docs.rs/fire-http/0.5.0/fire_http/error/type.Result.html Methods to copy or clone the contents of an Ok variant in a Result containing references. ```rust let val = 12; let x: Result<&i32, i32> = Ok(&val); assert_eq!(x, Ok(&12)); let copied = x.copied(); assert_eq!(copied, Ok(12)); ``` ```rust let val = 12; let x: Result<&i32, i32> = Ok(&val); assert_eq!(x, Ok(&12)); let cloned = x.cloned(); assert_eq!(cloned, Ok(12)); ``` ```rust let mut val = 12; let x: Result<&mut i32, i32> = Ok(&mut val); assert_eq!(x, Ok(&mut 12)); let copied = x.copied(); assert_eq!(copied, Ok(12)); ``` ```rust let mut val = 12; let x: Result<&mut i32, i32> = Ok(&mut val); assert_eq!(x, Ok(&mut 12)); let cloned = x.cloned(); assert_eq!(cloned, Ok(12)); ``` -------------------------------- ### Accessing the URI scheme as a string Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Retrieve the scheme component as a string slice. ```rust let uri: Uri = "http://example.org/hello/world".parse().unwrap(); assert_eq!(uri.scheme_str(), Some("http")); ``` -------------------------------- ### MemoryFile::cache_with_age Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.MemoryFile.html Creates a new MemoryFile instance with a specified cache duration. ```APIDOC ## MemoryFile::cache_with_age(uri, path, bytes, max_age) ### Description Creates a new MemoryFile instance with a specified cache duration. ### Parameters - **uri** (&'static str) - The URI path for the file. - **path** (&'static str) - The file system path to the source file. - **bytes** (&'static [u8]) - The file content as a static byte slice. - **max_age** (Duration) - The duration for which the file should be cached. ``` -------------------------------- ### StaticFiles::no_cache Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.StaticFiles.html Creates a new StaticFiles handler with no caching enabled. ```APIDOC ## pub const fn no_cache(uri: &'static str, path: &'static str) -> Self ### Description Creates a `StaticFiles` handler that serves files without applying caching headers. ### Parameters - **uri** (&'static str) - The base URI path where files will be served. - **path** (&'static str) - The local filesystem path to serve files from. ``` -------------------------------- ### Convert Result to Iterator Source: https://docs.rs/fire-http/0.5.0/fire_http/error/type.Result.html Shows how to use into_iter on a Result to produce an iterator that yields the contained value if Ok, or nothing if Err. ```rust let x: Result = Ok(5); let v: Vec = x.into_iter().collect(); assert_eq!(v, [5]); let x: Result = Err("nothing!"); let v: Vec = x.into_iter().collect(); assert_eq!(v, []); ``` -------------------------------- ### Route Trait Implementation Methods Source: https://docs.rs/fire-http/0.5.0/fire_http/graphql/struct.GraphQl.html Methods implemented for the Route trait to handle request validation, path definition, and request execution. ```rust fn validate_requirements(&self, _params: &ParamsNames<'_>, _data: &Resources) ``` ```rust fn path(&self) -> RoutePath ``` ```rust fn call<'a>( &'a self, req: &'a mut Request, _params: &'a PathParams, data: &'a Resources, ) -> PinnedFuture<'a, Result> ⓘ ``` -------------------------------- ### Caching::new Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.Caching.html Creates a new Caching instance with a specified maximum age. ```APIDOC ## pub fn new(max_age: Duration) -> Self ### Description Creates a new Caching instance with the specified maximum age for the cache. ### Parameters - **max_age** (Duration) - Required - The duration for which the cache should be considered valid. ``` -------------------------------- ### FROM constant definition Source: https://docs.rs/fire-http/0.5.0/fire_http/header/constant.FROM.html The definition of the FROM constant as a HeaderName. ```rust pub const FROM: HeaderName; ``` -------------------------------- ### Reference Conversion with as_ref and as_mut Source: https://docs.rs/fire-http/0.5.0/fire_http/error/type.Result.html Converts a Result to a Result containing references to the original values. ```rust let x: Result = Ok(2); assert_eq!(x.as_ref(), Ok(&2)); let x: Result = Err("Error"); assert_eq!(x.as_ref(), Err(&"Error")); ``` ```rust fn mutate(r: &mut Result) { match r.as_mut() { Ok(v) => *v = 42, Err(e) => *e = 0, } } let mut x: Result = Ok(2); mutate(&mut x); assert_eq!(x.unwrap(), 42); let mut x: Result = Err(13); mutate(&mut x); assert_eq!(x.unwrap_err(), 0); ``` -------------------------------- ### Create Uri from Static String Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Converts a static string slice into a Uri without copying, panicking if the input is invalid. ```rust let uri = Uri::from_static("http://example.com/foo"); assert_eq!(uri.host().unwrap(), "example.com"); assert_eq!(uri.path(), "/foo"); ``` -------------------------------- ### EXPECT Constant Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/header/constant.EXPECT.html The constant definition for the EXPECT header name. ```rust pub const EXPECT: HeaderName; ``` -------------------------------- ### HeaderName::from_static Source: https://docs.rs/fire-http/0.5.0/fire_http/header/values/struct.HeaderName.html Converts a static string to an HTTP header name. ```APIDOC ## pub const fn from_static(src: &'static str) -> HeaderName ### Description Converts a static string to a HTTP header name. The string must contain only lowercase characters, numerals, and symbols as per the HTTP/2.0 specification. ### Panics This function panics when the static string is an invalid header. ``` -------------------------------- ### ALLOW Constant Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/header/constant.ALLOW.html The definition of the ALLOW constant as a HeaderName. ```rust pub const ALLOW: HeaderName; ``` -------------------------------- ### Implement Freeze for GraphQl Source: https://docs.rs/fire-http/0.5.0/fire_http/graphql/struct.GraphQl.html Implementation of the Freeze trait for the GraphQl struct. ```rust impl Freeze for GraphQl where Q: Freeze, >::TypeInfo: Freeze, M: Freeze, >::TypeInfo: Freeze, Sub: Freeze, >::TypeInfo: Freeze, ``` -------------------------------- ### IntoPathBuf Implementation for &str Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/trait.IntoPathBuf.html Implementation of the IntoPathBuf trait for string slices. ```rust impl IntoPathBuf for &str Source§ #### fn into_path_buf(self) -> Result ``` -------------------------------- ### StaticFileOwned::no_cache Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.StaticFileOwned.html Creates a new static file handler with no caching enabled. ```APIDOC ## pub const fn no_cache(uri: String, path: String) -> Self ### Description Creates a `StaticFile` handler configured to serve files without caching. ### Parameters - **uri** (String) - The URI path to map the file to. - **path** (String) - The local filesystem path to the file. ``` -------------------------------- ### Create a new PinnedFuture Source: https://docs.rs/fire-http/0.5.0/fire_http/util/struct.PinnedFuture.html Constructor for creating a new PinnedFuture from a future that implements Future and Send. ```rust pub fn new(future: F) -> Self where F: Future + Send + 'a, ``` -------------------------------- ### Parse Relative URI Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.Uri.html Parse a string into a Uri and verify it has no query string. ```rust let uri: Uri = "/hello/world".parse().unwrap(); assert!(uri.query().is_none()); ``` -------------------------------- ### StaticFilesOwned::cache_with_age Source: https://docs.rs/fire-http/0.5.0/fire_http/fs/struct.StaticFilesOwned.html Creates a new StaticFilesOwned instance with a custom max-age cache setting. ```APIDOC ## StaticFilesOwned::cache_with_age(uri: String, path: String, max_age: Duration) -> Self ### Description Creates a new static file handler that serves files from the specified local path at the given URI prefix, with a custom cache duration. ### Parameters - **uri** (String) - The URI prefix where files will be served. - **path** (String) - The local directory path to serve files from. - **max_age** (Duration) - The duration for which the files should be cached. ``` -------------------------------- ### ACCEPT_LANGUAGE Constant Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/header/constant.ACCEPT_LANGUAGE.html The definition of the ACCEPT_LANGUAGE constant as a HeaderName. ```rust pub const ACCEPT_LANGUAGE: HeaderName; ``` -------------------------------- ### GraphQl Source: https://docs.rs/fire-http/0.5.0/fire_http/graphql/index.html A structure for handling GraphQL operations. Note that this interface only supports POST requests. ```APIDOC ## GraphQL Interface ### Description This structure handles GraphQL operations. It is explicitly noted that this interface only supports POST requests. ### Usage Available on crate feature `graphql` only. ``` -------------------------------- ### memory_file! macro Source: https://docs.rs/fire-http/0.5.0/fire_http/macro.memory_file.html A macro used to define a static file handler that loads the file content into the binary at compile time. It requires the 'fs' feature flag. ```APIDOC ## memory_file! macro ### Description Creates a static get handler that serves a file loaded into the binary at compile time. ### Signature `memory_file!($uri:expr, $path:expr)` `memory_file!($uri:expr, $path:expr, $duration:expr)` ### Parameters - **$uri** (expr) - The URI path to serve the file from. - **$path** (expr) - The filesystem path to the file to be embedded. - **$duration** (expr) - Optional cache duration for the file. ### Example ```rust use std::time::Duration; use fire::fs::MemoryFile; use fire::memory_file; const INDEX: MemoryFile = memory_file!( "/", "../../examples/www/hello_world.html" ); const INDEX_WITH_CACHE: MemoryFile = memory_file!( "/", "../../examples/www/hello_world.html", Duration::from_secs(10) ); ``` ``` -------------------------------- ### Implement Send for GraphQl Source: https://docs.rs/fire-http/0.5.0/fire_http/graphql/struct.GraphQl.html Implementation of the Send trait for the GraphQl struct. ```rust impl Send for GraphQl where Q: Send, >::TypeInfo: Send, M: Send, >::TypeInfo: Send, Sub: Send, >::TypeInfo: Send, S: Send, ``` -------------------------------- ### Function Signature for convert_hyper_req_to_fire_header Source: https://docs.rs/fire-http/0.5.0/fire_http/util/fn.convert_hyper_req_to_fire_header.html The function signature for converting a Hyper request to a fire_http header. ```rust pub fn convert_hyper_req_to_fire_header( req: &Request, address: SocketAddr, ) -> Result ``` -------------------------------- ### LogWebSocketReturn Implementation for Unit Type Source: https://docs.rs/fire-http/0.5.0/fire_http/ws/trait.LogWebSocketReturn.html Implementation of the trait for the unit type (). ```rust impl LogWebSocketReturn for () { fn should_log_error(&self) -> bool } ``` -------------------------------- ### CONNECTION Constant Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/header/constant.CONNECTION.html The definition of the CONNECTION constant within the fire_http::header module. ```rust pub const CONNECTION: HeaderName; ``` -------------------------------- ### SERVER Header Constant Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/header/constant.SERVER.html Represents the SERVER header name. Avoid overly detailed values to prevent leaking internal implementation details. ```rust pub const SERVER: HeaderName; ``` -------------------------------- ### Retrieve StatusCode as String Source: https://docs.rs/fire-http/0.5.0/fire_http/header/struct.StatusCode.html Returns the numerical representation of the status code as a string slice. ```rust let status = http::StatusCode::OK; assert_eq!(status.as_str(), "200"); ``` -------------------------------- ### PartialEq Comparisons Source: https://docs.rs/fire-http/0.5.0/fire_http/header/values/struct.HeaderName.html HeaderName supports case-insensitive equality comparisons with string types. ```APIDOC ## PartialEq Comparisons ### Description Allows for case-insensitive comparison between `HeaderName` and string types (`&str` or `&HeaderName`). ### Example ```rust use http::header::CONTENT_LENGTH; assert_eq!(CONTENT_LENGTH, "content-length"); assert_eq!(CONTENT_LENGTH, "Content-Length"); ``` ``` -------------------------------- ### Implement UnsafeUnpin for GraphQl Source: https://docs.rs/fire-http/0.5.0/fire_http/graphql/struct.GraphQl.html Implementation of the UnsafeUnpin trait for the GraphQl struct. ```rust impl UnsafeUnpin for GraphQl where Q: UnsafeUnpin, >::TypeInfo: UnsafeUnpin, M: UnsafeUnpin, >::TypeInfo: UnsafeUnpin, Sub: UnsafeUnpin, >::TypeInfo: UnsafeUnpin, ``` -------------------------------- ### Resources struct definition Source: https://docs.rs/fire-http/0.5.0/fire_http/resources/struct.Resources.html The primary definition of the Resources struct. ```rust pub struct Resources { /* private fields */ } ``` -------------------------------- ### HOST Constant Definition Source: https://docs.rs/fire-http/0.5.0/fire_http/header/constant.HOST.html The definition of the HOST constant as a HeaderName type. ```rust pub const HOST: HeaderName; ```