# Table of Contents - [rocket - Rust](#rocket-rust) - ["" Search - Rust](#-search-rust) - [Settings](#settings) - [Help](#help) - [rocket_dyn_templates - Rust](#rocket-dyn-templates-rust) - [rocket_sync_db_pools - Rust](#rocket-sync-db-pools-rust) - [rocket::serde::msgpack - Rust](#rocket-serde-msgpack-rust) - [rocket_db_pools - Rust](#rocket-db-pools-rust) - [rocket_ws - Rust](#rocket-ws-rust) - [rocket::mtls - Rust](#rocket-mtls-rust) - [rocket::serde::uuid - Rust](#rocket-serde-uuid-rust) - [rocket::serde::json - Rust](#rocket-serde-json-rust) - [rocket::fairing - Rust](#rocket-fairing-rust) - [rocket::error - Rust](#rocket-error-rust) - [rocket::config - Rust](#rocket-config-rust) - [rocket::catcher - Rust](#rocket-catcher-rust) - [rocket::data - Rust](#rocket-data-rust) - [rocket::local - Rust](#rocket-local-rust) - [rocket::fs - Rust](#rocket-fs-rust) - [rocket::outcome - Rust](#rocket-outcome-rust) - [rocket::form - Rust](#rocket-form-rust) - [Phase in rocket - Rust](#phase-in-rocket-rust) - [rocket::request - Rust](#rocket-request-rust) - [Ignite in rocket - Rust](#ignite-in-rocket-rust) - [Sentinel in rocket - Rust](#sentinel-in-rocket-rust) - [Data in rocket - Rust](#data-in-rocket-rust) - [rocket::response - Rust](#rocket-response-rust) - [FromFormField in rocket - Rust](#fromformfield-in-rocket-rust) - [UriDisplayPath in rocket - Rust](#uridisplaypath-in-rocket-rust) - [UriDisplayQuery in rocket - Rust](#uridisplayquery-in-rocket-rust) - [Responder in rocket - Rust](#responder-in-rocket-rust) - [FromFormField in rocket::form - Rust](#fromformfield-in-rocket-form-rust) - [FromForm in rocket::form - Rust](#fromform-in-rocket-form-rust) - [catchers in rocket - Rust](#catchers-in-rocket-rust) - [routes in rocket - Rust](#routes-in-rocket-rust) - [rocket::serde - Rust](#rocket-serde-rust) - [Catcher in rocket - Rust](#catcher-in-rocket-rust) - [custom in rocket - Rust](#custom-in-rocket-rust) - [build in rocket - Rust](#build-in-rocket-rust) - [execute in rocket - Rust](#execute-in-rocket-rust) - [async_test in rocket - Rust](#async-test-in-rocket-rust) - [Build in rocket - Rust](#build-in-rocket-rust) - [Orbit in rocket - Rust](#orbit-in-rocket-rust) - [Error in rocket - Rust](#error-in-rocket-rust) - [Route in rocket - Rust](#route-in-rocket-rust) - [Rocket in rocket - Rust](#rocket-in-rocket-rust) - [State in rocket - Rust](#state-in-rocket-rust) - [async_trait in rocket - Rust](#async-trait-in-rocket-rust) - [Shutdown in rocket - Rust](#shutdown-in-rocket-rust) - [catch in rocket - Rust](#catch-in-rocket-rust) - [Response in rocket - Rust](#response-in-rocket-rust) - [Request in rocket - Rust](#request-in-rocket-rust) - [delete in rocket - Rust](#delete-in-rocket-rust) - [launch in rocket - Rust](#launch-in-rocket-rust) - [route in rocket - Rust](#route-in-rocket-rust) - [rocket::route - Rust](#rocket-route-rust) - [Config in rocket - Rust](#config-in-rocket-rust) - [FromForm in rocket - Rust](#fromform-in-rocket-rust) - [main in rocket - Rust](#main-in-rocket-rust) - [uri in rocket - Rust](#uri-in-rocket-rust) - [get in rocket - Rust](#get-in-rocket-rust) - [head in rocket - Rust](#head-in-rocket-rust) - [options in rocket - Rust](#options-in-rocket-rust) - [patch in rocket - Rust](#patch-in-rocket-rust) - [post in rocket - Rust](#post-in-rocket-rust) - [put in rocket - Rust](#put-in-rocket-rust) - [rocket::shield - Rust](#rocket-shield-rust) - [Responder in rocket::response - Rust](#responder-in-rocket-response-rust) - [List of all items in this crate](#list-of-all-items-in-this-crate) - [Index of crates](#index-of-crates) - [Database in rocket_db_pools - Rust](#database-in-rocket-db-pools-rust) - [List of all items in this crate](#list-of-all-items-in-this-crate) - [Redirection](#redirection) - [context in rocket_dyn_templates - Rust](#context-in-rocket-dyn-templates-rust) - [Pool in rocket_db_pools - Rust](#pool-in-rocket-db-pools-rust) - [Poolable in rocket_sync_db_pools - Rust](#poolable-in-rocket-sync-db-pools-rust) - [ExampleDb in rocket_sync_db_pools::example - Rust](#exampledb-in-rocket-sync-db-pools-example-rust) - [Database in rocket_db_pools - Rust](#database-in-rocket-db-pools-rust) - [Template in rocket_dyn_templates - Rust](#template-in-rocket-dyn-templates-rust) - [Metadata in rocket_dyn_templates - Rust](#metadata-in-rocket-dyn-templates-rust) - [Ident in rocket::config - Rust](#ident-in-rocket-config-rust) - [Catcher in rocket::catcher - Rust](#catcher-in-rocket-catcher-rust) - [rocket_db_pools::diesel - Rust](#rocket-db-pools-diesel-rust) - [List of all items in this crate](#list-of-all-items-in-this-crate) - [Config in rocket::config - Rust](#config-in-rocket-config-rust) - [Deserialize in rocket::serde - Rust](#deserialize-in-rocket-serde-rust) - [rocket::http - Rust](#rocket-http-rust) - [rocket_dyn_templates::minijinja - Rust](#rocket-dyn-templates-minijinja-rust) - [rocket_sync_db_pools::example - Rust](#rocket-sync-db-pools-example-rust) - [DeserializeOwned in rocket::serde - Rust](#deserializeowned-in-rocket-serde-rust) - [MutualTls in rocket::config - Rust](#mutualtls-in-rocket-config-rust) - [Redirection](#redirection) - [PgPool in rocket_db_pools::diesel - Rust](#pgpool-in-rocket-db-pools-diesel-rust) - [Connection in rocket_db_pools - Rust](#connection-in-rocket-db-pools-rust) - [WebSocket in rocket_ws - Rust](#websocket-in-rocket-ws-rust) - [launch in rocket - Rust](#launch-in-rocket-rust) - [Config in rocket_sync_db_pools - Rust](#config-in-rocket-sync-db-pools-rust) - [SecretKey in rocket::config - Rust](#secretkey-in-rocket-config-rust) - [main in rocket - Rust](#main-in-rocket-rust) - [XssFilter in rocket::shield - Rust](#xssfilter-in-rocket-shield-rust) - [async_test in rocket - Rust](#async-test-in-rocket-rust) - [FromForm in rocket - Rust](#fromform-in-rocket-rust) - [LoadedEntry in rocket::mtls::oid - Rust](#loadedentry-in-rocket-mtls-oid-rust) - [AsyncPgConnection in rocket_db_pools::diesel - Rust](#asyncpgconnection-in-rocket-db-pools-diesel-rust) --- # rocket - Rust [Settings](https://api.rocket.rs/settings.html) [Help](https://api.rocket.rs/help.html) [Crate rocket](https://api.rocket.rs/#) ---------------------------------------- [](https://api.rocket.rs/rocket/all.html "show sidebar") Crate rocket Copy item path =========================== [Source](https://api.rocket.rs/src/rocket/lib.rs.html#1-364) [Search](https://api.rocket.rs/v0.5/rocket/?search=) [Settings](https://api.rocket.rs/settings.html) [Help](https://api.rocket.rs/help.html) Summary Expand description [§](https://api.rocket.rs/#rocket---core-api-documentation) Rocket - Core API Documentation ------------------------------------------------------------------------------------------- Hello, and welcome to the core Rocket API documentation! This API documentation is highly technical and is purely a reference. There’s an [overview](https://rocket.rs/v0.5/overview) of Rocket on the main site as well as a [full, detailed guide](https://rocket.rs/v0.5/guide) . If you’d like pointers on getting started, see the [quickstart](https://rocket.rs/v0.5/guide/quickstart) or [getting started](https://rocket.rs/v0.5/guide/getting-started) chapters of the guide. ### [§](https://api.rocket.rs/#usage) Usage Depend on `rocket` in `Cargo.toml`: [dependencies] rocket = "0.5.1" Note that development versions, tagged with `-dev`, are not published and need to be specified as [git dependencies](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories) . See the [guide](https://rocket.rs/v0.5/guide) for more information on how to write Rocket applications. Here’s a simple example to get you started: #[macro_use] extern crate rocket; #[get("/")] fn hello() -> &'static str { "Hello, world!" } #[launch] fn rocket() -> _ { rocket::build().mount("/", routes![hello]) } ### [§](https://api.rocket.rs/#features) Features To avoid compiling unused dependencies, Rocket gates certain features. With the exception of `http2`, all are disabled by default: | Feature | Description | | --- | --- | | `secrets` | Support for authenticated, encrypted [private cookies](https://rocket.rs/v0.5/guide/requests/#private-cookies)
. | | `tls` | Support for [TLS](https://rocket.rs/v0.5/guide/configuration/#tls)
encrypted connections. | | `mtls` | Support for verified clients via [mutual TLS](https://api.rocket.rs/mtls/index.html "mod rocket::mtls")
. | | `http2` | Support for HTTP/2 (enabled by default). | | `json` | Support for [JSON (de)serialization](https://api.rocket.rs/serde/json/index.html "mod rocket::serde::json")
. | | `msgpack` | Support for [MessagePack (de)serialization](https://api.rocket.rs/serde/msgpack/index.html "mod rocket::serde::msgpack")
. | | `uuid` | Support for [UUID value parsing and (de)serialization](https://api.rocket.rs/serde/uuid/index.html "mod rocket::serde::uuid")
. | Disabled features can be selectively enabled in `Cargo.toml`: [dependencies] rocket = { version = "0.5.1", features = ["secrets", "tls", "json"] } Conversely, HTTP/2 can be disabled: [dependencies] rocket = { version = "0.5.1", default-features = false } ### [§](https://api.rocket.rs/#configuration) Configuration Rocket offers a rich, extensible configuration system built on [Figment](https://docs.rs/figment) . By default, Rocket applications are configured via a `Rocket.toml` file and/or `ROCKET_{PARAM}` environment variables, but applications may configure their own sources. See the [configuration guide](https://rocket.rs/v0.5/guide/configuration/) for full details. ### [§](https://api.rocket.rs/#testing) Testing The [`local`](https://api.rocket.rs/local/index.html "mod rocket::local") module contains structures that facilitate unit and integration testing of a Rocket application. The top-level [`local`](https://api.rocket.rs/local/index.html "mod rocket::local") module documentation and the [testing guide](https://rocket.rs/v0.5/guide/testing/#testing) include detailed examples. Re-exports[§](https://api.rocket.rs/#reexports) ------------------------------------------------ `pub use [futures](https://docs.rs/futures/0.3.31/futures/index.html "mod futures") ;` `pub use [tokio](https://docs.rs/tokio/1.48.0/tokio/index.html "mod tokio") ;` `pub use [figment](https://docs.rs/figment/0.10.19/figment/index.html "mod figment") ;` `pub use [time](https://docs.rs/time/0.3.44/time/index.html "mod time") ;` Modules[§](https://api.rocket.rs/#modules) ------------------------------------------- [catcher](https://api.rocket.rs/catcher/index.html "mod rocket::catcher") Types and traits for error catchers and their handlers and return types. [config](https://api.rocket.rs/config/index.html "mod rocket::config") Server and application configuration. [data](https://api.rocket.rs/data/index.html "mod rocket::data") Types and traits for handling incoming body data. [error](https://api.rocket.rs/error/index.html "mod rocket::error") Types representing various errors that can occur in a Rocket application. [fairing](https://api.rocket.rs/fairing/index.html "mod rocket::fairing") Fairings: callbacks at launch, liftoff, request, and response time. [form](https://api.rocket.rs/form/index.html "mod rocket::form") Parsing and validation of HTTP forms and fields. [fs](https://api.rocket.rs/fs/index.html "mod rocket::fs") File serving, file accepting, and file metadata types. [http](https://api.rocket.rs/http/index.html "mod rocket::http") Types that map to concepts in HTTP. [local](https://api.rocket.rs/local/index.html "mod rocket::local") Structures for local dispatching of requests, primarily for testing. [mtls](https://api.rocket.rs/mtls/index.html "mod rocket::mtls") `mtls` Support for mutual TLS client certificates. [outcome](https://api.rocket.rs/outcome/index.html "mod rocket::outcome") Success, error, and forward handling. [request](https://api.rocket.rs/request/index.html "mod rocket::request") Types and traits for request parsing and handling. [response](https://api.rocket.rs/response/index.html "mod rocket::response") Types and traits to build and send responses. [route](https://api.rocket.rs/route/index.html "mod rocket::route") Types and traits for routes and their request handlers and return types. [serde](https://api.rocket.rs/serde/index.html "mod rocket::serde") Serialization and deserialization support. [shield](https://api.rocket.rs/shield/index.html "mod rocket::shield") Security and privacy headers for all outgoing responses. Macros[§](https://api.rocket.rs/#macros) ----------------------------------------- [catchers](https://api.rocket.rs/macro.catchers.html "macro rocket::catchers") Generates a `Vec` of [`Catcher`](https://api.rocket.rs/rocket/struct.Catcher.html) s from a set of catcher paths. [routes](https://api.rocket.rs/macro.routes.html "macro rocket::routes") Generates a `Vec` of [`Route`](https://api.rocket.rs/rocket/struct.Route.html) s from a set of route paths. [uri](https://api.rocket.rs/macro.uri.html "macro rocket::uri") Type-safe, encoding-safe route and non-route URI generation. Structs[§](https://api.rocket.rs/#structs) ------------------------------------------- [Catcher](https://api.rocket.rs/struct.Catcher.html "struct rocket::Catcher") An error catching route. [Config](https://api.rocket.rs/struct.Config.html "struct rocket::Config") Rocket server configuration. [Data](https://api.rocket.rs/struct.Data.html "struct rocket::Data") Type representing the body data of a request. [Error](https://api.rocket.rs/struct.Error.html "struct rocket::Error") An error that occurs during launch. [Request](https://api.rocket.rs/struct.Request.html "struct rocket::Request") The type of an incoming web request. [Response](https://api.rocket.rs/struct.Response.html "struct rocket::Response") A response, as returned by types implementing [`Responder`](https://api.rocket.rs/response/trait.Responder.html "trait rocket::response::Responder") . [Rocket](https://api.rocket.rs/struct.Rocket.html "struct rocket::Rocket") The application server itself. [Route](https://api.rocket.rs/struct.Route.html "struct rocket::Route") A request handling route. [Shutdown](https://api.rocket.rs/struct.Shutdown.html "struct rocket::Shutdown") A request guard and future for graceful shutdown. [State](https://api.rocket.rs/struct.State.html "struct rocket::State") Request guard to retrieve managed state. Enums[§](https://api.rocket.rs/#enums) --------------------------------------- [Build](https://api.rocket.rs/enum.Build.html "enum rocket::Build") The initial launch [`Phase`](https://api.rocket.rs/trait.Phase.html "trait rocket::Phase") . See [Rocket#build](https://api.rocket.rs/struct.Rocket.html#build "struct rocket::Rocket") for phase details. [Ignite](https://api.rocket.rs/enum.Ignite.html "enum rocket::Ignite") The second launch [`Phase`](https://api.rocket.rs/trait.Phase.html "trait rocket::Phase") : post-build but pre-orbit. See [Rocket#ignite](https://api.rocket.rs/struct.Rocket.html#ignite "struct rocket::Rocket") for details. [Orbit](https://api.rocket.rs/enum.Orbit.html "enum rocket::Orbit") The final launch [`Phase`](https://api.rocket.rs/trait.Phase.html "trait rocket::Phase") . See [Rocket#orbit](https://api.rocket.rs/struct.Rocket.html#orbit "struct rocket::Rocket") for details. Traits[§](https://api.rocket.rs/#traits) ----------------------------------------- [Phase](https://api.rocket.rs/trait.Phase.html "trait rocket::Phase") A marker trait for Rocket’s launch phases. [Sentinel](https://api.rocket.rs/trait.Sentinel.html "trait rocket::Sentinel") An automatic last line of defense against launching an invalid [`Rocket`](https://api.rocket.rs/struct.Rocket.html "struct rocket::Rocket") . Functions[§](https://api.rocket.rs/#functions) ----------------------------------------------- [build](https://api.rocket.rs/fn.build.html "fn rocket::build") Creates a [`Rocket`](https://api.rocket.rs/struct.Rocket.html "struct rocket::Rocket") instance with the default config provider: aliases [`Rocket::build()`](https://api.rocket.rs/struct.Rocket.html#method.build "associated function rocket::Rocket::build") . [custom](https://api.rocket.rs/fn.custom.html "fn rocket::custom") Creates a [`Rocket`](https://api.rocket.rs/struct.Rocket.html "struct rocket::Rocket") instance with a custom config provider: aliases [`Rocket::custom()`](https://api.rocket.rs/struct.Rocket.html#method.custom "associated function rocket::Rocket::custom") . [execute](https://api.rocket.rs/fn.execute.html "fn rocket::execute") Executes a `future` to completion on a new tokio-based Rocket async runtime. Attribute Macros[§](https://api.rocket.rs/#attributes) ------------------------------------------------------- [async\_test](https://api.rocket.rs/attr.async_test.html "attr rocket::async_test") Retrofits supports for `async fn` in unit tests. [async\_trait](https://api.rocket.rs/attr.async_trait.html "attr rocket::async_trait") Retrofits support for `async fn` in trait impls and declarations. [catch](https://api.rocket.rs/attr.catch.html "attr rocket::catch") Attribute to generate a [`Catcher`](https://api.rocket.rs/rocket/struct.Catcher.html) and associated metadata. [delete](https://api.rocket.rs/attr.delete.html "attr rocket::delete") Attribute to generate a [`Route`](https://api.rocket.rs/attr.route.html) and associated metadata. [get](https://api.rocket.rs/attr.get.html "attr rocket::get") Attribute to generate a [`Route`](https://api.rocket.rs/attr.route.html) and associated metadata. [head](https://api.rocket.rs/attr.head.html "attr rocket::head") Attribute to generate a [`Route`](https://api.rocket.rs/attr.route.html) and associated metadata. [launch](https://api.rocket.rs/attr.launch.html "attr rocket::launch") Generates a `main` function that launches a returned `Rocket`. [main](https://api.rocket.rs/attr.main.html "attr rocket::main") Retrofits `async fn` support in `main` functions. [options](https://api.rocket.rs/attr.options.html "attr rocket::options") Attribute to generate a [`Route`](https://api.rocket.rs/attr.route.html) and associated metadata. [patch](https://api.rocket.rs/attr.patch.html "attr rocket::patch") Attribute to generate a [`Route`](https://api.rocket.rs/attr.route.html) and associated metadata. [post](https://api.rocket.rs/attr.post.html "attr rocket::post") Attribute to generate a [`Route`](https://api.rocket.rs/attr.route.html) and associated metadata. [put](https://api.rocket.rs/attr.put.html "attr rocket::put") Attribute to generate a [`Route`](https://api.rocket.rs/attr.route.html) and associated metadata. [route](https://api.rocket.rs/attr.route.html "attr rocket::route") Attribute to generate a [`Route`](https://api.rocket.rs/attr.route.html) and associated metadata. Derive Macros[§](https://api.rocket.rs/#derives) ------------------------------------------------- [FromForm](https://api.rocket.rs/derive.FromForm.html "derive rocket::FromForm") Derive for the [`FromForm`](https://api.rocket.rs/rocket/form/trait.FromForm.html) trait. [FromFormField](https://api.rocket.rs/derive.FromFormField.html "derive rocket::FromFormField") Derive for the [`FromFormField`](https://api.rocket.rs/rocket/form/trait.FromFormField.html) trait. [Responder](https://api.rocket.rs/derive.Responder.html "derive rocket::Responder") Derive for the [`Responder`](https://api.rocket.rs/rocket/response/trait.Responder.html) trait. [UriDisplayPath](https://api.rocket.rs/derive.UriDisplayPath.html "derive rocket::UriDisplayPath") Derive for the [`UriDisplay`](https://api.rocket.rs/rocket/http/uri/fmt/trait.UriDisplay.html) trait. [UriDisplayQuery](https://api.rocket.rs/derive.UriDisplayQuery.html "derive rocket::UriDisplayQuery") Derive for the [`UriDisplay`](https://api.rocket.rs/rocket/http/uri/fmt/trait.UriDisplay.html) trait. --- # "" Search - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Crate rocket](https://api.rocket.rs/v0.5/rocket/?search=#) ------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") Crate rocket Copy item path =========================== [Source](https://api.rocket.rs/v0.5/src/rocket/lib.rs.html#1-364) Expand description [§](https://api.rocket.rs/v0.5/rocket/?search=#rocket---core-api-documentation) Rocket - Core API Documentation --------------------------------------------------------------------------------------------------------------- Hello, and welcome to the core Rocket API documentation! This API documentation is highly technical and is purely a reference. There’s an [overview](https://rocket.rs/v0.5/overview) of Rocket on the main site as well as a [full, detailed guide](https://rocket.rs/v0.5/guide) . If you’d like pointers on getting started, see the [quickstart](https://rocket.rs/v0.5/guide/quickstart) or [getting started](https://rocket.rs/v0.5/guide/getting-started) chapters of the guide. ### [§](https://api.rocket.rs/v0.5/rocket/?search=#usage) Usage Depend on `rocket` in `Cargo.toml`: [dependencies] rocket = "0.5.1" Note that development versions, tagged with `-dev`, are not published and need to be specified as [git dependencies](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories) . See the [guide](https://rocket.rs/v0.5/guide) for more information on how to write Rocket applications. Here’s a simple example to get you started: #[macro_use] extern crate rocket; #[get("/")] fn hello() -> &'static str { "Hello, world!" } #[launch] fn rocket() -> _ { rocket::build().mount("/", routes![hello]) } ### [§](https://api.rocket.rs/v0.5/rocket/?search=#features) Features To avoid compiling unused dependencies, Rocket gates certain features. With the exception of `http2`, all are disabled by default: | Feature | Description | | --- | --- | | `secrets` | Support for authenticated, encrypted [private cookies](https://rocket.rs/v0.5/guide/requests/#private-cookies)
. | | `tls` | Support for [TLS](https://rocket.rs/v0.5/guide/configuration/#tls)
encrypted connections. | | `mtls` | Support for verified clients via [mutual TLS](https://api.rocket.rs/v0.5/rocket/mtls/index.html "mod rocket::mtls")
. | | `http2` | Support for HTTP/2 (enabled by default). | | `json` | Support for [JSON (de)serialization](https://api.rocket.rs/v0.5/rocket/serde/json/index.html "mod rocket::serde::json")
. | | `msgpack` | Support for [MessagePack (de)serialization](https://api.rocket.rs/v0.5/rocket/serde/msgpack/index.html "mod rocket::serde::msgpack")
. | | `uuid` | Support for [UUID value parsing and (de)serialization](https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html "mod rocket::serde::uuid")
. | Disabled features can be selectively enabled in `Cargo.toml`: [dependencies] rocket = { version = "0.5.1", features = ["secrets", "tls", "json"] } Conversely, HTTP/2 can be disabled: [dependencies] rocket = { version = "0.5.1", default-features = false } ### [§](https://api.rocket.rs/v0.5/rocket/?search=#configuration) Configuration Rocket offers a rich, extensible configuration system built on [Figment](https://docs.rs/figment) . By default, Rocket applications are configured via a `Rocket.toml` file and/or `ROCKET_{PARAM}` environment variables, but applications may configure their own sources. See the [configuration guide](https://rocket.rs/v0.5/guide/configuration/) for full details. ### [§](https://api.rocket.rs/v0.5/rocket/?search=#testing) Testing The [`local`](https://api.rocket.rs/v0.5/rocket/local/index.html "mod rocket::local") module contains structures that facilitate unit and integration testing of a Rocket application. The top-level [`local`](https://api.rocket.rs/v0.5/rocket/local/index.html "mod rocket::local") module documentation and the [testing guide](https://rocket.rs/v0.5/guide/testing/#testing) include detailed examples. Re-exports[§](https://api.rocket.rs/v0.5/rocket/?search=#reexports) -------------------------------------------------------------------- `pub use [futures](https://docs.rs/futures/0.3.31/futures/index.html "mod futures") ;` `pub use [tokio](https://docs.rs/tokio/1.48.0/tokio/index.html "mod tokio") ;` `pub use [figment](https://docs.rs/figment/0.10.19/figment/index.html "mod figment") ;` `pub use [time](https://docs.rs/time/0.3.44/time/index.html "mod time") ;` Modules[§](https://api.rocket.rs/v0.5/rocket/?search=#modules) --------------------------------------------------------------- [catcher](https://api.rocket.rs/v0.5/rocket/catcher/index.html "mod rocket::catcher") Types and traits for error catchers and their handlers and return types. [config](https://api.rocket.rs/v0.5/rocket/config/index.html "mod rocket::config") Server and application configuration. [data](https://api.rocket.rs/v0.5/rocket/data/index.html "mod rocket::data") Types and traits for handling incoming body data. [error](https://api.rocket.rs/v0.5/rocket/error/index.html "mod rocket::error") Types representing various errors that can occur in a Rocket application. [fairing](https://api.rocket.rs/v0.5/rocket/fairing/index.html "mod rocket::fairing") Fairings: callbacks at launch, liftoff, request, and response time. [form](https://api.rocket.rs/v0.5/rocket/form/index.html "mod rocket::form") Parsing and validation of HTTP forms and fields. [fs](https://api.rocket.rs/v0.5/rocket/fs/index.html "mod rocket::fs") File serving, file accepting, and file metadata types. [http](https://api.rocket.rs/v0.5/rocket/http/index.html "mod rocket::http") Types that map to concepts in HTTP. [local](https://api.rocket.rs/v0.5/rocket/local/index.html "mod rocket::local") Structures for local dispatching of requests, primarily for testing. [mtls](https://api.rocket.rs/v0.5/rocket/mtls/index.html "mod rocket::mtls") `mtls` Support for mutual TLS client certificates. [outcome](https://api.rocket.rs/v0.5/rocket/outcome/index.html "mod rocket::outcome") Success, error, and forward handling. [request](https://api.rocket.rs/v0.5/rocket/request/index.html "mod rocket::request") Types and traits for request parsing and handling. [response](https://api.rocket.rs/v0.5/rocket/response/index.html "mod rocket::response") Types and traits to build and send responses. [route](https://api.rocket.rs/v0.5/rocket/route/index.html "mod rocket::route") Types and traits for routes and their request handlers and return types. [serde](https://api.rocket.rs/v0.5/rocket/serde/index.html "mod rocket::serde") Serialization and deserialization support. [shield](https://api.rocket.rs/v0.5/rocket/shield/index.html "mod rocket::shield") Security and privacy headers for all outgoing responses. Macros[§](https://api.rocket.rs/v0.5/rocket/?search=#macros) ------------------------------------------------------------- [catchers](https://api.rocket.rs/v0.5/rocket/macro.catchers.html "macro rocket::catchers") Generates a `Vec` of [`Catcher`](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html) s from a set of catcher paths. [routes](https://api.rocket.rs/v0.5/rocket/macro.routes.html "macro rocket::routes") Generates a `Vec` of [`Route`](https://api.rocket.rs/v0.5/rocket/struct.Route.html) s from a set of route paths. [uri](https://api.rocket.rs/v0.5/rocket/macro.uri.html "macro rocket::uri") Type-safe, encoding-safe route and non-route URI generation. Structs[§](https://api.rocket.rs/v0.5/rocket/?search=#structs) --------------------------------------------------------------- [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher") An error catching route. [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Rocket server configuration. [Data](https://api.rocket.rs/v0.5/rocket/struct.Data.html "struct rocket::Data") Type representing the body data of a request. [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") An error that occurs during launch. [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") The type of an incoming web request. [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") A response, as returned by types implementing [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") . [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") The application server itself. [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") A request handling route. [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") A request guard and future for graceful shutdown. [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") Request guard to retrieve managed state. Enums[§](https://api.rocket.rs/v0.5/rocket/?search=#enums) ----------------------------------------------------------- [Build](https://api.rocket.rs/v0.5/rocket/enum.Build.html "enum rocket::Build") The initial launch [`Phase`](https://api.rocket.rs/v0.5/rocket/trait.Phase.html "trait rocket::Phase") . See [Rocket#build](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#build "struct rocket::Rocket") for phase details. [Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") The second launch [`Phase`](https://api.rocket.rs/v0.5/rocket/trait.Phase.html "trait rocket::Phase") : post-build but pre-orbit. See [Rocket#ignite](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#ignite "struct rocket::Rocket") for details. [Orbit](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html "enum rocket::Orbit") The final launch [`Phase`](https://api.rocket.rs/v0.5/rocket/trait.Phase.html "trait rocket::Phase") . See [Rocket#orbit](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#orbit "struct rocket::Rocket") for details. Traits[§](https://api.rocket.rs/v0.5/rocket/?search=#traits) ------------------------------------------------------------- [Phase](https://api.rocket.rs/v0.5/rocket/trait.Phase.html "trait rocket::Phase") A marker trait for Rocket’s launch phases. [Sentinel](https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html "trait rocket::Sentinel") An automatic last line of defense against launching an invalid [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") . Functions[§](https://api.rocket.rs/v0.5/rocket/?search=#functions) ------------------------------------------------------------------- [build](https://api.rocket.rs/v0.5/rocket/fn.build.html "fn rocket::build") Creates a [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") instance with the default config provider: aliases [`Rocket::build()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.build "associated function rocket::Rocket::build") . [custom](https://api.rocket.rs/v0.5/rocket/fn.custom.html "fn rocket::custom") Creates a [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") instance with a custom config provider: aliases [`Rocket::custom()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.custom "associated function rocket::Rocket::custom") . [execute](https://api.rocket.rs/v0.5/rocket/fn.execute.html "fn rocket::execute") Executes a `future` to completion on a new tokio-based Rocket async runtime. Attribute Macros[§](https://api.rocket.rs/v0.5/rocket/?search=#attributes) --------------------------------------------------------------------------- [async\_test](https://api.rocket.rs/v0.5/rocket/attr.async_test.html "attr rocket::async_test") Retrofits supports for `async fn` in unit tests. [async\_trait](https://api.rocket.rs/v0.5/rocket/attr.async_trait.html "attr rocket::async_trait") Retrofits support for `async fn` in trait impls and declarations. [catch](https://api.rocket.rs/v0.5/rocket/attr.catch.html "attr rocket::catch") Attribute to generate a [`Catcher`](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html) and associated metadata. [delete](https://api.rocket.rs/v0.5/rocket/attr.delete.html "attr rocket::delete") Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. [get](https://api.rocket.rs/v0.5/rocket/attr.get.html "attr rocket::get") Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. [head](https://api.rocket.rs/v0.5/rocket/attr.head.html "attr rocket::head") Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. [launch](https://api.rocket.rs/v0.5/rocket/attr.launch.html "attr rocket::launch") Generates a `main` function that launches a returned `Rocket`. [main](https://api.rocket.rs/v0.5/rocket/attr.main.html "attr rocket::main") Retrofits `async fn` support in `main` functions. [options](https://api.rocket.rs/v0.5/rocket/attr.options.html "attr rocket::options") Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. [patch](https://api.rocket.rs/v0.5/rocket/attr.patch.html "attr rocket::patch") Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. [post](https://api.rocket.rs/v0.5/rocket/attr.post.html "attr rocket::post") Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. [put](https://api.rocket.rs/v0.5/rocket/attr.put.html "attr rocket::put") Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. [route](https://api.rocket.rs/v0.5/rocket/attr.route.html "attr rocket::route") Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. Derive Macros[§](https://api.rocket.rs/v0.5/rocket/?search=#derives) --------------------------------------------------------------------- [FromForm](https://api.rocket.rs/v0.5/rocket/derive.FromForm.html "derive rocket::FromForm") Derive for the [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) trait. [FromFormField](https://api.rocket.rs/v0.5/rocket/derive.FromFormField.html "derive rocket::FromFormField") Derive for the [`FromFormField`](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html) trait. [Responder](https://api.rocket.rs/v0.5/rocket/derive.Responder.html "derive rocket::Responder") Derive for the [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) trait. [UriDisplayPath](https://api.rocket.rs/v0.5/rocket/derive.UriDisplayPath.html "derive rocket::UriDisplayPath") Derive for the [`UriDisplay`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.UriDisplay.html) trait. [UriDisplayQuery](https://api.rocket.rs/v0.5/rocket/derive.UriDisplayQuery.html "derive rocket::UriDisplayQuery") Derive for the [`UriDisplay`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.UriDisplay.html) trait. Search results in  all cratesrocketrocket\_db\_poolsrocket\_dyn\_templatesrocket\_sync\_db\_poolsrocket\_ws [Exit](https://api.rocket.rs/v0.5/rocket/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary In Names ( )  In Parameters ( )  In Return Types ( )   Example searches: * [std::vec](https://api.rocket.rs/v0.5/rocket/?search=std::vec) * [u32 -> bool](https://api.rocket.rs/v0.5/rocket/?search=u32+-%3E+bool) * [Option, (T -> U) -> Option](https://api.rocket.rs/v0.5/rocket/?search=Option%3CT%3E,+(T+-%3E+U)+-%3E+Option%3CU%3E) Example searches: * [std::vec](https://api.rocket.rs/v0.5/rocket/?search=std::vec) * [u32 -> bool](https://api.rocket.rs/v0.5/rocket/?search=u32+-%3E+bool) * [Option, (T -> U) -> Option](https://api.rocket.rs/v0.5/rocket/?search=Option%3CT%3E,+(T+-%3E+U)+-%3E+Option%3CU%3E) Example searches: * [std::vec](https://api.rocket.rs/v0.5/rocket/?search=std::vec) * [u32 -> bool](https://api.rocket.rs/v0.5/rocket/?search=u32+-%3E+bool) * [Option, (T -> U) -> Option](https://api.rocket.rs/v0.5/rocket/?search=Option%3CT%3E,+(T+-%3E+U)+-%3E+Option%3CU%3E) --- # Settings [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [All](https://api.rocket.rs/v0.5/settings.html#) ------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") Rustdoc settings ================ [Back](javascript:void(0)) --- # Help [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [All](https://api.rocket.rs/v0.5/help.html#) --------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") Rustdoc help ============ [Back](javascript:void(0)) --- # rocket_dyn_templates - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Crate rocket\_dyn\_templates](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html#) -------------------------------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket_dyn_templates/all.html "show sidebar") Crate rocket\_dyn\_templates Copy item path =========================================== [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/lib.rs.html#1-209) [Search](https://api.rocket.rs/v0.5/rocket_dyn_templates/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Dynamic templating engine support for Rocket. This crate adds support for dynamic template rendering to Rocket. It automatically discovers templates, provides a `Responder` to render templates, and automatically reloads templates when compiled in debug mode. At present, it supports [Handlebars](https://docs.rs/crate/handlebars/5) and [Tera](https://docs.rs/crate/tera/1) . [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html#usage) Usage --------------------------------------------------------------------------- 1. Depend on `rocket_dyn_templates`. Enable the feature(s) corresponding to your templating engine(s) of choice: [dependencies.rocket_dyn_templates] version = "0.2.0" features = ["handlebars", "tera", "minijinja"] 2. Write your templates inside of the [configurable](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html#configuration) `${ROCKET_ROOT}/templates`. The filename _must_ end with an extension corresponding to an enabled engine. The second-to-last extension should correspond to the file’s type: | Engine | Extension | Example | | --- | --- | --- | | [Tera](https://docs.rs/crate/tera/1) | `.tera` | `${ROCKET_ROOT}/templates/index.html.tera` | | [Handlebars](https://docs.rs/crate/handlebars/5) | `.hbs` | `${ROCKET_ROOT}/templates/index.html.hbs` | | [MiniJinja](https://docs.rs/minijinja/2) | `.j2` | `${ROCKET_ROOT}/templates/index.html.j2` | 3. Attach `Template::fairing()` and return a [`Template`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") from your routes via [`Template::render()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.render "associated function rocket_dyn_templates::Template::render") , supplying the name of the template file **minus the last two extensions**: use rocket_dyn_templates::{Template, context}; #[get("/")] fn index() -> Template { Template::render("index", context! { field: "value" }) } #[launch] fn rocket() -> _ { rocket::build().attach(Template::fairing()) } ### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html#configuration) Configuration This crate reads one configuration parameter from the configured figment: * `template_dir` (**default: `templates/`**) A path to a directory to search for template files in. Relative paths are considered relative to the configuration file, or there is no file, the current working directory. For example, to change the default and set `template_dir` to different values based on whether the application was compiled for debug or release from a `Rocket.toml` file (read by the default figment), you might write: [debug] template_dir = "static/templates" [release] template_dir = "/var/opt/www/templates" **Note:** `template_dir` defaults to `templates/`. It _does not_ need to be specified if the default suffices. See the [configuration chapter](https://rocket.rs/v0.5/guide/configuration) of the guide for more information on configuration. ### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html#template-naming-and-content-types) Template Naming and Content-Types Templates are rendered by _name_ via [`Template::render()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.render "associated function rocket_dyn_templates::Template::render") , which returns a [`Template`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") responder. The _name_ of the template is the path to the template file, relative to `template_dir`, minus at most two extensions. The `Content-Type` of the response is automatically determined by the non-engine extension using [`ContentType::from_extension()`](https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html#method.from_extension) . If there is no such extension or it is unknown, `text/plain` is used. The following table contains examples: | template path | [`Template::render()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.render "associated function rocket_dyn_templates::Template::render")
call | content-type | | --- | --- | --- | | {template\_dir}/index.html.hbs | `render("index")` | HTML | | {template\_dir}/index.tera | `render("index")` | `text/plain` | | {template\_dir}/index.hbs | `render("index")` | `text/plain` | | {template\_dir}/dir/index.hbs | `render("dir/index")` | `text/plain` | | {template\_dir}/dir/data.json.tera | `render("dir/data")` | JSON | | {template\_dir}/data.template.xml.hbs | `render("data.template")` | XML | | {template\_dir}/subdir/index.template.html.hbs | `render("subdir/index.template")` | HTML | The recommended naming scheme is to use two extensions: one for the file type, and one for the template extension. This means that template extensions should look like: `.html.hbs`, `.html.tera`, `.xml.hbs`, and so on. #### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html#rendering-context) Rendering Context In addition to a name, [`Template::render()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.render "associated function rocket_dyn_templates::Template::render") requires a context to use during rendering. The context can be any \[`Serialize`\] type that serializes to an `Object` (a dictionary) value. The [`context!`](https://api.rocket.rs/v0.5/rocket_dyn_templates/macro.context.html "macro rocket_dyn_templates::context") macro can be used to create inline `Serialize`\-able context objects. use rocket::serde::Serialize; use rocket_dyn_templates::{Template, context}; #[get("/")] fn index() -> Template { // Using the `context! { }` macro. Template::render("index", context! { site_name: "Rocket - Home Page", version: 127, }) } #[get("/")] fn index2() -> Template { #[derive(Serialize)] #[serde(crate = "rocket::serde")] struct IndexContext { site_name: &'static str, version: u8 } // Using an existing `IndexContext`, which implements `Serialize`. Template::render("index", IndexContext { site_name: "Rocket - Home Page", version: 127, }) } #### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html#discovery-automatic-reloads-and-engine-customization) Discovery, Automatic Reloads, and Engine Customization As long as one of [`Template::fairing()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.fairing "associated function rocket_dyn_templates::Template::fairing") , [`Template::custom()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.custom "associated function rocket_dyn_templates::Template::custom") , or [`Template::try_custom()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.try_custom "associated function rocket_dyn_templates::Template::try_custom") is [attached](rocket::attach()) , any file in the configured `template_dir` ending with a known engine extension (as described in the [usage section](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html#usage) ) can be rendered. The latter two fairings allow customizations such as registering helpers and templates from strings. _**Note:** Templates that are registered directly via [`Template::custom()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.custom "associated function rocket_dyn_templates::Template::custom") , use whatever name provided during that registration; no extensions are automatically removed._ In debug mode (without the `--release` flag passed to `cargo`), templates are **automatically reloaded** from disk when changes are made. In release builds, template reloading is disabled to improve performance and cannot be enabled. #### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html#metadata-and-rendering-to-string) Metadata and Rendering to `String` The [`Metadata`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html "struct rocket_dyn_templates::Metadata") request guard allows dynamically querying templating metadata, such as whether a template is known to exist ([`Metadata::contains_template()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html#method.contains_template "method rocket_dyn_templates::Metadata::contains_template") ), and to render templates to `String` ([`Metadata::render()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html#method.render "method rocket_dyn_templates::Metadata::render") ). Modules[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html#modules) ------------------------------------------------------------------------------- [handlebars](https://api.rocket.rs/v0.5/rocket_dyn_templates/handlebars/index.html "mod rocket_dyn_templates::handlebars") The handlebars templating engine library, reexported. [minijinja](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/index.html "mod rocket_dyn_templates::minijinja") The minijinja templating engine library, reexported. [tera](https://api.rocket.rs/v0.5/rocket_dyn_templates/tera/index.html "mod rocket_dyn_templates::tera") The tera templating engine library, reexported. Macros[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html#macros) ----------------------------------------------------------------------------- [context](https://api.rocket.rs/v0.5/rocket_dyn_templates/macro.context.html "macro rocket_dyn_templates::context") A macro to easily create a template rendering context. Structs[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html#structs) ------------------------------------------------------------------------------- [Engines](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Engines.html "struct rocket_dyn_templates::Engines") A structure exposing access to templating engines. [Metadata](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html "struct rocket_dyn_templates::Metadata") Request guard for dynamically querying template metadata. [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") Responder that renders a dynamic template. --- # rocket_sync_db_pools - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Crate rocket\_sync\_db\_pools](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#) --------------------------------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket_sync_db_pools/all.html "show sidebar") Crate rocket\_sync\_db\_pools Copy item path ============================================ [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/lib.rs.html#1-596) [Search](https://api.rocket.rs/v0.5/rocket_sync_db_pools/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Traits, utilities, and a macro for easy database connection pooling. [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#overview) Overview --------------------------------------------------------------------------------- This crate provides traits, utilities, and a procedural macro for configuring and accessing database connection pools in Rocket. A _database connection pool_ is a data structure that maintains active database connections for later use in the application. This implementation is backed by [`r2d2`](https://docs.rs/r2d2/0.8/r2d2/index.html "mod r2d2") and exposes connections through request guards. Databases are individually configured through Rocket’s regular configuration mechanisms. Connecting a Rocket application to a database using this library occurs in three simple steps: 1. Configure your databases in `Rocket.toml`. (see [Configuration](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#configuration) ) 2. Associate a request guard type and fairing with each database. (see [Guard Types](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#guard-types) ) 3. Use the request guard to retrieve a connection in a handler. (see [Handlers](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#handlers) ) For a list of supported databases, see [Provided Databases](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#provided) . This support can be easily extended by implementing the [`Poolable`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") trait. See [Extending](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#extending) for more. ### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#example) Example Before using this library, the feature corresponding to your database type in `rocket_sync_db_pools` must be enabled: [dependencies.rocket_sync_db_pools] version = "0.1.0" features = ["diesel_sqlite_pool"] See [Provided](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#provided) for a list of supported database and their associated feature name. In whichever configuration source you choose, configure a `databases` dictionary with an internal dictionary for each database, here `sqlite_logs` in a TOML source: [default.databases] sqlite_logs = { url = "/path/to/database.sqlite" } In your application’s source code, one-time: use rocket_sync_db_pools::{database, diesel}; #[database("sqlite_logs")] struct LogsDbConn(diesel::SqliteConnection); #[launch] fn rocket() -> _ { rocket::build().attach(LogsDbConn::fairing()) } Whenever a connection to the database is needed: #[get("/logs/")] async fn get_logs(conn: LogsDbConn, id: usize) -> Result { conn.run(|c| Logs::by_id(c, id)).await } [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#usage) Usage --------------------------------------------------------------------------- ### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#configuration) Configuration Databases can be configured as any other values. Using the default configuration provider, either via `Rocket.toml` or environment variables. You can also use a custom provider. #### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#rockettoml) `Rocket.toml` To configure a database via `Rocket.toml`, add a table for each database to the `databases` table where the key is a name of your choice. The table should have a `url` key and, optionally, `pool_size` and `timeout` keys. This looks as follows: # Option 1: [global.databases] sqlite_db = { url = "db.sqlite" } # Option 2: [global.databases.my_db] url = "postgres://root:root@localhost/my_db" # With `pool_size` and `timeout` keys: [global.databases.sqlite_db] url = "db.sqlite" pool_size = 20 timeout = 5 The table _requires_ one key: * `url` - the URl to the database Additionally, all configurations accept the following _optional_ keys: * `pool_size` - the size of the pool, i.e., the number of connections to pool (defaults to the configured number of workers \* 4) * `timeout` - max number of seconds to wait for a connection to become available (defaults to `5`) Additional options may be required or supported by other adapters. #### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#procedurally) Procedurally Databases can also be configured procedurally via `rocket::custom()`. The example below does just this: use rocket::figment::{value::{Map, Value}, util::map}; #[launch] fn rocket() -> _ { let db: Map<_, Value> = map! { "url" => "db.sqlite".into(), "pool_size" => 10.into(), "timeout" => 5.into(), }; let figment = rocket::Config::figment() .merge(("databases", map!["my_db" => db])); rocket::custom(figment) } #### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#environment-variables) Environment Variables Lastly, databases can be configured via environment variables by specifying the `databases` table as detailed in the [Environment Variables configuration guide](https://rocket.rs/v0.5/guide/configuration/#environment-variables) : ROCKET_DATABASES='{my_db={url="db.sqlite"}}' Multiple databases can be specified in the `ROCKET_DATABASES` environment variable as well by comma separating them: ROCKET_DATABASES='{my_db={url="db.sqlite"},my_pg_db={url="postgres://root:root@localhost/my_pg_db"}}' ### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#guard-types) Guard Types Once a database has been configured, the `#[database]` attribute can be used to tie a type in your application to a configured database. The database attribute accepts a single string parameter that indicates the name of the database. This corresponds to the database name set as the database’s configuration key. See [`ExampleDb`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html "struct rocket_sync_db_pools::example::ExampleDb") for everything that the macro generates. Specifically, it generates: * A [`FromRequest`](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html "trait rocket::request::from_request::FromRequest") implementation for the decorated type. * A [`Sentinel`](https://api.rocket.rs/v0.5/rocket/sentinel/trait.Sentinel.html "trait rocket::sentinel::Sentinel") implementation for the decorated type. * A [`fairing()`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html#method.fairing "associated function rocket_sync_db_pools::example::ExampleDb::fairing") method to initialize the database. * A [`run()`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html#method.run "method rocket_sync_db_pools::example::ExampleDb::run") method to execute blocking database operations in an `async`\-safe manner. * A [`pool()`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html#method.pool "associated function rocket_sync_db_pools::example::ExampleDb::pool") method to retrieve the backing connection pool. The attribute can only be applied to tuple structs with one field. The internal type of the structure must implement [`Poolable`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") . use rocket_sync_db_pools::diesel; #[database("my_db")] struct MyDatabase(diesel::SqliteConnection); Other databases can be used by specifying their respective [`Poolable`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") type: use rocket_sync_db_pools::postgres; #[database("my_pg_db")] struct MyPgDatabase(postgres::Client); The fairing returned from the generated `fairing()` method _must_ be attached for the request guard implementation to succeed. Putting the pieces together, a use of the `#[database]` attribute looks as follows: use rocket_sync_db_pools::diesel; #[database("my_db")] struct MyDatabase(diesel::SqliteConnection); #[launch] fn rocket() -> _ { rocket::custom(figment).attach(MyDatabase::fairing()) } ### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#handlers) Handlers Finally, use your type as a request guard in a handler to retrieve a connection wrapper for the database: #[database("my_db")] struct MyDatabase(diesel::SqliteConnection); #[get("/")] fn my_handler(conn: MyDatabase) { // ... } A connection can be retrieved and used with the `run()` method: #[database("my_db")] struct MyDatabase(diesel::SqliteConnection); fn load_from_db(conn: &diesel::SqliteConnection) -> Data { // Do something with connection, return some data. } #[get("/")] async fn my_handler(mut conn: MyDatabase) -> Data { conn.run(|c| load_from_db(c)).await } [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#database-support) Database Support ------------------------------------------------------------------------------------------------- Built-in support is provided for many popular databases and drivers. Support can be easily extended by [`Poolable`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") implementations. ### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#provided) Provided The list below includes all presently supported database adapters and their corresponding [`Poolable`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") type. | Kind | Driver | Version | `Poolable` Type | Feature | | --- | --- | --- | --- | --- | | Sqlite | [Diesel](https://diesel.rs/) | `2` | [`diesel::SqliteConnection`](https://docs.rs/diesel/2/diesel/sqlite/struct.SqliteConnection.html) | `diesel_sqlite_pool` | | Postgres | [Diesel](https://diesel.rs/) | `2` | [`diesel::PgConnection`](https://docs.rs/diesel/2/diesel/pg/struct.PgConnection.html) | `diesel_postgres_pool` | | MySQL | [Diesel](https://diesel.rs/) | `2` | [`diesel::MysqlConnection`](https://docs.rs/diesel/2/diesel/mysql/struct.MysqlConnection.html) | `diesel_mysql_pool` | | Postgres | [Rust-Postgres](https://github.com/sfackler/rust-postgres) | `0.19` | [`postgres::Client`](https://docs.rs/postgres/0.19/postgres/struct.Client.html) | `postgres_pool` | | Sqlite | [`Rusqlite`](https://github.com/jgallagher/rusqlite) | `0.27` | [`rusqlite::Connection`](https://docs.rs/rusqlite/0.27/rusqlite/struct.Connection.html) | `sqlite_pool` | | Memcache | [`memcache`](https://github.com/aisk/rust-memcache) | `0.15` | [`memcache::Client`](https://docs.rs/memcache/0.15/memcache/struct.Client.html) | `memcache_pool` | The above table lists all the supported database adapters in this library. In order to use particular `Poolable` type that’s included in this library, you must first enable the feature listed in the “Feature” column. The interior type of your decorated database type should match the type in the “`Poolable` Type” column. ### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#extending) Extending Extending Rocket’s support to your own custom database adapter (or other database-like struct that can be pooled by `r2d2`) is as easy as implementing the [`Poolable`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") trait. See the documentation for [`Poolable`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") for more details on how to implement it. Re-exports[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#reexports) ------------------------------------------------------------------------------------ `pub use [diesel](https://docs.rs/diesel/2.1.6/diesel/index.html "mod diesel") ;``diesel_sqlite_pool` or `diesel_postgres_pool` or `diesel_mysql_pool` `pub use [postgres](https://docs.rs/postgres/0.19.12/postgres/index.html "mod postgres") ;``postgres_pool` `pub use [r2d2_postgres](https://docs.rs/r2d2_postgres/0.18.2/r2d2_postgres/index.html "mod r2d2_postgres") ;``postgres_pool` `pub use [rusqlite](https://docs.rs/rusqlite/0.29.0/rusqlite/index.html "mod rusqlite") ;``sqlite_pool` `pub use [r2d2_sqlite](https://docs.rs/r2d2_sqlite/0.22.0/r2d2_sqlite/index.html "mod r2d2_sqlite") ;``sqlite_pool` `pub use [memcache](https://docs.rs/memcache/0.15.2/memcache/index.html "mod memcache") ;``memcache_pool` `pub use [r2d2_memcache](https://docs.rs/r2d2-memcache/0.6.0/r2d2_memcache/index.html "mod r2d2_memcache") ;``memcache_pool` `pub use [r2d2](https://docs.rs/r2d2/0.8/r2d2/index.html "mod r2d2") ;` Modules[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#modules) ------------------------------------------------------------------------------- [example](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/index.html "mod rocket_sync_db_pools::example") `nightly` and `diesel_sqlite_pool` Example of code generated by the `#[database]` attribute. Structs[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#structs) ------------------------------------------------------------------------------- [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") A base `Config` for any `Poolable` type. Enums[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#enums) --------------------------------------------------------------------------- [Error](https://api.rocket.rs/v0.5/rocket_sync_db_pools/enum.Error.html "enum rocket_sync_db_pools::Error") A wrapper around `r2d2::Error`s or a custom database error type. Traits[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#traits) ----------------------------------------------------------------------------- [Poolable](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") Trait implemented by `r2d2`\-based database adapters. Type Aliases[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#types) ---------------------------------------------------------------------------------- [PoolResult](https://api.rocket.rs/v0.5/rocket_sync_db_pools/type.PoolResult.html "type rocket_sync_db_pools::PoolResult") A type alias for the return type of [`Poolable::pool()`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html#tymethod.pool "associated function rocket_sync_db_pools::Poolable::pool") . Attribute Macros[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#attributes) ------------------------------------------------------------------------------------------- [database](https://api.rocket.rs/v0.5/rocket_sync_db_pools/attr.database.html "attr rocket_sync_db_pools::database") Generates a request guard and fairing for retrieving a database connection. --- # rocket::serde::msgpack - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module msgpack](https://api.rocket.rs/v0.5/rocket/serde/msgpack/index.html#) ------------------------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[serde](https://api.rocket.rs/v0.5/rocket/serde/index.html) Module msgpack Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket/serde/msgpack.rs.html#1-356) [Search](https://api.rocket.rs/v0.5/rocket/serde/msgpack/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Available on **crate feature `msgpack`** only. Expand description Automatic MessagePack (de)serialization support. See [`MsgPack`](https://api.rocket.rs/v0.5/rocket/serde/msgpack/struct.MsgPack.html "struct rocket::serde::msgpack::MsgPack") for further details. [§](https://api.rocket.rs/v0.5/rocket/serde/msgpack/index.html#enabling) Enabling --------------------------------------------------------------------------------- This module is only available when the `msgpack` feature is enabled. Enable it in `Cargo.toml` as follows: [dependencies.rocket] version = "0.5.1" features = ["msgpack"] [§](https://api.rocket.rs/v0.5/rocket/serde/msgpack/index.html#testing) Testing ------------------------------------------------------------------------------- The [`LocalRequest`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalRequest.html "struct rocket::local::blocking::LocalRequest") and [`LocalResponse`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalResponse.html "struct rocket::local::blocking::LocalResponse") types provide [`msgpack()`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalRequest.html#method.msgpack "method rocket::local::blocking::LocalRequest::msgpack") and [`into_msgpack()`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalResponse.html#method.into_msgpack "method rocket::local::blocking::LocalResponse::into_msgpack") methods to create a request with serialized MessagePack and deserialize a response as MessagePack, respectively. Structs[§](https://api.rocket.rs/v0.5/rocket/serde/msgpack/index.html#structs) ------------------------------------------------------------------------------- [MsgPack](https://api.rocket.rs/v0.5/rocket/serde/msgpack/struct.MsgPack.html "struct rocket::serde::msgpack::MsgPack") The MessagePack guard: easily consume and return MessagePack. Enums[§](https://api.rocket.rs/v0.5/rocket/serde/msgpack/index.html#enums) --------------------------------------------------------------------------- [Error](https://api.rocket.rs/v0.5/rocket/serde/msgpack/enum.Error.html "enum rocket::serde::msgpack::Error") Enum representing errors that can occur while decoding MessagePack data. Functions[§](https://api.rocket.rs/v0.5/rocket/serde/msgpack/index.html#functions) ----------------------------------------------------------------------------------- [from\_slice](https://api.rocket.rs/v0.5/rocket/serde/msgpack/fn.from_slice.html "fn rocket::serde::msgpack::from_slice") Deserialize an instance of type `T` from MessagePack encoded bytes. [to\_compact\_vec](https://api.rocket.rs/v0.5/rocket/serde/msgpack/fn.to_compact_vec.html "fn rocket::serde::msgpack::to_compact_vec") Serialize a `T` into a MessagePack byte vector with compact representation. [to\_vec](https://api.rocket.rs/v0.5/rocket/serde/msgpack/fn.to_vec.html "fn rocket::serde::msgpack::to_vec") Serialize a `T` into a MessagePack byte vector with named representation. --- # rocket_db_pools - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Crate rocket\_db\_pools](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#) ---------------------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket_db_pools/all.html "show sidebar") Crate rocket\_db\_pools Copy item path ====================================== [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/lib.rs.html#1-262) [Search](https://api.rocket.rs/v0.5/rocket_db_pools/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Asynchronous database driver connection pooling integration for Rocket. [§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#quickstart) Quickstart -------------------------------------------------------------------------------- 1. Add `rocket_db_pools` as a dependency with one or more [database driver features](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#supported-drivers) enabled: [dependencies.rocket_db_pools] version = "0.2.0" features = ["sqlx_sqlite"] 2. Choose a name for your database, here `sqlite_logs`. [Configure](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#configuration) _at least_ a URL for the database: [default.databases.sqlite_logs] url = "/path/to/database.sqlite" 3. [Derive](https://api.rocket.rs/v0.5/rocket_db_pools/derive.Database.html "derive rocket_db_pools::Database") [`Database`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html "trait rocket_db_pools::Database") for a unit type (`Logs` here) which wraps the selected driver’s [`Pool`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") type (see [the driver table](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#supported-drivers) ) and is decorated with `#[database("name")]`. Attach `Type::init()` to your application’s `Rocket` to initialize the database pool: use rocket_db_pools::{sqlx, Database}; #[derive(Database)] #[database("sqlite_logs")] struct Logs(sqlx::SqlitePool); #[launch] fn rocket() -> _ { rocket::build().attach(Logs::init()) } 4. Use [`Connection`](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") as a request guard to retrieve an active database connection, which dereferences to the native type in the [`Connection` deref](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#supported-drivers) column. use rocket_db_pools::Connection; use rocket_db_pools::sqlx::Row; #[get("/")] async fn read(mut db: Connection, id: i64) -> Option { sqlx::query("SELECT content FROM logs WHERE id = ?").bind(id) .fetch_one(&mut **db).await .and_then(|r| Ok(Log(r.try_get(0)?))) .ok() } Alternatively, use a reference to the database type as a request guard to retrieve the entire pool, but note that unlike retrieving a `Connection`, doing so does _not_ guarantee that a connection is available: use rocket_db_pools::sqlx::Row; #[get("/")] async fn read(db: &Logs, id: i64) -> Option { sqlx::query("SELECT content FROM logs WHERE id = ?").bind(id) .fetch_one(&db.0).await .and_then(|r| Ok(Log(r.try_get(0)?))) .ok() } [§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#supported-drivers) Supported Drivers ---------------------------------------------------------------------------------------------- At present, this crate supports _four_ drivers: [`deadpool`](https://docs.rs/deadpool/0.12.3/deadpool/index.html "mod deadpool") , [`sqlx`](https://docs.rs/sqlx/0.7.2/sqlx/index.html "mod sqlx") , [`mongodb`](https://docs.rs/mongodb/2.8.2/mongodb/index.html "mod mongodb") , and [`diesel`](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/index.html "mod rocket_db_pools::diesel") . Each driver may support multiple databases. Drivers have a varying degree of support for graceful shutdown, affected by the `Type::init()` fairing on Rocket shutdown. ### [§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#deadpool-v013) `deadpool` (v0.13) | Database | Feature | [`Pool`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool")
Type | [`Connection`](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection")
Deref | | --- | --- | --- | --- | | Postgres | `deadpool_postgres` (v0.13) | [`deadpool_postgres::Pool`](https://docs.rs/deadpool-postgres/0.13.2/deadpool_postgres/type.Pool.html "type deadpool_postgres::Pool") | [`deadpool_postgres::ClientWrapper`](https://docs.rs/deadpool-postgres/0.13.2/deadpool_postgres/struct.ClientWrapper.html "struct deadpool_postgres::ClientWrapper") | | Redis | `deadpool_redis` (v0.15) | [`deadpool_redis::Pool`](https://docs.rs/deadpool-redis/0.15.1/deadpool_redis/type.Pool.html "type deadpool_redis::Pool") | [`deadpool_redis::Connection`](https://docs.rs/deadpool-redis/0.15.1/deadpool_redis/struct.Connection.html "struct deadpool_redis::Connection") | On shutdown, new connections are denied. Shutdown _does not_ wait for connections to be returned. ### [§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#sqlx-v07) `sqlx` (v0.7) | Database | Feature | [`Pool`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool")
Type | [`Connection`](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection")
Deref | | --- | --- | --- | --- | | Postgres | `sqlx_postgres` | [`sqlx::PgPool`](https://docs.rs/sqlx/0.6/sqlx/type.PgPool.html) | [`sqlx::pool::PoolConnection`](https://docs.rs/sqlx/0.6/sqlx/pool/struct.PoolConnection.html) | | MySQL | `sqlx_mysql` | [`sqlx::MySqlPool`](https://docs.rs/sqlx/0.6/sqlx/type.MySqlPool.html) | [`sqlx::pool::PoolConnection`](https://docs.rs/sqlx/0.6/sqlx/pool/struct.PoolConnection.html) | | SQLite | `sqlx_sqlite` | [`sqlx::SqlitePool`](https://docs.rs/sqlx/0.6/sqlx/type.SqlitePool.html) | [`sqlx::pool::PoolConnection`](https://docs.rs/sqlx/0.6/sqlx/pool/struct.PoolConnection.html) | On shutdown, new connections are denied. Shutdown waits for connections to be returned. ### [§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#mongodb-v2) `mongodb` (v2) | Database | Feature | [`Pool`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool")
Type and [`Connection`](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection")
Deref | | --- | --- | --- | | MongoDB | `mongodb` | [`mongodb::Client`](https://docs.rs/mongodb/2.8.2/mongodb/client/struct.Client.html "struct mongodb::client::Client") | Graceful shutdown is not supported. ### [§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#diesel-v2) `diesel` (v2) | Database | Feature | [`Pool`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool")
Type | [`Connection`](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection")
Deref | | --- | --- | --- | --- | | Postgres | `diesel_postgres` | [`diesel::PgPool`](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/type.PgPool.html "type rocket_db_pools::diesel::PgPool") | [`diesel::AsyncPgConnection`](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") | | MySQL | `diesel_mysql` | [`diesel::MysqlPool`](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/type.MysqlPool.html "type rocket_db_pools::diesel::MysqlPool") | [`diesel::AsyncMysqlConnection`](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncMysqlConnection.html "struct rocket_db_pools::diesel::AsyncMysqlConnection") | See [`diesel`](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/index.html "mod rocket_db_pools::diesel") for usage details. On shutdown, new connections are denied. Shutdown _does not_ wait for connections to be returned. ### [§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#enabling-additional-driver-features) Enabling Additional Driver Features Only the minimal features for each driver crate are enabled by `rocket_db_pools`. To use additional driver functionality exposed via its crate’s features, you’ll need to depend on the crate directly with those features enabled in `Cargo.toml`: [dependencies.sqlx] version = "0.7" default-features = false features = ["macros", "migrate"] [dependencies.rocket_db_pools] version = "0.2.0" features = ["sqlx_sqlite"] [§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#configuration) Configuration -------------------------------------------------------------------------------------- Configuration for a database named `db_name` is deserialized from a `databases.db_name` configuration parameter into a [`Config`](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Config.html "struct rocket_db_pools::Config") structure via Rocket’s [configuration facilities](https://api.rocket.rs/v0.5/rocket/config/index.html "mod rocket::config") . By default, configuration can be provided in `Rocket.toml`: [default.databases.db_name] url = "db.sqlite" # Only `url` is required. These have sane defaults and are optional. min_connections = 64 max_connections = 1024 connect_timeout = 5 idle_timeout = 120 # This option is only supported by the `sqlx_sqlite` driver. extensions = ["memvfs", "rot13"] Or via environment variables: ROCKET_DATABASES='{db_name={url="db.sqlite",idle_timeout=120}}' See [`Config`](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Config.html "struct rocket_db_pools::Config") for details on configuration parameters. **Note:** `deadpool` and `diesel` drivers do not support and thus ignore the `min_connections` value. ### [§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#driver-defaults) Driver Defaults Some drivers provide configuration defaults different from the underlying database’s defaults. A best-effort attempt is made to document those differences below: * `sqlx_sqlite` * foreign keys : `enabled` * journal mode : `WAL` * create-missing : `enabled` * synchronous : `full` (even when `WAL`) * busy timeout : `connection_timeout` * `sqlx_postgres` * sslmode : `prefer` * statement-cache-capacity : `100` * user : result of `whoami` * `sqlx_mysql` * sslmode : `PREFERRED` * statement-cache-capacity : `100` [§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#extending) Extending ------------------------------------------------------------------------------ Any database driver can implement support for this library by implementing the [`Pool`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") trait. Re-exports[§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#reexports) ------------------------------------------------------------------------------- `pub use [rocket](https://api.rocket.rs/v0.5/rocket/index.html "mod rocket") ;` `pub use [deadpool_postgres](https://docs.rs/deadpool-postgres/0.13.2/deadpool_postgres/index.html "mod deadpool_postgres") ;` `pub use [deadpool_redis](https://docs.rs/deadpool-redis/0.15.1/deadpool_redis/index.html "mod deadpool_redis") ;` `pub use [mongodb](https://docs.rs/mongodb/2.8.2/mongodb/index.html "mod mongodb") ;` `pub use [sqlx](https://docs.rs/sqlx/0.7.2/sqlx/index.html "mod sqlx") ;` Modules[§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#modules) -------------------------------------------------------------------------- [diesel](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/index.html "mod rocket_db_pools::diesel") Re-export of [`diesel`](https://docs.rs/diesel/2.1.6/diesel/index.html "mod diesel") with prelude types overridden with `async` variants from [`diesel_async`](https://docs.rs/diesel-async/0.4.1/diesel_async/index.html "mod diesel_async") . [figment](https://api.rocket.rs/v0.5/rocket_db_pools/figment/index.html "mod rocket_db_pools::figment") Re-export of the `figment` crate. Semi-hierarchical configuration so con-free, it’s unreal. Structs[§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#structs) -------------------------------------------------------------------------- [Config](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Config.html "struct rocket_db_pools::Config") Base configuration for all database drivers. [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") A request guard which retrieves a single connection to a [`Database`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html "trait rocket_db_pools::Database") . [Initializer](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Initializer.html "struct rocket_db_pools::Initializer") A [`Fairing`](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html "trait rocket::fairing::Fairing") which initializes a [`Database`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html "trait rocket_db_pools::Database") and its connection pool. Enums[§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#enums) ---------------------------------------------------------------------- [Error](https://api.rocket.rs/v0.5/rocket_db_pools/enum.Error.html "enum rocket_db_pools::Error") A general error type for use by [`Pool`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html#implementing "trait rocket_db_pools::Pool") implementors and returned by the [`Connection`](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") request guard. Traits[§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#traits) ------------------------------------------------------------------------ [Database](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html "trait rocket_db_pools::Database") Derivable trait which ties a database [`Pool`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") with a configuration name. [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") Generic [`Database`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html "trait rocket_db_pools::Database") driver connection pool trait. Derive Macros[§](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#derives) -------------------------------------------------------------------------------- [Database](https://api.rocket.rs/v0.5/rocket_db_pools/derive.Database.html "derive rocket_db_pools::Database") Automatic derive for the [`Database`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html) trait. --- # rocket_ws - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Crate rocket\_ws](https://api.rocket.rs/v0.5/rocket_ws/index.html#) --------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket_ws/all.html "show sidebar") Crate rocket\_ws Copy item path =============================== [Source](https://api.rocket.rs/v0.5/src/rocket_ws/lib.rs.html#1-326) [Search](https://api.rocket.rs/v0.5/rocket_ws/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description WebSocket support for Rocket. This crate implements support for WebSockets via Rocket’s [connection upgrade API](https://api.rocket.rs/v0.5/rocket/response/response/struct.Response.html#upgrading "struct rocket::response::response::Response") and [tungstenite](https://docs.rs/tokio-tungstenite/0.21.0/tokio_tungstenite/index.html "mod tokio_tungstenite") . [§](https://api.rocket.rs/v0.5/rocket_ws/index.html#usage) Usage ---------------------------------------------------------------- Depend on the crate. Here, we rename the dependency to `ws` for convenience: [dependencies] ws = { package = "rocket_ws", version = "0.1.1" } Then, use [`WebSocket`](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html "struct rocket_ws::WebSocket") as a request guard in any route and either call [`WebSocket::channel()`](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html#method.channel "method rocket_ws::WebSocket::channel") or return a stream via [`Stream!`](https://api.rocket.rs/v0.5/rocket_ws/macro.Stream.html "macro rocket_ws::Stream") or [`WebSocket::stream()`](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html#method.stream "method rocket_ws::WebSocket::stream") in the handler. The examples below are equivalent: #[get("/echo?channel")] fn echo_channel(ws: ws::WebSocket) -> ws::Channel<'static> { use rocket::futures::{SinkExt, StreamExt}; ws.channel(move |mut stream| Box::pin(async move { while let Some(message) = stream.next().await { let _ = stream.send(message?).await; } Ok(()) })) } #[get("/echo?stream")] fn echo_stream(ws: ws::WebSocket) -> ws::Stream!['static] { ws::Stream! { ws => for await message in ws { yield message?; } } } #[get("/echo?compose")] fn echo_compose(ws: ws::WebSocket) -> ws::Stream!['static] { ws.stream(|io| io) } WebSocket connections are configurable via [`WebSocket::config()`](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html#method.config "method rocket_ws::WebSocket::config") : #[get("/echo")] fn echo_stream(ws: ws::WebSocket) -> ws::Stream!['static] { let ws = ws.config(ws::Config { max_send_queue: Some(5), ..Default::default() }); ws::Stream! { ws => for await message in ws { yield message?; } } } Modules[§](https://api.rocket.rs/v0.5/rocket_ws/index.html#modules) -------------------------------------------------------------------- [frame](https://api.rocket.rs/v0.5/rocket_ws/frame/index.html "mod rocket_ws::frame") Structures for constructing raw WebSocket frames. [result](https://api.rocket.rs/v0.5/rocket_ws/result/index.html "mod rocket_ws::result") Library [`Error`](https://api.rocket.rs/v0.5/rocket_ws/result/enum.Error.html "enum rocket_ws::result::Error") and [`Result`](https://api.rocket.rs/v0.5/rocket_ws/result/type.Result.html "type rocket_ws::result::Result") types. [stream](https://api.rocket.rs/v0.5/rocket_ws/stream/index.html "mod rocket_ws::stream") Types representing incoming and/or outgoing `async` [`Message`](https://api.rocket.rs/v0.5/rocket_ws/enum.Message.html "enum rocket_ws::Message") streams. Macros[§](https://api.rocket.rs/v0.5/rocket_ws/index.html#macros) ------------------------------------------------------------------ [Stream](https://api.rocket.rs/v0.5/rocket_ws/macro.Stream.html "macro rocket_ws::Stream") Type and expression macro for `async` WebSocket [`Message`](https://api.rocket.rs/v0.5/rocket_ws/enum.Message.html "enum rocket_ws::Message") streams. Structs[§](https://api.rocket.rs/v0.5/rocket_ws/index.html#structs) -------------------------------------------------------------------- [Channel](https://api.rocket.rs/v0.5/rocket_ws/struct.Channel.html "struct rocket_ws::Channel") A streaming channel, returned by [`WebSocket::channel()`](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html#method.channel "method rocket_ws::WebSocket::channel") . [Config](https://api.rocket.rs/v0.5/rocket_ws/struct.Config.html "struct rocket_ws::Config") WebSocket connection configuration. [WebSocket](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html "struct rocket_ws::WebSocket") A request guard identifying WebSocket requests. Converts into a [`Channel`](https://api.rocket.rs/v0.5/rocket_ws/struct.Channel.html "struct rocket_ws::Channel") or [`MessageStream`](https://api.rocket.rs/v0.5/rocket_ws/stream/struct.MessageStream.html "struct rocket_ws::stream::MessageStream") . Enums[§](https://api.rocket.rs/v0.5/rocket_ws/index.html#enums) ---------------------------------------------------------------- [Message](https://api.rocket.rs/v0.5/rocket_ws/enum.Message.html "enum rocket_ws::Message") A WebSocket message. --- # rocket::mtls - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module mtls](https://api.rocket.rs/v0.5/rocket/mtls/index.html#) ------------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module mtls Copy item path ========================== [Source](https://api.rocket.rs/v0.5/src/rocket/mtls.rs.html#1-25) [Search](https://api.rocket.rs/v0.5/rocket/mtls/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Available on **crate feature `mtls`** only. Expand description Support for mutual TLS client certificates. For details on how to configure mutual TLS, see [`MutualTls`](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") and the [TLS guide](https://rocket.rs/v0.5/guide/configuration/#tls) . See [`Certificate`](https://api.rocket.rs/v0.5/rocket/mtls/struct.Certificate.html "struct rocket::mtls::Certificate") for a request guard that validated, verifies, and retrieves client certificates. Modules[§](https://api.rocket.rs/v0.5/rocket/mtls/index.html#modules) ---------------------------------------------------------------------- [bigint](https://api.rocket.rs/v0.5/rocket/mtls/bigint/index.html "mod rocket::mtls::bigint") Signed and unsigned big integer types re-exported from [`num_bigint`](https://docs.rs/num-bigint/0.4) . [oid](https://api.rocket.rs/v0.5/rocket/mtls/oid/index.html "mod rocket::mtls::oid") Lower-level OID types re-exported from [`oid_registry`](https://docs.rs/oid-registry/0.4) and [`der-parser`](https://docs.rs/der-parser/7) . [x509](https://api.rocket.rs/v0.5/rocket/mtls/x509/index.html "mod rocket::mtls::x509") Lower-level X.509 types re-exported from [`x509_parser`](https://docs.rs/x509-parser/0.13) . Structs[§](https://api.rocket.rs/v0.5/rocket/mtls/index.html#structs) ---------------------------------------------------------------------- [Certificate](https://api.rocket.rs/v0.5/rocket/mtls/struct.Certificate.html "struct rocket::mtls::Certificate") A request guard for validated, verified client certificates. [Name](https://api.rocket.rs/v0.5/rocket/mtls/struct.Name.html "struct rocket::mtls::Name") An X.509 Distinguished Name (DN) found in a [`Certificate`](https://api.rocket.rs/v0.5/rocket/mtls/struct.Certificate.html "struct rocket::mtls::Certificate") . Enums[§](https://api.rocket.rs/v0.5/rocket/mtls/index.html#enums) ------------------------------------------------------------------ [Error](https://api.rocket.rs/v0.5/rocket/mtls/enum.Error.html "enum rocket::mtls::Error") An error returned by the [`Certificate`](https://api.rocket.rs/v0.5/rocket/mtls/struct.Certificate.html "struct rocket::mtls::Certificate") request guard. Type Aliases[§](https://api.rocket.rs/v0.5/rocket/mtls/index.html#types) ------------------------------------------------------------------------- [Result](https://api.rocket.rs/v0.5/rocket/mtls/type.Result.html "type rocket::mtls::Result") A type alias for [`Result`](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") with the error type set to [`Error`](https://api.rocket.rs/v0.5/rocket/mtls/enum.Error.html "enum rocket::mtls::Error") . --- # rocket::serde::uuid - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module uuid](https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html#) ------------------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[serde](https://api.rocket.rs/v0.5/rocket/serde/index.html) Module uuid Copy item path ========================== [Source](https://api.rocket.rs/v0.5/src/rocket/serde/uuid.rs.html#1-122) [Search](https://api.rocket.rs/v0.5/rocket/serde/uuid/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Available on **crate feature `uuid`** only. Expand description UUID path/query parameter and form value parsing support. [§](https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html#enabling) Enabling ------------------------------------------------------------------------------ This module is only available when the `uuid` feature is enabled. Enable it in `Cargo.toml` as follows: [dependencies.rocket] version = "0.5.1" features = ["uuid"] [§](https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html#usage) Usage ------------------------------------------------------------------------ `Uuid` implements [`FromParam`](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html "trait rocket::request::FromParam") and [`FromFormField`](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField") (i.e, [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") ), allowing UUID values to be accepted directly in paths, queries, and forms. You can use the `Uuid` type directly as a target of a dynamic parameter: use rocket::serde::uuid::Uuid; #[get("/users/")] fn user(id: Uuid) -> String { format!("We found: {}", id) } You can also use the `Uuid` as a form value, including in query strings: use rocket::serde::uuid::Uuid; #[get("/user?")] fn user(id: Uuid) -> String { format!("User ID: {}", id) } Additionally, `Uuid` implements `UriDisplay

` for all `P`. As such, route URIs including `Uuid`s can be generated in a type-safe manner: use rocket::serde::uuid::Uuid; use rocket::response::Redirect; #[get("/user/")] fn user(id: Uuid) -> String { format!("User ID: {}", id) } #[get("/user?")] fn old_user_path(id: Uuid) -> Redirect { Redirect::to(uri!(user(id))) } [§](https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html#extra-features) Extra Features ------------------------------------------------------------------------------------------ The [`uuid`](https://docs.rs/uuid/1) crate exposes extra `v{n}` features for generating UUIDs which are not enabled by Rocket. To enable these features, depend on `uuid` directly. The extra functionality can be accessed via both `rocket::serde::uuid::Uuid` or the direct `uuid::Uuid`; the types are one and the same. [dependencies.uuid] version = "1" features = ["v1", "v4"] Modules[§](https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html#modules) ---------------------------------------------------------------------------- [fmt](https://api.rocket.rs/v0.5/rocket/serde/uuid/fmt/index.html "mod rocket::serde::uuid::fmt") Adapters for alternative string formats. Macros[§](https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html#macros) -------------------------------------------------------------------------- [uuid](https://api.rocket.rs/v0.5/rocket/serde/uuid/macro.uuid.html "macro rocket::serde::uuid::uuid") Parse [`Uuid`](https://docs.rs/uuid/*/uuid/struct.Uuid.html) s from string literals at compile time. Structs[§](https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html#structs) ---------------------------------------------------------------------------- [Builder](https://api.rocket.rs/v0.5/rocket/serde/uuid/struct.Builder.html "struct rocket::serde::uuid::Builder") A builder for creating a UUID. [Error](https://api.rocket.rs/v0.5/rocket/serde/uuid/struct.Error.html "struct rocket::serde::uuid::Error") Error returned on [`FromParam`](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html "trait rocket::request::FromParam") or [`FromFormField`](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField") failures. [Uuid](https://api.rocket.rs/v0.5/rocket/serde/uuid/struct.Uuid.html "struct rocket::serde::uuid::Uuid") A Universally Unique Identifier (UUID). Enums[§](https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html#enums) ------------------------------------------------------------------------ [Variant](https://api.rocket.rs/v0.5/rocket/serde/uuid/enum.Variant.html "enum rocket::serde::uuid::Variant") The reserved variants of UUIDs. [Version](https://api.rocket.rs/v0.5/rocket/serde/uuid/enum.Version.html "enum rocket::serde::uuid::Version") The version of the UUID, denoting the generating algorithm. Type Aliases[§](https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html#types) ------------------------------------------------------------------------------- [Bytes](https://api.rocket.rs/v0.5/rocket/serde/uuid/type.Bytes.html "type rocket::serde::uuid::Bytes") A 128-bit (16 byte) buffer containing the UUID. --- # rocket::serde::json - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module json](https://api.rocket.rs/v0.5/rocket/serde/json/index.html#) ------------------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[serde](https://api.rocket.rs/v0.5/rocket/serde/index.html) Module json Copy item path ========================== [Source](https://api.rocket.rs/v0.5/src/rocket/serde/json.rs.html#1-654) [Search](https://api.rocket.rs/v0.5/rocket/serde/json/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Available on **crate feature `json`** only. Expand description Automatic JSON (de)serialization support. See [`Json`](https://api.rocket.rs/v0.5/rocket/serde/json/struct.Json.html "struct rocket::serde::json::Json") for details. [§](https://api.rocket.rs/v0.5/rocket/serde/json/index.html#enabling) Enabling ------------------------------------------------------------------------------ This module is only available when the `json` feature is enabled. Enable it in `Cargo.toml` as follows: [dependencies.rocket] version = "0.5.1" features = ["json"] [§](https://api.rocket.rs/v0.5/rocket/serde/json/index.html#testing) Testing ---------------------------------------------------------------------------- The [`LocalRequest`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalRequest.html "struct rocket::local::blocking::LocalRequest") and [`LocalResponse`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalResponse.html "struct rocket::local::blocking::LocalResponse") types provide [`json()`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalRequest.html#method.json "method rocket::local::blocking::LocalRequest::json") and [`into_json()`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalResponse.html#method.into_json "method rocket::local::blocking::LocalResponse::into_json") methods to create a request with serialized JSON and deserialize a response as JSON, respectively. Macros[§](https://api.rocket.rs/v0.5/rocket/serde/json/index.html#macros) -------------------------------------------------------------------------- [json](https://api.rocket.rs/v0.5/rocket/serde/json/macro.json.html "macro rocket::serde::json::json") `nightly` A macro to create ad-hoc JSON serializable values using JSON syntax. Structs[§](https://api.rocket.rs/v0.5/rocket/serde/json/index.html#structs) ---------------------------------------------------------------------------- [Json](https://api.rocket.rs/v0.5/rocket/serde/json/struct.Json.html "struct rocket::serde::json::Json") The JSON guard: easily consume and return JSON. Enums[§](https://api.rocket.rs/v0.5/rocket/serde/json/index.html#enums) ------------------------------------------------------------------------ [Error](https://api.rocket.rs/v0.5/rocket/serde/json/enum.Error.html "enum rocket::serde::json::Error") Error returned by the [`Json`](https://api.rocket.rs/v0.5/rocket/serde/json/struct.Json.html "struct rocket::serde::json::Json") guard when JSON deserialization fails. [Value](https://api.rocket.rs/v0.5/rocket/serde/json/enum.Value.html "enum rocket::serde::json::Value") An arbitrary JSON value as returned by [`json!`](https://api.rocket.rs/v0.5/rocket/serde/json/macro.json.html "macro rocket::serde::json::json") . Functions[§](https://api.rocket.rs/v0.5/rocket/serde/json/index.html#functions) -------------------------------------------------------------------------------- [from\_slice](https://api.rocket.rs/v0.5/rocket/serde/json/fn.from_slice.html "fn rocket::serde::json::from_slice") Deserialize an instance of type `T` from bytes of JSON text. [from\_str](https://api.rocket.rs/v0.5/rocket/serde/json/fn.from_str.html "fn rocket::serde::json::from_str") Deserialize an instance of type `T` from a string of JSON text. [from\_value](https://api.rocket.rs/v0.5/rocket/serde/json/fn.from_value.html "fn rocket::serde::json::from_value") Interpret a [`Value`](https://api.rocket.rs/v0.5/rocket/serde/json/enum.Value.html "enum rocket::serde::json::Value") as an instance of type `T`. [to\_pretty\_string](https://api.rocket.rs/v0.5/rocket/serde/json/fn.to_pretty_string.html "fn rocket::serde::json::to_pretty_string") Serialize a `T` into a JSON string with “pretty” formatted representation. [to\_string](https://api.rocket.rs/v0.5/rocket/serde/json/fn.to_string.html "fn rocket::serde::json::to_string") Serialize a `T` into a JSON string with compact representation. [to\_value](https://api.rocket.rs/v0.5/rocket/serde/json/fn.to_value.html "fn rocket::serde::json::to_value") Convert a `T` into a [`Value`](https://api.rocket.rs/v0.5/rocket/serde/json/enum.Value.html "enum rocket::serde::json::Value") , an opaque value representing JSON data. --- # rocket::fairing - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module fairing](https://api.rocket.rs/v0.5/rocket/fairing/index.html#) ------------------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module fairing Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket/fairing/mod.rs.html#1-567) [Search](https://api.rocket.rs/v0.5/rocket/fairing/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Fairings: callbacks at launch, liftoff, request, and response time. Fairings allow for structured interposition at various points in the application lifetime. Fairings can be seen as a restricted form of “middleware”. A fairing is an arbitrary structure with methods representing callbacks that Rocket will run at requested points in a program. You can use fairings to rewrite or record information about requests and responses, or to perform an action once a Rocket application has launched. To learn more about writing a fairing, see the [`Fairing`](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html "trait rocket::fairing::Fairing") trait documentation. You can also use [`AdHoc`](https://api.rocket.rs/v0.5/rocket/fairing/struct.AdHoc.html "struct rocket::fairing::AdHoc") to create a fairing on-the-fly from a closure or function. ### [§](https://api.rocket.rs/v0.5/rocket/fairing/index.html#attaching) Attaching You must inform Rocket about fairings that you wish to be active by calling [`Rocket::attach()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.attach "method rocket::Rocket::attach") method on the application’s [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") instance and passing in the appropriate [`Fairing`](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html "trait rocket::fairing::Fairing") . For instance, to attach fairings named `req_fairing` and `res_fairing` to a new Rocket instance, you might write: let rocket = rocket::build() .attach(req_fairing) .attach(res_fairing); Once a fairing is attached, Rocket will execute it at the appropriate time, which varies depending on the fairing implementation. See the [`Fairing`](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html "trait rocket::fairing::Fairing") trait documentation for more information on the dispatching of fairing methods. ### [§](https://api.rocket.rs/v0.5/rocket/fairing/index.html#ordering) Ordering `Fairing`s are executed in the order in which they are attached: the first attached fairing has its callbacks executed before all others. A fairing can be attached any number of times. Except for [singleton fairings](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html#singletons "trait rocket::fairing::Fairing") , all attached instances are polled at runtime. Fairing callbacks may not be commutative; the order in which fairings are attached may be significant. It is thus important to communicate specific fairing functionality clearly. Furthermore, a `Fairing` should take care to act locally so that the actions of other `Fairings` are not jeopardized. For instance, unless it is made abundantly clear, a fairing should not rewrite every request. Structs[§](https://api.rocket.rs/v0.5/rocket/fairing/index.html#structs) ------------------------------------------------------------------------- [AdHoc](https://api.rocket.rs/v0.5/rocket/fairing/struct.AdHoc.html "struct rocket::fairing::AdHoc") A ad-hoc fairing that can be created from a function or closure. [Info](https://api.rocket.rs/v0.5/rocket/fairing/struct.Info.html "struct rocket::fairing::Info") Information about a [`Fairing`](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html "trait rocket::fairing::Fairing") . [Kind](https://api.rocket.rs/v0.5/rocket/fairing/struct.Kind.html "struct rocket::fairing::Kind") A bitset representing the kinds of callbacks a [`Fairing`](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html "trait rocket::fairing::Fairing") wishes to receive. Traits[§](https://api.rocket.rs/v0.5/rocket/fairing/index.html#traits) ----------------------------------------------------------------------- [Fairing](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html "trait rocket::fairing::Fairing") Trait implemented by fairings: Rocket’s structured middleware. Type Aliases[§](https://api.rocket.rs/v0.5/rocket/fairing/index.html#types) ---------------------------------------------------------------------------- [Result](https://api.rocket.rs/v0.5/rocket/fairing/type.Result.html "type rocket::fairing::Result") A type alias for the return `Result` type of [`Fairing::on_ignite()`](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html#method.on_ignite "method rocket::fairing::Fairing::on_ignite") . --- # rocket::error - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module error](https://api.rocket.rs/v0.5/rocket/error/index.html#) -------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module error Copy item path =========================== [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#1-281) [Search](https://api.rocket.rs/v0.5/rocket/error/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Types representing various errors that can occur in a Rocket application. Structs[§](https://api.rocket.rs/v0.5/rocket/error/index.html#structs) ----------------------------------------------------------------------- [Error](https://api.rocket.rs/v0.5/rocket/error/struct.Error.html "struct rocket::error::Error") An error that occurs during launch. Enums[§](https://api.rocket.rs/v0.5/rocket/error/index.html#enums) ------------------------------------------------------------------- [ErrorKind](https://api.rocket.rs/v0.5/rocket/error/enum.ErrorKind.html "enum rocket::error::ErrorKind") The kind error that occurred. --- # rocket::config - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module config](https://api.rocket.rs/v0.5/rocket/config/index.html#) ---------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module config Copy item path ============================ [Source](https://api.rocket.rs/v0.5/src/rocket/config/mod.rs.html#1-682) [Search](https://api.rocket.rs/v0.5/rocket/config/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Server and application configuration. See the [configuration guide](https://rocket.rs/v0.5/guide/configuration/) for full details. ### [§](https://api.rocket.rs/v0.5/rocket/config/index.html#extracting-configuration-parameters) Extracting Configuration Parameters Rocket exposes the active [`Figment`](https://docs.rs/figment/0.10.19/figment/figment/struct.Figment.html "struct figment::figment::Figment") via [`Rocket::figment()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.figment "method rocket::Rocket::figment") . Any value that implements [`Deserialize`](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") can be extracted from the figment: use rocket::fairing::AdHoc; #[derive(serde::Deserialize)] struct AppConfig { id: Option, port: u16, } #[rocket::launch] fn rocket() -> _ { rocket::build().attach(AdHoc::config::()) } ### [§](https://api.rocket.rs/v0.5/rocket/config/index.html#workers) Workers The `workers` parameter sets the number of threads used for parallel task execution; there is no limit to the number of concurrent tasks. Due to a limitation in upstream async executers, unlike other values, the `workers` configuration value cannot be reconfigured or be configured from sources other than those provided by [`Config::figment()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.figment "associated function rocket::Config::figment") . In other words, only the values set by the `ROCKET_WORKERS` environment variable or in the `workers` property of `Rocket.toml` will be considered - all other `workers` values are ignored. ### [§](https://api.rocket.rs/v0.5/rocket/config/index.html#custom-providers) Custom Providers A custom provider can be set via [`rocket::custom()`](https://api.rocket.rs/v0.5/rocket/fn.custom.html "fn rocket::custom") , which replaces calls to [`rocket::build()`](https://api.rocket.rs/v0.5/rocket/fn.build.html "fn rocket::build") . The configured provider can be built on top of [`Config::figment()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.figment "associated function rocket::Config::figment") , [`Config::default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.default "associated function rocket::Config::default") , both, or neither. The [Figment](https://docs.rs/figment/0.10.19/figment/index.html "mod figment") documentation has full details on instantiating existing providers like [`Toml`](https://api.rocket.rs/v0.5/rocket/config/index.html) and [`Env`](https://docs.rs/figment/0.10.19/figment/providers/env/struct.Env.html "struct figment::providers::env::Env") as well as creating custom providers for more complex cases. Configuration values can be overridden at runtime by merging figment’s tuple providers with Rocket’s default provider: use rocket::data::{Limits, ToByteUnit}; #[launch] fn rocket() -> _ { let figment = rocket::Config::figment() .merge(("port", 1111)) .merge(("limits", Limits::new().limit("json", 2.mebibytes()))); rocket::custom(figment).mount("/", routes![/* .. */]) } An application that wants to use Rocket’s defaults for [`Config`](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") , but not its configuration sources, while allowing the application to be configured via an `App.toml` file that uses top-level keys as profiles (`.nested()`) and `APP_` environment variables as global overrides (`.global()`), and `APP_PROFILE` to configure the selected profile, can be structured as follows: use serde::{Serialize, Deserialize}; use figment::{Figment, Profile, providers::{Format, Toml, Serialized, Env}}; use rocket::fairing::AdHoc; #[derive(Debug, Deserialize, Serialize)] struct Config { app_value: usize, /* and so on.. */ } impl Default for Config { fn default() -> Config { Config { app_value: 3, } } } #[launch] fn rocket() -> _ { let figment = Figment::from(rocket::Config::default()) .merge(Serialized::defaults(Config::default())) .merge(Toml::file("App.toml").nested()) .merge(Env::prefixed("APP_").global()) .select(Profile::from_env_or("APP_PROFILE", "default")); rocket::custom(figment) .mount("/", routes![/* .. */]) .attach(AdHoc::config::()) } Structs[§](https://api.rocket.rs/v0.5/rocket/config/index.html#structs) ------------------------------------------------------------------------ [Config](https://api.rocket.rs/v0.5/rocket/config/struct.Config.html "struct rocket::config::Config") Rocket server configuration. [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") An identifier (or `None`) to send as the `Server` header. [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") `mtls` Mutual TLS configuration. [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") `secrets` A cryptographically secure secret key. [Shutdown](https://api.rocket.rs/v0.5/rocket/config/struct.Shutdown.html "struct rocket::config::Shutdown") Graceful shutdown configuration. [TlsConfig](https://api.rocket.rs/v0.5/rocket/config/struct.TlsConfig.html "struct rocket::config::TlsConfig") `tls` TLS configuration: certificate chain, key, and ciphersuites. Enums[§](https://api.rocket.rs/v0.5/rocket/config/index.html#enums) -------------------------------------------------------------------- [CipherSuite](https://api.rocket.rs/v0.5/rocket/config/enum.CipherSuite.html "enum rocket::config::CipherSuite") `tls` A supported TLS cipher suite. [LogLevel](https://api.rocket.rs/v0.5/rocket/config/enum.LogLevel.html "enum rocket::config::LogLevel") Defines the maximum level of log messages to show. [Sig](https://api.rocket.rs/v0.5/rocket/config/enum.Sig.html "enum rocket::config::Sig") Unix A Unix signal for triggering graceful shutdown. --- # rocket::catcher - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module catcher](https://api.rocket.rs/v0.5/rocket/catcher/index.html#) ------------------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module catcher Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/mod.rs.html#1-7) [Search](https://api.rocket.rs/v0.5/rocket/catcher/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Types and traits for error catchers and their handlers and return types. Structs[§](https://api.rocket.rs/v0.5/rocket/catcher/index.html#structs) ------------------------------------------------------------------------- [Catcher](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher.html "struct rocket::catcher::Catcher") An error catching route. Traits[§](https://api.rocket.rs/v0.5/rocket/catcher/index.html#traits) ----------------------------------------------------------------------- [Cloneable](https://api.rocket.rs/v0.5/rocket/catcher/trait.Cloneable.html "trait rocket::catcher::Cloneable") Helper trait to make a [`Catcher`](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher") ’s `Box` `Clone`. [Handler](https://api.rocket.rs/v0.5/rocket/catcher/trait.Handler.html "trait rocket::catcher::Handler") Trait implemented by [`Catcher`](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher") error handlers. Type Aliases[§](https://api.rocket.rs/v0.5/rocket/catcher/index.html#types) ---------------------------------------------------------------------------- [BoxFuture](https://api.rocket.rs/v0.5/rocket/catcher/type.BoxFuture.html "type rocket::catcher::BoxFuture") Type alias for the return type of a _raw_ [`Catcher`](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher") ’s [`Handler`](https://api.rocket.rs/v0.5/rocket/catcher/trait.Handler.html "trait rocket::catcher::Handler") . [Result](https://api.rocket.rs/v0.5/rocket/catcher/type.Result.html "type rocket::catcher::Result") Type alias for the return type of a [`Catcher`](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher") ’s [`Handler::handle()`](https://api.rocket.rs/v0.5/rocket/catcher/trait.Handler.html#tymethod.handle "method rocket::catcher::Handler::handle") . --- # rocket::data - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module data](https://api.rocket.rs/v0.5/rocket/data/index.html#) ------------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module data Copy item path ========================== [Source](https://api.rocket.rs/v0.5/src/rocket/data/mod.rs.html#1-19) [Search](https://api.rocket.rs/v0.5/rocket/data/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Types and traits for handling incoming body data. Structs[§](https://api.rocket.rs/v0.5/rocket/data/index.html#structs) ---------------------------------------------------------------------- [ByteUnit](https://api.rocket.rs/v0.5/rocket/data/struct.ByteUnit.html "struct rocket::data::ByteUnit") A unit of bytes with saturating `const` constructors and arithmetic. [Capped](https://api.rocket.rs/v0.5/rocket/data/struct.Capped.html "struct rocket::data::Capped") Encapsulates a value capped to a data limit. [Data](https://api.rocket.rs/v0.5/rocket/data/struct.Data.html "struct rocket::data::Data") Type representing the body data of a request. [DataStream](https://api.rocket.rs/v0.5/rocket/data/struct.DataStream.html "struct rocket::data::DataStream") Raw data stream of a request body. [IoStream](https://api.rocket.rs/v0.5/rocket/data/struct.IoStream.html "struct rocket::data::IoStream") A bidirectional, raw stream to the client. [Limits](https://api.rocket.rs/v0.5/rocket/data/struct.Limits.html "struct rocket::data::Limits") Mapping from (hierarchical) data types to size limits. [N](https://api.rocket.rs/v0.5/rocket/data/struct.N.html "struct rocket::data::N") Number of bytes read/written and whether that consisted of the entire stream. Traits[§](https://api.rocket.rs/v0.5/rocket/data/index.html#traits) -------------------------------------------------------------------- [FromData](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html "trait rocket::data::FromData") Trait implemented by data guards to derive a value from request body data. [IoHandler](https://api.rocket.rs/v0.5/rocket/data/trait.IoHandler.html "trait rocket::data::IoHandler") An upgraded connection I/O handler. [ToByteUnit](https://api.rocket.rs/v0.5/rocket/data/trait.ToByteUnit.html "trait rocket::data::ToByteUnit") Extension trait for conversion from integer types to [`ByteUnit`](https://api.rocket.rs/v0.5/rocket/data/struct.ByteUnit.html "struct rocket::data::ByteUnit") . Type Aliases[§](https://api.rocket.rs/v0.5/rocket/data/index.html#types) ------------------------------------------------------------------------- [Outcome](https://api.rocket.rs/v0.5/rocket/data/type.Outcome.html "type rocket::data::Outcome") Type alias for the `Outcome` of [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html "trait rocket::data::FromData") . --- # rocket::local - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module local](https://api.rocket.rs/v0.5/rocket/local/index.html#) -------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module local Copy item path =========================== [Source](https://api.rocket.rs/v0.5/src/rocket/local/mod.rs.html#1-187) [Search](https://api.rocket.rs/v0.5/rocket/local/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Structures for local dispatching of requests, primarily for testing. This module allows for simple request dispatching against a local, non-networked instance of Rocket. The primary use of this module is to unit and integration test Rocket applications by crafting requests, dispatching them, and verifying the response. [§](https://api.rocket.rs/v0.5/rocket/local/index.html#async-vs-blocking) Async. vs. Blocking --------------------------------------------------------------------------------------------- This module contains two variants, in its two submodules, of the same local API: [`asynchronous`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/index.html "mod rocket::local::asynchronous") , and [`blocking`](https://api.rocket.rs/v0.5/rocket/local/blocking/index.html "mod rocket::local::blocking") . As their names imply, the `asynchronous` API is `async`, returning a `Future` for operations that would otherwise block, while `blocking` blocks for the same operations. Unless your request handling requires concurrency to make progress, or you’re making use of a `Client` in an environment that necessitates or would benefit from concurrency, you should use the `blocking` set of APIs due their ease-of-use. If your request handling _does_ require concurrency to make progress, for instance by having one handler `await` a response generated from a request to another handler, use the `asynchronous` set of APIs. Both APIs include a `Client` structure that is used to create `LocalRequest` structures that can be dispatched against a given [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") instance to yield a `LocalResponse` structure. The APIs are identical except in that the `asynchronous` APIs return `Future`s for otherwise blocking operations. [§](https://api.rocket.rs/v0.5/rocket/local/index.html#unitintegration-testing) Unit/Integration Testing -------------------------------------------------------------------------------------------------------- This module is primarily intended to be used to test a Rocket application by constructing requests via `Client`, dispatching them, and validating the resulting response. As a complete example, consider the following “Hello, world!” application, with testing. #[macro_use] extern crate rocket; #[get("/")] fn hello() -> &'static str { "Hello, world!" } #[launch] fn rocket() -> _ { rocket::build().mount("/", routes![hello]) } #[cfg(test)] mod test { // Using the preferred `blocking` API. #[test] fn test_hello_world_blocking() { use rocket::local::blocking::Client; // Construct a client to use for dispatching requests. let client = Client::tracked(super::rocket()) .expect("valid `Rocket`"); // Dispatch a request to 'GET /' and validate the response. let response = client.get("/").dispatch(); assert_eq!(response.into_string().unwrap(), "Hello, world!"); } // Using the `asynchronous` API. #[rocket::async_test] async fn test_hello_world_async() { use rocket::local::asynchronous::Client; // Construct a client to use for dispatching requests. let client = Client::tracked(super::rocket()).await .expect("valid `Rocket`"); // Dispatch a request to 'GET /' and validate the response. let response = client.get("/").dispatch().await; assert_eq!(response.into_string().await.unwrap(), "Hello, world!"); } } For more details on testing, see the [testing guide](https://rocket.rs/v0.5/guide/testing/) . [§](https://api.rocket.rs/v0.5/rocket/local/index.html#client) `Client` ----------------------------------------------------------------------- A `Client`, either [`blocking::Client`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.Client.html "struct rocket::local::blocking::Client") or [`asynchronous::Client`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.Client.html "struct rocket::local::asynchronous::Client") , referred to as simply [`Client`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.Client.html "struct rocket::local::asynchronous::Client") and [`async` `Client`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.Client.html "struct rocket::local::asynchronous::Client") , respectively, constructs requests for local dispatching. **Usage** A `Client` is constructed via the [`tracked()`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.Client.html#method.tracked "associated function rocket::local::blocking::Client::tracked") ([`async` `tracked()`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.Client.html#method.tracked "associated function rocket::local::asynchronous::Client::tracked") ) or [`untracked()`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.Client.html#method.untracked "associated function rocket::local::blocking::Client::untracked") ([`async` `untracked()`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.Client.html#method.untracked "associated function rocket::local::asynchronous::Client::untracked") ) methods from an already constructed `Rocket` instance. Once a value of `Client` has been constructed, [`get()`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.Client.html#method.get "method rocket::local::blocking::Client::get") , [`put()`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.Client.html#method.put "method rocket::local::blocking::Client::put") , [`post()`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.Client.html#method.post "method rocket::local::blocking::Client::post") , and so on ([`async` `get()`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.Client.html#method.get "method rocket::local::asynchronous::Client::get") , [`async` `put()`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.Client.html#method.put "method rocket::local::asynchronous::Client::put") , [`async` `post()`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.Client.html#method.post "method rocket::local::asynchronous::Client::post") ) can be called to create a [`LocalRequest`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalRequest.html "struct rocket::local::blocking::LocalRequest") ([`async` `LocalRequest`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.LocalRequest.html "struct rocket::local::asynchronous::LocalRequest") ) for dispatching. **Cookie Tracking** A `Client` constructed using `tracked()` propagates cookie changes made by responses to previously dispatched requests. In other words, if a previously dispatched request resulted in a response that adds a cookie, any future requests will contain that cookie. Similarly, cookies removed by a response won’t be propagated further. This is typically the desired mode of operation for a `Client` as it removes the burden of manually tracking cookies. Under some circumstances, however, disabling this tracking may be desired. In these cases, use the `untracked()` constructor to create a `Client` that _will not_ track cookies. **Example** For a usage example, see [`Client`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.Client.html "struct rocket::local::asynchronous::Client") or [`async` `Client`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.Client.html "struct rocket::local::asynchronous::Client") . [§](https://api.rocket.rs/v0.5/rocket/local/index.html#localrequest) `LocalRequest` ----------------------------------------------------------------------------------- A [`LocalRequest`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalRequest.html "struct rocket::local::blocking::LocalRequest") ([`async` `LocalRequest`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.LocalRequest.html "struct rocket::local::asynchronous::LocalRequest") ) is constructed via a `Client`. Once obtained, headers, cookies, including private cookies, the remote IP address, and the request body can all be set via methods on the `LocalRequest` structure. **Dispatching** A `LocalRequest` is dispatched by calling [`dispatch()`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalRequest.html#method.dispatch "method rocket::local::blocking::LocalRequest::dispatch") ([`async` `dispatch()`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.LocalRequest.html#method.dispatch "method rocket::local::asynchronous::LocalRequest::dispatch") ). The `LocalRequest` is consumed and a [`LocalResponse`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalResponse.html "struct rocket::local::blocking::LocalResponse") ([`async` `LocalResponse`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.LocalResponse.html "struct rocket::local::asynchronous::LocalResponse") ) is returned. Note that `LocalRequest` implements [`Clone`](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") . As such, if the same request needs to be dispatched multiple times, the request can first be cloned and then dispatched: `request.clone().dispatch()`. **Example** For a usage example, see [`LocalRequest`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalRequest.html "struct rocket::local::blocking::LocalRequest") or [`async` `LocalRequest`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.LocalRequest.html "struct rocket::local::asynchronous::LocalRequest") . [§](https://api.rocket.rs/v0.5/rocket/local/index.html#localresponse) `LocalResponse` ------------------------------------------------------------------------------------- The result of `dispatch()`ing a `LocalRequest` is a [`LocalResponse`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalResponse.html "struct rocket::local::blocking::LocalResponse") ([`async` `LocalResponse`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.LocalResponse.html "struct rocket::local::asynchronous::LocalResponse") ). A `LocalResponse` can be queried for response metadata, including the HTTP status, headers, and cookies, via its getter methods. Additionally, the body of the response can be read into a string ([`into_string()`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalResponse.html#method.into_string "method rocket::local::blocking::LocalResponse::into_string") or [`async` `into_string()`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.LocalResponse.html#method.into_string "method rocket::local::asynchronous::LocalResponse::into_string") ) or a vector ([`into_bytes()`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalResponse.html#method.into_bytes "method rocket::local::blocking::LocalResponse::into_bytes") or [`async` `into_bytes()`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.LocalResponse.html#method.into_bytes "method rocket::local::asynchronous::LocalResponse::into_bytes") ). The response body must also be read directly using standard I/O mechanisms: the `blocking` `LocalResponse` implements `Read` while the `async` `LocalResponse` implements `AsyncRead`. For a usage example, see [`LocalResponse`](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalResponse.html "struct rocket::local::blocking::LocalResponse") or [`async` `LocalResponse`](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.LocalResponse.html "struct rocket::local::asynchronous::LocalResponse") . Modules[§](https://api.rocket.rs/v0.5/rocket/local/index.html#modules) ----------------------------------------------------------------------- [asynchronous](https://api.rocket.rs/v0.5/rocket/local/asynchronous/index.html "mod rocket::local::asynchronous") Asynchronous local dispatching of requests. [blocking](https://api.rocket.rs/v0.5/rocket/local/blocking/index.html "mod rocket::local::blocking") Blocking local dispatching of requests. --- # rocket::fs - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module fs](https://api.rocket.rs/v0.5/rocket/fs/index.html#) -------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module fs Copy item path ======================== [Source](https://api.rocket.rs/v0.5/src/rocket/fs/mod.rs.html#1-12) [Search](https://api.rocket.rs/v0.5/rocket/fs/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description File serving, file accepting, and file metadata types. Macros[§](https://api.rocket.rs/v0.5/rocket/fs/index.html#macros) ------------------------------------------------------------------ [relative](https://api.rocket.rs/v0.5/rocket/fs/macro.relative.html "macro rocket::fs::relative") `nightly` Generates a crate-relative version of a path. Structs[§](https://api.rocket.rs/v0.5/rocket/fs/index.html#structs) -------------------------------------------------------------------- [FileName](https://api.rocket.rs/v0.5/rocket/fs/struct.FileName.html "struct rocket::fs::FileName") A file name in a [`TempFile`](https://api.rocket.rs/v0.5/rocket/fs/enum.TempFile.html "enum rocket::fs::TempFile") or multipart [`DataField`](https://api.rocket.rs/v0.5/rocket/form/struct.DataField.html "struct rocket::form::DataField") . [FileServer](https://api.rocket.rs/v0.5/rocket/fs/struct.FileServer.html "struct rocket::fs::FileServer") Custom handler for serving static files. [NamedFile](https://api.rocket.rs/v0.5/rocket/fs/struct.NamedFile.html "struct rocket::fs::NamedFile") A [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") that sends file data with a Content-Type based on its file extension. [Options](https://api.rocket.rs/v0.5/rocket/fs/struct.Options.html "struct rocket::fs::Options") A bitset representing configurable options for [`FileServer`](https://api.rocket.rs/v0.5/rocket/fs/struct.FileServer.html "struct rocket::fs::FileServer") . Enums[§](https://api.rocket.rs/v0.5/rocket/fs/index.html#enums) ---------------------------------------------------------------- [TempFile](https://api.rocket.rs/v0.5/rocket/fs/enum.TempFile.html "enum rocket::fs::TempFile") A data and form guard that streams data into a temporary file. --- # rocket::outcome - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module outcome](https://api.rocket.rs/v0.5/rocket/outcome/index.html#) ------------------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module outcome Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket/outcome.rs.html#1-867) [Search](https://api.rocket.rs/v0.5/rocket/outcome/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Success, error, and forward handling. The `Outcome` type is similar to the standard library’s `Result` type. It is an enum with three variants, each containing a value: `Success(S)`, which represents a successful outcome, `Error(E)`, which represents an erroring outcome, and `Forward(F)`, which represents neither a success or error, but instead, indicates that processing could not be handled and should instead be _forwarded_ to whatever can handle the processing next. The `Outcome` type is the return type of many of the core Rocket traits, including [`FromRequest`](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html "trait rocket::request::FromRequest") , [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html "trait rocket::data::FromData") [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") . It is also the return type of request handlers via the [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") type. [§](https://api.rocket.rs/v0.5/rocket/outcome/index.html#success) Success ------------------------------------------------------------------------- A successful `Outcome`, `Success(S)`, is returned from functions that complete successfully. The meaning of a `Success` outcome depends on the context. For instance, the `Outcome` of the `from_data` method of the [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html "trait rocket::data::FromData") trait will be matched against the type expected by the user. For example, consider the following handler: #[post("/", data = "")] fn hello(my_val: S) { /* ... */ } The [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html "trait rocket::data::FromData") implementation for the type `S` returns an `Outcome` with a `Success(S)`. If `from_data` returns a `Success`, the `Success` value will be unwrapped and the value will be used as the value of `my_val`. [§](https://api.rocket.rs/v0.5/rocket/outcome/index.html#error) Error --------------------------------------------------------------------- An error `Outcome`, `Error(E)`, is returned when a function fails with some error and no processing can or should continue as a result. The meaning of an error depends on the context. In Rocket, an `Error` generally means that a request is taken out of normal processing. The request is then given to the catcher corresponding to some status code. Users can catch errors by requesting a type of `Result` or `Option` in request handlers. For example, if a user’s handler looks like: #[post("/", data = "")] fn hello(my_val: Result) { /* ... */ } The [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html "trait rocket::data::FromData") implementation for the type `S` returns an `Outcome` with a `Success(S)` and `Error(E)`. If `from_data` returns an `Error`, the `Error` value will be unwrapped and the value will be used as the `Err` value of `my_val` while a `Success` will be unwrapped and used the `Ok` value. [§](https://api.rocket.rs/v0.5/rocket/outcome/index.html#forward) Forward ------------------------------------------------------------------------- A forward `Outcome`, `Forward(F)`, is returned when a function wants to indicate that the requested processing should be _forwarded_ to the next available processor. Again, the exact meaning depends on the context. In Rocket, a `Forward` generally means that a request is forwarded to the next available request handler. For example, consider the following request handler: #[post("/", data = "")] fn hello(my_val: S) { /* ... */ } The [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html "trait rocket::data::FromData") implementation for the type `S` returns an `Outcome` with a `Success(S)`, `Error(E)`, and `Forward(F)`. If the `Outcome` is a `Forward`, the `hello` handler isn’t called. Instead, the incoming request is forwarded, or passed on to, the next matching route, if any. Ultimately, if there are no non-forwarding routes, forwarded requests are handled by the 404 catcher. Similar to `Error`s, users can catch `Forward`s by requesting a type of `Option`. If an `Outcome` is a `Forward`, the `Option` will be `None`. Macros[§](https://api.rocket.rs/v0.5/rocket/outcome/index.html#macros) ----------------------------------------------------------------------- [try\_outcome](https://api.rocket.rs/v0.5/rocket/outcome/macro.try_outcome.html "macro rocket::outcome::try_outcome") `nightly` Unwraps a [`Success`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html#variant.Success "variant rocket::outcome::Outcome::Success") or propagates a `Forward` or `Error` by returning early. Enums[§](https://api.rocket.rs/v0.5/rocket/outcome/index.html#enums) --------------------------------------------------------------------- [Outcome](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html "enum rocket::outcome::Outcome") An enum representing success (`Success`), error (`Error`), or forwarding (`Forward`). Traits[§](https://api.rocket.rs/v0.5/rocket/outcome/index.html#traits) ----------------------------------------------------------------------- [IntoOutcome](https://api.rocket.rs/v0.5/rocket/outcome/trait.IntoOutcome.html "trait rocket::outcome::IntoOutcome") Conversion trait from some type into an Outcome type. --- # rocket::form - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module form](https://api.rocket.rs/v0.5/rocket/form/index.html#) ------------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module form Copy item path ========================== [Source](https://api.rocket.rs/v0.5/src/rocket/form/mod.rs.html#1-406) [Search](https://api.rocket.rs/v0.5/rocket/form/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Parsing and validation of HTTP forms and fields. See the [forms guide](https://rocket.rs/v0.5/guide/requests#forms) for general form support documentation. [§](https://api.rocket.rs/v0.5/rocket/form/index.html#field-wire-format) Field Wire Format ------------------------------------------------------------------------------------------ Rocket’s field wire format is a flexible, non-self-descriptive, text-based encoding of arbitrarily nested structure keys and their corresponding values. The general grammar is: field := name ('=' value)? name := key* key := indices | '[' indices ']' | '.' indices indices := index (':' index)* index := STRING except ':', ']' value := STRING Each field name consists of any number of `key`s and at most one `value`. Keys are delimited by `[` or `.`. A `key` consists of indices delimited by `:`.\ \ The meaning of a key or index is type-dependent, hence the format is non-self-descriptive. _Any_ structure can be described by this format. The delimiters `.`, `[`, `:`, and `]` have no semantic meaning.\ \ Some examples of valid fields are:\ \ * `=`\ * `key=value`\ * `key[]=value`\ * `.0=value`\ * `[0]=value`\ * `people[].name=Bob`\ * `bob.cousin.names[]=Bob`\ * `map[k:1]=Bob`\ * `people[bob]nickname=Stan`\ \ See [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm")\ for full details on push-parsing and complete examples, and [`Form`](https://api.rocket.rs/v0.5/rocket/form/struct.Form.html "struct rocket::form::Form")\ for how to accept forms in a request handler.\ \ Modules[§](https://api.rocket.rs/v0.5/rocket/form/index.html#modules)\ \ ----------------------------------------------------------------------\ \ [error](https://api.rocket.rs/v0.5/rocket/form/error/index.html "mod rocket::form::error")\ \ Form error types.\ \ [name](https://api.rocket.rs/v0.5/rocket/form/name/index.html "mod rocket::form::name")\ \ Types for field names, name keys, and key indices.\ \ [validate](https://api.rocket.rs/v0.5/rocket/form/validate/index.html "mod rocket::form::validate")\ \ Form field validation routines.\ \ Structs[§](https://api.rocket.rs/v0.5/rocket/form/index.html#structs)\ \ ----------------------------------------------------------------------\ \ [Context](https://api.rocket.rs/v0.5/rocket/form/struct.Context.html "struct rocket::form::Context")\ \ A form context containing received fields, values, and encountered errors.\ \ [Contextual](https://api.rocket.rs/v0.5/rocket/form/struct.Contextual.html "struct rocket::form::Contextual")\ \ An infallible form guard that records form fields and errors during parsing.\ \ [DataField](https://api.rocket.rs/v0.5/rocket/form/struct.DataField.html "struct rocket::form::DataField")\ \ A multipart form field with an underlying data stream.\ \ [Error](https://api.rocket.rs/v0.5/rocket/form/struct.Error.html "struct rocket::form::Error")\ \ A form error, potentially tied to a specific form field.\ \ [Errors](https://api.rocket.rs/v0.5/rocket/form/struct.Errors.html "struct rocket::form::Errors")\ \ A collection of [`Error`](https://api.rocket.rs/v0.5/rocket/form/struct.Error.html "struct rocket::form::Error")\ s.\ \ [Form](https://api.rocket.rs/v0.5/rocket/form/struct.Form.html "struct rocket::form::Form")\ \ A data guard for [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm")\ types.\ \ [Lenient](https://api.rocket.rs/v0.5/rocket/form/struct.Lenient.html "struct rocket::form::Lenient")\ \ A form guard for parsing form types leniently.\ \ [Options](https://api.rocket.rs/v0.5/rocket/form/struct.Options.html "struct rocket::form::Options")\ \ Form guard options.\ \ [Strict](https://api.rocket.rs/v0.5/rocket/form/struct.Strict.html "struct rocket::form::Strict")\ \ A form guard for parsing form types strictly.\ \ [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ \ A form field with a string value.\ \ Traits[§](https://api.rocket.rs/v0.5/rocket/form/index.html#traits)\ \ --------------------------------------------------------------------\ \ [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm")\ \ Trait implemented by form guards: types parseable from HTTP forms.\ \ [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ \ Implied form guard ([`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm")\ ) for parsing a single form field.\ \ Type Aliases[§](https://api.rocket.rs/v0.5/rocket/form/index.html#types)\ \ -------------------------------------------------------------------------\ \ [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ \ Type alias for `Result` with an error type of [`Errors`](https://api.rocket.rs/v0.5/rocket/form/struct.Errors.html "struct rocket::form::Errors")\ . --- # Phase in rocket - Rust [Phase](https://api.rocket.rs/v0.5/rocket/trait.Phase#) -------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Trait Phase Copy item path ========================== [Source](https://api.rocket.rs/v0.5/src/rocket/phase.rs.html#26-29) pub trait Phase: Sealed { } Expand description A marker trait for Rocket’s launch phases. This treat is implemented by the three phase marker types: [`Build`](https://api.rocket.rs/v0.5/rocket/enum.Build.html "enum rocket::Build") , [`Ignite`](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") , and [`Orbit`](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html "enum rocket::Orbit") , representing the three phases to launch an instance of [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") . This trait is _sealed_ and cannot be implemented outside of Rocket. For a description of the three phases, see [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#phases "struct rocket::Rocket") . Implementors[§](https://api.rocket.rs/v0.5/rocket/trait.Phase#implementors) ---------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/phase.rs.html#75-117) [§](https://api.rocket.rs/v0.5/rocket/trait.Phase#impl-Phase-for-Build) ### impl [Phase](https://api.rocket.rs/v0.5/rocket/trait.Phase.html "trait rocket::Phase") for [Build](https://api.rocket.rs/v0.5/rocket/enum.Build.html "enum rocket::Build") [Source](https://api.rocket.rs/v0.5/src/rocket/phase.rs.html#75-117) [§](https://api.rocket.rs/v0.5/rocket/trait.Phase#impl-Phase-for-Ignite) ### impl [Phase](https://api.rocket.rs/v0.5/rocket/trait.Phase.html "trait rocket::Phase") for [Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") [Source](https://api.rocket.rs/v0.5/src/rocket/phase.rs.html#75-117) [§](https://api.rocket.rs/v0.5/rocket/trait.Phase#impl-Phase-for-Orbit) ### impl [Phase](https://api.rocket.rs/v0.5/rocket/trait.Phase.html "trait rocket::Phase") for [Orbit](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html "enum rocket::Orbit") --- # rocket::request - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module request](https://api.rocket.rs/v0.5/rocket/request/index.html#) ------------------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module request Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket/request/mod.rs.html#1-113) [Search](https://api.rocket.rs/v0.5/rocket/request/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Types and traits for request parsing and handling. Macros[§](https://api.rocket.rs/v0.5/rocket/request/index.html#macros) ----------------------------------------------------------------------- [local\_cache](https://api.rocket.rs/v0.5/rocket/request/macro.local_cache.html "macro rocket::request::local_cache") `nightly` Store and immediately retrieve a vector-like value `$v` (`String` or `Vec`) in `$request`’s local cache using a locally generated anonymous type to avoid type conflicts. [local\_cache\_once](https://api.rocket.rs/v0.5/rocket/request/macro.local_cache_once.html "macro rocket::request::local_cache_once") `nightly` Store and immediately retrieve a value `$v` in `$request`’s local cache using a locally generated anonymous type to avoid type conflicts. Structs[§](https://api.rocket.rs/v0.5/rocket/request/index.html#structs) ------------------------------------------------------------------------- [Request](https://api.rocket.rs/v0.5/rocket/request/struct.Request.html "struct rocket::request::Request") The type of an incoming web request. Traits[§](https://api.rocket.rs/v0.5/rocket/request/index.html#traits) ----------------------------------------------------------------------- [FromParam](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html "trait rocket::request::FromParam") Trait to convert a dynamic path segment string to a concrete value. [FromRequest](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html "trait rocket::request::FromRequest") Trait implemented by request guards to derive a value from incoming requests. [FromSegments](https://api.rocket.rs/v0.5/rocket/request/trait.FromSegments.html "trait rocket::request::FromSegments") Trait to convert _many_ dynamic path segment strings to a concrete value. Type Aliases[§](https://api.rocket.rs/v0.5/rocket/request/index.html#types) ---------------------------------------------------------------------------- [FlashMessage](https://api.rocket.rs/v0.5/rocket/request/type.FlashMessage.html "type rocket::request::FlashMessage") Type alias to retrieve [`Flash`](https://api.rocket.rs/v0.5/rocket/response/struct.Flash.html "struct rocket::response::Flash") messages from a request. [Outcome](https://api.rocket.rs/v0.5/rocket/request/type.Outcome.html "type rocket::request::Outcome") Type alias for the `Outcome` of a `FromRequest` conversion. --- # Ignite in rocket - Rust [Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite#) --------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Enum Ignite Copy item path ========================== [Source](https://api.rocket.rs/v0.5/src/rocket/phase.rs.html#75-117) pub enum Ignite {} Expand description The second launch [`Phase`](https://api.rocket.rs/v0.5/rocket/trait.Phase.html "trait rocket::Phase") : post-build but pre-orbit. See [Rocket#ignite](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#ignite "struct rocket::Rocket") for details. An instance of `Rocket` in this phase is typed as [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") and represents a fully built and finalized application server ready for launch into orbit. See [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#ignite "struct rocket::Rocket") for full details. Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#trait-implementations) ---------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/phase.rs.html#75-117) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-Phase-for-Ignite) ### impl [Phase](https://api.rocket.rs/v0.5/rocket/trait.Phase.html "trait rocket::Phase") for [Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#synthetic-implementations) ------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-Freeze-for-Ignite) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-RefUnwindSafe-for-Ignite) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-Send-for-Ignite) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-Sync-for-Ignite) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-Unpin-for-Ignite) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-UnwindSafe-for-Ignite) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#blanket-implementations) -------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Ignite#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Ignite#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Ignite#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Ignite#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-1) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-2) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-3) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-4) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-5) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-6) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-7) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-8) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-9) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-10) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-11) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-12) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-13) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-14) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-15) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-16) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-17) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-18) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-19) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-20) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-21) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-22) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-23) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-24) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-25) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-26) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-27) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-28) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-29) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-30) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-31) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-32) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-33) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-34) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-35) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-36) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-37) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-38) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-39) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-40) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-41) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-42) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-43) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-44) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-45) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-46) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-47) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-48) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-49) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-50) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-51) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-52) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-53) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-54) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-55) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-56) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-57) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#example-58) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Ignite#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/enum.Ignite#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Ignite#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # Sentinel in rocket - Rust [Sentinel](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#) -------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Trait Sentinel Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket/sentinel.rs.html#278-281) pub trait Sentinel { // Required method fn abort(rocket: &Rocket) -> bool; } Expand description An automatic last line of defense against launching an invalid [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") . A sentinel, automatically run on [`ignition`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.ignite "method rocket::Rocket::ignite") , can trigger a launch abort should an instance fail to meet arbitrary conditions. Every type that appears in a **mounted** route’s type signature is eligible to be a sentinel. Of these, those that implement `Sentinel` have their [`abort()`](https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html#tymethod.abort "associated function rocket::Sentinel::abort") method invoked automatically, immediately after ignition, once for each unique type. Sentinels inspect the finalized instance of `Rocket` and can trigger a launch abort by returning `true`. [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#built-in-sentinels) Built-In Sentinels ------------------------------------------------------------------------------------------- The [`State`](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") type is a sentinel that triggers an abort if the finalized `Rocket` instance is not managing state for type `T`. Doing so prevents run-time failures of the `State` request guard. ### [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#example) Example As an example, consider the following simple application: #[get("/")] fn index(id: usize, state: &State) -> Response { /* ... */ } #[launch] fn rocket() -> _ { rocket::build().mount("/", routes![index]) } At ignition time, effected by the `#[launch]` attribute here, Rocket probes all types in all mounted routes for `Sentinel` implementations. In this example, the types are: `usize`, `State`, and `Response`. Those that implement `Sentinel` are queried for an abort trigger via their [`Sentinel::abort()`](https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html#tymethod.abort "associated function rocket::Sentinel::abort") method. In this example, the sentinel types are [`State`](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") and _potentially_ `Response`, if it implements `Sentinel`. If `abort()` returns true, launch is aborted with a corresponding error. In this example, launch will be aborted because state of type `String` is not being managed. To correct the error and allow launching to proceed nominally, a value of type `String` must be managed: #[launch] fn rocket() -> _ { rocket::build() .mount("/", routes![index]) .manage(String::from("my managed string")) } [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#embedded-sentinels) Embedded Sentinels ------------------------------------------------------------------------------------------- Embedded types – type parameters of already eligible types – are also eligible to be sentinels. Consider the following route: #[get("/")] fn f(guard: Option<&State>) -> Either> { unimplemented!() } The directly eligible sentinel types, guard and responders, are: * `Option<&State>` * `Either>` In addition, all embedded types are _also_ eligible. These are: * `&State` * `State` * `String` * `Foo` * `Inner` * `Bar` A type, whether embedded or not, is queried if it is a `Sentinel` _and_ none of its parent types are sentinels. Said a different way, if every _directly_ eligible type is viewed as the root of an acyclic graph with edges between a type and its type parameters, the _first_ `Sentinel` in breadth-first order is queried: 1. Option<&State> Either> | / \ 2. &State Foo Inner | | 3. State Bar | 4. String In each graph above, types are queried from top to bottom, level 1 to 4. Querying continues down paths where the parents were _not_ sentinels. For example, if `Option` is a sentinel but `Either` is not, then querying stops for the left subgraph (`Option`) but continues for the right subgraph `Either`. [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#limitations) Limitations ----------------------------------------------------------------------------- Because Rocket must know which `Sentinel` implementation to query based on its _written_ type, generally only explicitly written, resolved, concrete types are eligible to be sentinels. A typical application will only work with such types, but there are several common cases to be aware of. ### [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#impl-trait) `impl Trait` Occasionally an existential `impl Trait` may find its way into return types: use rocket::response::Responder; #[get("/")] fn f<'r>() -> Either, AnotherSentinel> { /* ... */ } **Note:** _Rocket actively discourages using `impl Trait` in route signatures. In addition to impeding sentinel discovery, doing so decreases the ability to gleam a handler’s functionality based on its type signature._ The return type of the route `f` depends on its implementation. At present, it is not possible to name the underlying concrete type of an `impl Trait` at compile-time and thus not possible to determine if it implements `Sentinel`. As such, existentials _are not_ eligible to be sentinels. That being said, this limitation only applies _per embedding_: types embedded inside of an `impl Trait` _are_ eligible. As such, in the example above, the named `AnotherSentinel` type continues to be eligible. When possible, prefer to name all types: #[get("/")] fn f() -> Either { /* ... */ } ### [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#aliases) Aliases _Embedded_ sentinels made opaque by a type alias will fail to be considered; the aliased type itself _is_ considered. In the example below, only `Result` will be considered, while the embedded `Foo` and `Bar` will not. type SomeAlias = Result; #[get("/")] fn f() -> SomeAlias { /* ... */ } Note, however, that `Option` and [`Debug`](https://api.rocket.rs/v0.5/rocket/response/struct.Debug.html "struct rocket::response::Debug") are a sentinels if `T: Sentinel`, and `Result` and `Either` are sentinels if _both_ `T: Sentinel, E: Sentinel`. Thus, for these specific cases, a type alias _will_ “consider” embeddings. Nevertheless, prefer to write concrete types when possible. ### [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#type-macros) Type Macros It is impossible to determine, a priori, what a type macro will expand to. As such, Rocket is unable to determine which sentinels, if any, a type macro references, and thus no sentinels are discovered from type macros. Even approximations are impossible. For example, consider the following: macro_rules! MyType { (State<'_, u32>) => (&'_ rocket::Config) } #[get("/")] fn f(guard: MyType![State<'_, u32>]) { /* ... */ } While the `MyType![State<'_, u32>]` type _appears_ to contain a `State` sentinel, the macro actually expands to `&'_ rocket::Config`, which is _not_ the `State` sentinel. Because Rocket knows the exact syntax expected by type macros that it exports, such as the [typed stream](https://api.rocket.rs/v0.5/rocket/response/stream/index.html "mod rocket::response::stream") macros, discovery in these macros works as expected. You should prefer not to use type macros aside from those exported by Rocket, or if necessary, restrict your use to those that always expand to types without sentinels. [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#custom-sentinels) Custom Sentinels --------------------------------------------------------------------------------------- Any type can implement `Sentinel`, and the implementation can arbitrarily inspect an ignited instance of `Rocket`. For illustration, consider the following implementation of `Sentinel` for a custom `Responder` which requires: * state for a type `T` to be managed * a catcher for status code `400` at base `/` use rocket::{Rocket, Ignite, Sentinel}; impl Sentinel for MyResponder { fn abort(rocket: &Rocket) -> bool { if rocket.state::().is_none() { return true; } if !rocket.catchers().any(|c| c.code == Some(400) && c.base == "/") { return true; } false } } If a `MyResponder` is returned by any mounted route, its `abort()` method will be invoked. If the required conditions aren’t met, signaled by returning `true` from `abort()`, Rocket aborts launch. Required Methods[§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#required-methods) --------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/sentinel.rs.html#280) #### fn [abort](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#tymethod.abort) (rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") <[Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") \>) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if launch should be aborted and `false` otherwise. Dyn Compatibility[§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#dyn-compatibility) ----------------------------------------------------------------------------------------- This trait is **not** [dyn compatible](https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility) . _In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe._ Implementations on Foreign Types[§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#foreign-impls) ---------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/sentinel.rs.html#304-310) [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#impl-Sentinel-for-Either%3CT,+E%3E) ### impl [Sentinel](https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html "trait rocket::Sentinel") for [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [Source](https://api.rocket.rs/v0.5/src/rocket/sentinel.rs.html#305-309) [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#method.abort) #### fn [abort](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#tymethod.abort) (rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") <[Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") \>) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Implementors[§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#implementors) ------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/sentinel.rs.html#314-318) [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#impl-Sentinel-for-Debug%3CT%3E) ### impl [Sentinel](https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html "trait rocket::Sentinel") for [Debug](https://api.rocket.rs/v0.5/rocket/response/struct.Debug.html "struct rocket::response::Debug") A sentinel that never aborts. The `Responder` impl for `Debug` will never be called, so it’s okay to not abort for failing `T: Sentinel`. [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#211-222) [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#impl-Sentinel-for-%26State%3CT%3E) ### impl [Sentinel](https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html "trait rocket::Sentinel") for &[State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/sentinel.rs.html#283-287) [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#impl-Sentinel-for-Option%3CT%3E) ### impl [Sentinel](https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html "trait rocket::Sentinel") for [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") [Source](https://api.rocket.rs/v0.5/src/rocket/sentinel.rs.html#296-302) [§](https://api.rocket.rs/v0.5/rocket/trait.Sentinel#impl-Sentinel-for-Result%3CT,+E%3E) ### impl [Sentinel](https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html "trait rocket::Sentinel") for [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") --- # Data in rocket - Rust [Data](https://api.rocket.rs/v0.5/rocket/struct.Data#) ------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Struct Data Copy item path ========================== [Source](https://api.rocket.rs/v0.5/src/rocket/data/data.rs.html#40-44) pub struct Data<'r> { /* private fields */ } Expand description Type representing the body data of a request. This type is the only means by which the body of a request can be retrieved. This type is not usually used directly. Instead, data guards (types that implement [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html "trait rocket::data::FromData") ) are created indirectly via code generation by specifying the `data = ""` route parameter as follows: #[post("/submit", data = "")] fn submit(var: DataGuard) { /* ... */ } Above, `DataGuard` can be any type that implements `FromData`. Note that `Data` itself implements `FromData`. [§](https://api.rocket.rs/v0.5/rocket/struct.Data#reading-data) Reading Data ---------------------------------------------------------------------------- Data may be read from a `Data` object by calling either the [`open()`](https://api.rocket.rs/v0.5/rocket/struct.Data.html#method.open "method rocket::Data::open") or [`peek()`](https://api.rocket.rs/v0.5/rocket/struct.Data.html#method.peek "method rocket::Data::peek") methods. The `open` method consumes the `Data` object and returns the raw data stream. The `Data` object is consumed for safety reasons: consuming the object ensures that holding a `Data` object means that all of the data is available for reading. The `peek` method returns a slice containing at most 512 bytes of buffered body data. This enables partially or fully reading from a `Data` object without consuming the `Data` object. Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Data#implementations) ---------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/data/data.rs.html#46-190) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-Data%3C'r%3E) ### impl<'r> [Data](https://api.rocket.rs/v0.5/rocket/struct.Data.html "struct rocket::Data") <'r> [Source](https://api.rocket.rs/v0.5/src/rocket/data/data.rs.html#85-87) #### pub fn [open](https://api.rocket.rs/v0.5/rocket/struct.Data#method.open) (self, limit: [ByteUnit](https://api.rocket.rs/v0.5/rocket/data/struct.ByteUnit.html "struct rocket::data::ByteUnit") ) -> [DataStream](https://api.rocket.rs/v0.5/rocket/data/struct.DataStream.html "struct rocket::data::DataStream") <'r> Returns the raw data stream, limited to `limit` bytes. The stream contains all of the data in the body of the request, including that in the `peek` buffer. The method consumes the `Data` instance. This ensures that a `Data` type _always_ represents _all_ of the data in a request. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example) Example use rocket::data::{Data, ToByteUnit}; fn handler(data: Data<'_>) { let stream = data.open(2.mebibytes()); } [Source](https://api.rocket.rs/v0.5/src/rocket/data/data.rs.html#150-169) #### pub async fn [peek](https://api.rocket.rs/v0.5/rocket/struct.Data#method.peek) (&mut self, num: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) -> &\[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \] [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Data#) Retrieve at most `num` bytes from the `peek` buffer without consuming `self`. The peek buffer contains at most 512 bytes of the body of the request. The actual size of the returned buffer is the `min` of the request’s body, `num` and `512`. The [`peek_complete`](https://api.rocket.rs/v0.5/rocket/struct.Data#method.peek_complete) method can be used to determine if this buffer contains _all_ of the data in the body of the request. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#examples) Examples In a data guard: use rocket::request::{self, Request, FromRequest}; use rocket::data::{Data, FromData, Outcome}; use rocket::http::Status; #[rocket::async_trait] impl<'r> FromData<'r> for MyType { type Error = MyError; async fn from_data(r: &'r Request<'_>, mut data: Data<'r>) -> Outcome<'r, Self> { if data.peek(2).await != b"hi" { return Outcome::Forward((data, Status::BadRequest)) } /* .. */ } } In a fairing: use rocket::{Rocket, Request, Data, Response}; use rocket::fairing::{Fairing, Info, Kind}; #[rocket::async_trait] impl Fairing for MyType { fn info(&self) -> Info { Info { name: "Data Peeker", kind: Kind::Request } } async fn on_request(&self, req: &mut Request<'_>, data: &mut Data<'_>) { if data.peek(2).await == b"hi" { /* do something; body data starts with `"hi"` */ } /* .. */ } } [Source](https://api.rocket.rs/v0.5/src/rocket/data/data.rs.html#187-189) #### pub fn [peek\_complete](https://api.rocket.rs/v0.5/rocket/struct.Data#method.peek_complete) (&self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns true if the `peek` buffer contains all of the data in the body of the request. Returns `false` if it does not or if it is not known if it does. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-1) Example use rocket::data::Data; async fn handler(mut data: Data<'_>) { if data.peek_complete() { println!("All of the data: {:?}", data.peek(512).await); } } Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Data#trait-implementations) ---------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/data/from_data.rs.html#395-401) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-FromData%3C'r%3E-for-Data%3C'r%3E) ### impl<'r> [FromData](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html "trait rocket::data::FromData") <'r> for [Data](https://api.rocket.rs/v0.5/rocket/struct.Data.html "struct rocket::Data") <'r> [Source](https://api.rocket.rs/v0.5/src/rocket/data/from_data.rs.html#396) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The associated error to be returned when the guard fails. [Source](https://api.rocket.rs/v0.5/src/rocket/data/from_data.rs.html#398-400) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.from_data) #### fn [from\_data](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html#tymethod.from_data) <'life0, 'async\_trait>( \_: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'life0>, data: [Data](https://api.rocket.rs/v0.5/rocket/struct.Data.html "struct rocket::Data") <'r>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'r: 'async\_trait, 'life0: 'async\_trait, Asynchronously validates, parses, and converts an instance of `Self` from the incoming request body data. [Read more](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html#tymethod.from_data) Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Data#synthetic-implementations) ------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-Freeze-for-Data%3C'r%3E) ### impl<'r> ![Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Data](https://api.rocket.rs/v0.5/rocket/struct.Data.html "struct rocket::Data") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-RefUnwindSafe-for-Data%3C'r%3E) ### impl<'r> ![RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Data](https://api.rocket.rs/v0.5/rocket/struct.Data.html "struct rocket::Data") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-Send-for-Data%3C'r%3E) ### impl<'r> [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Data](https://api.rocket.rs/v0.5/rocket/struct.Data.html "struct rocket::Data") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-Sync-for-Data%3C'r%3E) ### impl<'r> [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Data](https://api.rocket.rs/v0.5/rocket/struct.Data.html "struct rocket::Data") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-Unpin-for-Data%3C'r%3E) ### impl<'r> [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Data](https://api.rocket.rs/v0.5/rocket/struct.Data.html "struct rocket::Data") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-UnwindSafe-for-Data%3C'r%3E) ### impl<'r> ![UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Data](https://api.rocket.rs/v0.5/rocket/struct.Data.html "struct rocket::Data") <'r> Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Data#blanket-implementations) -------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Data#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Data#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Data#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Data#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-2) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-3) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-4) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-5) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-6) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-7) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-8) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-9) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-10) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-11) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-12) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-13) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-14) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-15) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-16) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-17) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-18) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-19) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-20) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-21) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-22) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-23) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-24) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-25) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-26) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-27) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-28) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-29) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-30) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-31) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-32) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-33) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-34) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-35) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-36) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-37) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-38) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-39) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-40) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-41) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-42) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-43) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-44) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-45) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-46) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-47) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-48) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-49) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-50) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-51) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-52) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-53) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-54) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-55) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-56) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-57) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-58) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-59) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Data#example-60) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#associatedtype.Error-2) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Data#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/struct.Data#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Data#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # rocket::response - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module response](https://api.rocket.rs/v0.5/rocket/response/index.html#) -------------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module response Copy item path ============================== [Source](https://api.rocket.rs/v0.5/src/rocket/response/mod.rs.html#1-39) [Search](https://api.rocket.rs/v0.5/rocket/response/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Types and traits to build and send responses. The return type of a Rocket handler can be any type that implements the [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") trait, which means that the type knows how to generate a [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") . Among other things, this module contains several such types. [§](https://api.rocket.rs/v0.5/rocket/response/index.html#composing) Composing ------------------------------------------------------------------------------ Many of the built-in `Responder` types _chain_ responses: they take in another `Responder` and add, remove, or change information in the response. In other words, many `Responder` types are built to compose well. As a result, you’ll often have types of the form `A>` consisting of three `Responder`s `A`, `B`, and `C`. This is normal and encouraged as the type names typically illustrate the intended response. Modules[§](https://api.rocket.rs/v0.5/rocket/response/index.html#modules) -------------------------------------------------------------------------- [content](https://api.rocket.rs/v0.5/rocket/response/content/index.html "mod rocket::response::content") Contains types that set the Content-Type of a response. [status](https://api.rocket.rs/v0.5/rocket/response/status/index.html "mod rocket::response::status") Contains types that set the status code and corresponding headers of a response. [stream](https://api.rocket.rs/v0.5/rocket/response/stream/index.html "mod rocket::response::stream") Potentially infinite async [`Stream`](https://docs.rs/futures/0.3/futures/stream/trait.Stream.html) response types. Structs[§](https://api.rocket.rs/v0.5/rocket/response/index.html#structs) -------------------------------------------------------------------------- [Body](https://api.rocket.rs/v0.5/rocket/response/struct.Body.html "struct rocket::response::Body") The body of a [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") . [Builder](https://api.rocket.rs/v0.5/rocket/response/struct.Builder.html "struct rocket::response::Builder") Builder for the [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") type. [Debug](https://api.rocket.rs/v0.5/rocket/response/struct.Debug.html "struct rocket::response::Debug") Debug prints the internal value before forwarding to the 500 error catcher. [Flash](https://api.rocket.rs/v0.5/rocket/response/struct.Flash.html "struct rocket::response::Flash") Sets a “flash” cookie that will be removed when it is accessed. The analogous request type is [`FlashMessage`](https://api.rocket.rs/v0.5/rocket/request/type.FlashMessage.html "type rocket::request::FlashMessage") . [Redirect](https://api.rocket.rs/v0.5/rocket/response/struct.Redirect.html "struct rocket::response::Redirect") An empty redirect response to a given URL. [Response](https://api.rocket.rs/v0.5/rocket/response/struct.Response.html "struct rocket::response::Response") A response, as returned by types implementing [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") . Traits[§](https://api.rocket.rs/v0.5/rocket/response/index.html#traits) ------------------------------------------------------------------------ [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") Trait implemented by types that generate responses for clients. Type Aliases[§](https://api.rocket.rs/v0.5/rocket/response/index.html#types) ----------------------------------------------------------------------------- [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") Type alias for the `Result` of a [`Responder::respond_to()`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html#tymethod.respond_to "method rocket::response::Responder::respond_to") call. --- # FromFormField in rocket - Rust [FromFormField](https://api.rocket.rs/v0.5/rocket/derive.FromFormField#) ------------------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Derive Macro FromFormField Copy item path ========================================= [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#545) #[derive(FromFormField)] { // Attributes available to this derive: #[field] } Expand description Derive for the [`FromFormField`](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html) trait. The [`FromFormField`](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html) derive can be applied to enums with nullary (zero-length) fields: #[derive(FromFormField)] enum MyValue { First, Second, Third, } The derive generates an implementation of the [`FromFormField`](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html) trait for the decorated `enum`. The implementation returns successfully when the form value matches, case insensitively, the stringified version of a variant’s name, returning an instance of said variant. If there is no match, an error recording all of the available options is returned. As an example, for the `enum` above, the form values `"first"`, `"FIRST"`, `"fiRSt"`, and so on would parse as `MyValue::First`, while `"second"` and `"third"` (in any casing) would parse as `MyValue::Second` and `MyValue::Third`, respectively. The `field` field attribute can be used to change the string value that is compared against for a given variant: #[derive(FromFormField)] enum MyValue { First, Second, #[field(value = "fourth")] #[field(value = "fifth")] Third, } When more than one `value` is specified, matching _any_ value will result in parsing the decorated variant. Declaring any two values that are case-insensitively equal to any other value or variant name is a compile-time error. The `#[field]` attribute’s grammar is: field := 'value' '=' STRING_LIT STRING_LIT := any valid string literal, as defined by Rust The attribute accepts a single string parameter of name `value` corresponding to the string to use to match against for the decorated variant. In the example above, the the strings `"fourth"`, `"FOUrth"`, `"fiFTH"` and so on would parse as `MyValue::Third`. --- # UriDisplayPath in rocket - Rust [UriDisplayPath](https://api.rocket.rs/v0.5/rocket/derive.UriDisplayPath#) --------------------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Derive Macro UriDisplayPath Copy item path ========================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#1059) #[derive(UriDisplayPath)] Expand description Derive for the [`UriDisplay`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.UriDisplay.html) trait. The [`UriDisplay`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.UriDisplay.html) derive can only be applied to tuple structs with one field. #[derive(UriDisplayPath)] struct Name(String); #[derive(UriDisplayPath)] struct Age(usize); The field’s type is required to implement [`UriDisplay`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.UriDisplay.html) . The derive generates an implementation of the [`UriDisplay`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.UriDisplay.html) trait. The implementation calls [`Formatter::write_value()`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/struct.Formatter.html#method.write_value) for the field. --- # UriDisplayQuery in rocket - Rust [UriDisplayQuery](https://api.rocket.rs/v0.5/rocket/derive.UriDisplayQuery#) ----------------------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Derive Macro UriDisplayQuery Copy item path =========================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#1033) #[derive(UriDisplayQuery)] { // Attributes available to this derive: #[field] } Expand description Derive for the [`UriDisplay`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.UriDisplay.html) trait. The [`UriDisplay`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.UriDisplay.html) derive can be applied to enums and structs. When applied to an enum, the enum must have at least one variant. When applied to a struct, the struct must have at least one field. #[derive(UriDisplayQuery)] enum Kind { A(String), B(usize), } #[derive(UriDisplayQuery)] struct MyStruct { name: String, id: usize, kind: Kind, } Each field’s type is required to implement [`UriDisplay`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.UriDisplay.html) . The derive generates an implementation of the [`UriDisplay`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.UriDisplay.html) trait. The implementation calls [`Formatter::write_named_value()`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/struct.Formatter.html#method.write_named_value) for every named field, using the field’s name (unless overridden, explained next) as the `name` parameter, and [`Formatter::write_value()`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/struct.Formatter.html#method.write_value) for every unnamed field in the order the fields are declared. The derive accepts one field attribute: `field`, with the following syntax: field := 'name' '=' '"' FIELD_NAME '"' | 'value' '=' '"' FIELD_VALUE '"' FIELD_NAME := valid HTTP field name FIELD_VALUE := valid HTTP field value When applied to a struct, the attribute can only contain `name` and looks as follows: #[derive(UriDisplayQuery)] struct MyStruct { name: String, id: usize, #[field(name = "type")] #[field(name = "kind")] kind: Kind, } The field attribute directs that a different field name be used when calling [`Formatter::write_named_value()`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/struct.Formatter.html#method.write_named_value) for the given field. The value of the `name` attribute is used instead of the structure’s actual field name. If more than one `field` attribute is applied to a field, the _first_ name is used. In the example above, the field `MyStruct::kind` is rendered with a name of `type`. The attribute can also be applied to variants of C-like enums; it may only contain `value` and looks as follows: #[derive(UriDisplayQuery)] enum Kind { File, #[field(value = "str")] #[field(value = "string")] String, Other } The field attribute directs that a different value be used when calling [`Formatter::write_named_value()`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/struct.Formatter.html#method.write_named_value) for the given variant. The value of the `value` attribute is used instead of the variant’s actual name. If more than one `field` attribute is applied to a variant, the _first_ value is used. In the example above, the variant `Kind::String` will render with a value of `str`. --- # Responder in rocket - Rust [Responder](https://api.rocket.rs/v0.5/rocket/derive.Responder#) ----------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Derive Macro Responder Copy item path ===================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#939) #[derive(Responder)] { // Attributes available to this derive: #[response] } Expand description Derive for the [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) trait. The [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) derive can be applied to enums and structs with named fields. When applied to enums, variants must have at least one field. When applied to structs, the struct must have at least one field. #[derive(Responder)] enum MyResponderA { A(String), B(File, ContentType), } #[derive(Responder)] struct MyResponderB { inner: OtherResponder, header: ContentType, } [§](https://api.rocket.rs/v0.5/rocket/derive.Responder#semantics) Semantics --------------------------------------------------------------------------- The derive generates an implementation of the [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) trait for the decorated enum or structure. The derive uses the _first_ field of a variant or structure to generate a [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) . As such, the type of the first field must implement [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) . The remaining fields of a variant or structure are set as headers in the produced [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) using [`Response::set_header()`](https://api.rocket.rs/v0.5/rocket/response/struct.Response.html#method.set_header) . As such, every other field (unless explicitly ignored, explained next) must implement `Into

`. Except for the first field, fields decorated with `#[response(ignore)]` are ignored by the derive: #[derive(Responder)] enum MyResponder { A(String), B(File, ContentType, #[response(ignore)] Other), } #[derive(Responder)] struct MyOtherResponder { inner: NamedFile, header: ContentType, #[response(ignore)] other: Other, } Decorating the first field with `#[response(ignore)]` has no effect. [§](https://api.rocket.rs/v0.5/rocket/derive.Responder#field-attribute) Field Attribute --------------------------------------------------------------------------------------- Additionally, the `response` attribute can be used on named structures and enum variants to override the status and/or content-type of the [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) produced by the generated implementation. The `response` attribute used in these positions has the following grammar: response := parameter (',' parameter)? parameter := 'status' '=' STATUS | 'content_type' '=' CONTENT_TYPE STATUS := unsigned integer >= 100 and < 600 CONTENT_TYPE := string literal, as defined by Rust, identifying a valid Content-Type, as defined by Rocket It can be used as follows: #[derive(Responder)] enum Error { #[response(status = 500, content_type = "json")] A(String), #[response(status = 404)] B(NamedFile, ContentType), } #[derive(Responder)] #[response(status = 400)] struct MyResponder { inner: InnerResponder, header: ContentType, #[response(ignore)] other: Other, } The attribute accepts two key/value pairs: `status` and `content_type`. The value of `status` must be an unsigned integer representing a valid status code. The [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) produced from the generated implementation will have its status overridden to this value. The value of `content_type` must be a valid media-type in `top/sub` form or `shorthand` form. Examples include: * `"text/html"` * `"application/x-custom"` * `"html"` * `"json"` * `"plain"` * `"binary"` See [`ContentType::parse_flexible()`](https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html#method.parse_flexible) for a full list of available shorthands. The [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) produced from the generated implementation will have its content-type overridden to this value. [§](https://api.rocket.rs/v0.5/rocket/derive.Responder#generics) Generics ------------------------------------------------------------------------- The derive accepts any number of type generics and at most one lifetime generic. If a type generic is present and the generic is used in the first field of a structure, the generated implementation will require a bound of `Responder<'r, 'o>` for the field type containing the generic. In all other fields, unless ignores, a bound of `Into` is added. For example, for a struct `struct Foo(Json, H)`, the derive adds: * `Json: Responder<'r, 'o>` * `H: Into>` use rocket::serde::Serialize; use rocket::serde::json::Json; use rocket::http::ContentType; use rocket::response::Responder; // The bound `T: Responder` will be added. #[derive(Responder)] #[response(status = 404, content_type = "html")] struct NotFoundHtml(T); // The bound `Json: Responder` will be added. #[derive(Responder)] struct NotFoundJson(Json); // The bounds `Json: Responder, E: Responder` will be added. #[derive(Responder)] enum MyResult { Ok(Json), #[response(status = 404)] Err(E, ContentType) } If a lifetime generic is present, it will be replaced with `'o` in the generated implementation `impl Responder<'r, 'o>`: // Generates `impl<'r, 'o> Responder<'r, 'o> for NotFoundHtmlString<'o>`. #[derive(Responder)] #[response(status = 404, content_type = "html")] struct NotFoundHtmlString<'a>(&'a str); Both type generics and lifetime generic may be used: #[derive(Responder)] struct SomeResult<'o, T>(Result); --- # FromFormField in rocket::form - Rust [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#) ----------------------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[form](https://api.rocket.rs/v0.5/rocket/form/index.html) Trait FromFormField Copy item path ================================== [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#182-208) pub trait FromFormField<'v>: Send + Sized { // Provided methods fn from_value(field: ValueField<'v>) -> Result<'v, Self> { ... } fn from_data<'life0, 'async_trait>( field: DataField<'v, 'life0>, ) -> Pin> + Send + 'async_trait>> where Self: 'async_trait, 'v: 'async_trait, 'life0: 'async_trait { ... } fn default() -> Option { ... } } Expand description Implied form guard ([`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") ) for parsing a single form field. Types that implement `FromFormField` automatically implement [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") via a blanket implementation. As such, all `FromFormField` types are form guards and can appear as the type of values in derived `FromForm` struct fields: #[derive(FromForm)] struct Person<'r> { name: &'r str, age: u16 } [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#semantics) Semantics ----------------------------------------------------------------------------------- The implementation of `FromForm` for a `T: FromFormField` type operates as follows: * When parsing is **strict**, the parser accepts the _first_ value or data field with the corresponding field name and calls `T::from_value()` or `T::from_data()` with the field’s value, respectively. If more than one field value is seen, an \[`ErrorKind::Duplicate`) is emitted. If no matching field is seen, an [`ErrorKind::Missing`](https://api.rocket.rs/v0.5/rocket/form/error/enum.ErrorKind.html#variant.Missing "variant rocket::form::error::ErrorKind::Missing")\ is emitted. Otherwise, the result from the call is emitted.\ \ * When parsing is **lenient**, the parser accepts the first _expected_ value or data field with the corresponding field name and calls `T::from_value()` or `T::from_data()` with the field’s value, respectively. Unexpected values, identified by returning an [`ErrorKind::Unexpected`](https://api.rocket.rs/v0.5/rocket/form/error/enum.ErrorKind.html#variant.Unexpected "variant rocket::form::error::ErrorKind::Unexpected")\ from `from_value()` or `from_data()` are ignored. Any additional fields with a matching field name are ignored. If no matching field is seen and `T` has a default, it is used, otherwise an [`ErrorKind::Missing`](https://api.rocket.rs/v0.5/rocket/form/error/enum.ErrorKind.html#variant.Missing "variant rocket::form::error::ErrorKind::Missing")\ is emitted.\ \ \ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#deriving)\ Deriving\ ---------------------------------------------------------------------------------\ \ `FromFormField` can be derived for C-like enums, where the generated implementation case-insensitively parses fields with values equal to the name of the variant or the value in `field()`.\ \ /// Fields with value `"simple"` parse as `Kind::Simple`. Fields with value\ /// `"fancy"` parse as `Kind::SoFancy`.\ #[derive(FromFormField)]\ enum Kind {\ Simple,\ #[field(value = "fancy")]\ SoFancy,\ }\ \ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#provided-implementations)\ Provided Implementations\ -----------------------------------------------------------------------------------------------------------------\ \ See [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#provided-implementations "trait rocket::form::FromForm")\ for a list of all form guards, including those implemented via `FromFormField`.\ \ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#implementing)\ Implementing\ -----------------------------------------------------------------------------------------\ \ Implementing `FromFormField` requires implementing one or both of `from_value` or `from_data`, depending on whether the type can be parsed from a value field (text) and/or streaming binary data. Typically, a value can be parsed from either, either directly or by using request-local cache as an intermediary, and parsing from both should be preferred when sensible.\ \ `FromFormField` is an async trait, so implementations must be decorated with an attribute of `#[rocket::async_trait]`:\ \ use rocket::form::{self, FromFormField, DataField, ValueField};\ \ #[rocket::async_trait]\ impl<'r> FromFormField<'r> for MyType {\ fn from_value(field: ValueField<'r>) -> form::Result<'r, Self> {\ todo!("parse from a value or use default impl")\ }\ \ async fn from_data(field: DataField<'r, '_>) -> form::Result<'r, Self> {\ todo!("parse from a value or use default impl")\ }\ }\ \ ### [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#example)\ Example\ \ The following example parses a custom `Person` type with the format `$name:$data`, where `$name` is expected to be string and `data` is expected to be any slice of bytes.\ \ use rocket::data::ToByteUnit;\ use rocket::form::{self, FromFormField, DataField, ValueField};\ \ use memchr::memchr;\ \ struct Person<'r> {\ name: &'r str,\ data: &'r [u8]\ }\ \ #[rocket::async_trait]\ impl<'r> FromFormField<'r> for Person<'r> {\ fn from_value(field: ValueField<'r>) -> form::Result<'r, Self> {\ match field.value.find(':') {\ Some(i) => Ok(Person {\ name: &field.value[..i],\ data: field.value[(i + 1)..].as_bytes()\ }),\ None => Err(form::Error::validation("does not contain ':'"))?\ }\ }\ \ async fn from_data(field: DataField<'r, '_>) -> form::Result<'r, Self> {\ // Retrieve the configured data limit or use `256KiB` as default.\ let limit = field.request.limits()\ .get("person")\ .unwrap_or(256.kibibytes());\ \ // Read the capped data stream, returning a limit error as needed.\ let bytes = field.data.open(limit).into_bytes().await?;\ if !bytes.is_complete() {\ Err((None, Some(limit)))?;\ }\ \ // Store the bytes in request-local cache and split at ':'.\ let bytes = bytes.into_inner();\ let bytes = rocket::request::local_cache!(field.request, bytes);\ let (raw_name, data) = match memchr(b':', bytes) {\ Some(i) => (&bytes[..i], &bytes[(i + 1)..]),\ None => Err(form::Error::validation("does not contain ':'"))?\ };\ \ // Try to parse the name as UTF-8 or return an error if it fails.\ let name = std::str::from_utf8(raw_name)?;\ Ok(Person { name, data })\ }\ }\ \ use rocket::form::{Form, FromForm};\ \ // The type can be used directly, if only one field is expected...\ #[post("/person", data = "")]\ fn person(person: Form>) { /* ... */ }\ \ // ...or as a named field in another form guard...\ #[derive(FromForm)]\ struct NewPerson<'r> {\ person: Person<'r>\ }\ \ #[post("/person", data = "")]\ fn new_person(person: Form>) { /* ... */ }\ \ Provided Methods[§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#provided-methods)\ \ -------------------------------------------------------------------------------------------------\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#187-189)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ Parse a value of `T` from a form value field.\ \ The default implementation returns an error of [`ValueField::unexpected()`](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html#method.unexpected "method rocket::form::ValueField::unexpected")\ .\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#195-197)\ \ #### fn [from\_data](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_data)\ <'life0, 'async\_trait>( field: [DataField](https://api.rocket.rs/v0.5/rocket/form/struct.DataField.html "struct rocket::form::DataField")\ <'v, 'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin")\ <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box")\ > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send")\ + 'async\_trait>>\ \ where Self: 'async\_trait, 'v: 'async\_trait, 'life0: 'async\_trait,\ \ Parse a value of `T` from a form data field.\ \ The default implementation returns an error of [`DataField::unexpected()`](https://api.rocket.rs/v0.5/rocket/form/struct.DataField.html#method.unexpected "method rocket::form::DataField::unexpected")\ .\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#207)\ \ #### fn [default](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.default)\ () -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option")\ \ \ Returns a default value, if any exists, to be used during lenient parsing when the form field is missing.\ \ A return value of `None` means that field is required to exist and parse successfully, always. A return value of `Some(default)` means that `default` should be used when a field is missing.\ \ The default implementation returns `None`.\ \ Dyn Compatibility[§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#dyn-compatibility)\ \ ---------------------------------------------------------------------------------------------------\ \ This trait is **not** [dyn compatible](https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility)\ .\ \ _In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe._\ \ Implementations on Foreign Types[§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#foreign-impls)\ \ --------------------------------------------------------------------------------------------------------------\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#308)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-%26str)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for &'v [str](https://doc.rust-lang.org/nightly/std/primitive.str.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#308)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.default-1)\ \ #### fn [default](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.default)\ () -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option")\ \ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#308)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-1)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (f: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#308)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_data-1)\ \ #### fn [from\_data](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_data)\ <'life0, 'async\_trait>( field: [DataField](https://api.rocket.rs/v0.5/rocket/form/struct.DataField.html "struct rocket::form::DataField")\ <'v, 'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin")\ <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box")\ > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send")\ + 'async\_trait>>\ \ where Self: 'async\_trait, 'v: 'async\_trait, 'life0: 'async\_trait,\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#365)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-%26%5Bu8%5D)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for &'v \[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \]\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#365)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.default-2)\ \ #### fn [default](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.default)\ () -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option")\ \ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#365)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-2)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (f: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#365)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_data-2)\ \ #### fn [from\_data](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_data)\ <'life0, 'async\_trait>( field: [DataField](https://api.rocket.rs/v0.5/rocket/form/struct.DataField.html "struct rocket::form::DataField")\ <'v, 'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin")\ <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box")\ > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send")\ + 'async\_trait>>\ \ where Self: 'async\_trait, 'v: 'async\_trait, 'life0: 'async\_trait,\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#380)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-Cow%3C'v,+str%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow")\ <'v, [str](https://doc.rust-lang.org/nightly/std/primitive.str.html)\ \>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#380)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.default-3)\ \ #### fn [default](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.default)\ () -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option")\ \ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#380)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-3)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (f: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#380)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_data-3)\ \ #### fn [from\_data](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_data)\ <'life0, 'async\_trait>( field: [DataField](https://api.rocket.rs/v0.5/rocket/form/struct.DataField.html "struct rocket::form::DataField")\ <'v, 'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin")\ <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box")\ > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send")\ + 'async\_trait>>\ \ where Self: 'async\_trait, 'v: 'async\_trait, 'life0: 'async\_trait,\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-IpAddr)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [IpAddr](https://doc.rust-lang.org/nightly/core/net/ip_addr/enum.IpAddr.html "enum core::net::ip_addr::IpAddr")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-4)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-SocketAddr)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [SocketAddr](https://doc.rust-lang.org/nightly/core/net/socket_addr/enum.SocketAddr.html "enum core::net::socket_addr::SocketAddr")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-5)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#331-344)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-bool)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#332-334)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.default-4)\ \ #### fn [default](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.default)\ () -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option")\ \ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#336-343)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-6)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-char)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [char](https://doc.rust-lang.org/nightly/std/primitive.char.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-7)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-f32)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [f32](https://doc.rust-lang.org/nightly/std/primitive.f32.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-8)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-f64)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-9)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-i8)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [i8](https://doc.rust-lang.org/nightly/std/primitive.i8.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-10)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-i16)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [i16](https://doc.rust-lang.org/nightly/std/primitive.i16.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-11)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-i32)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [i32](https://doc.rust-lang.org/nightly/std/primitive.i32.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-12)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-i64)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [i64](https://doc.rust-lang.org/nightly/std/primitive.i64.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-13)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-i128)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [i128](https://doc.rust-lang.org/nightly/std/primitive.i128.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-14)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-isize)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-15)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-u8)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-16)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-u16)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-17)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-u32)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-18)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-u64)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [u64](https://doc.rust-lang.org/nightly/std/primitive.u64.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-19)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-u128)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [u128](https://doc.rust-lang.org/nightly/std/primitive.u128.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-20)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-usize)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-21)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-Ipv4Addr)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [Ipv4Addr](https://doc.rust-lang.org/nightly/core/net/ip_addr/struct.Ipv4Addr.html "struct core::net::ip_addr::Ipv4Addr")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-22)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-Ipv6Addr)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [Ipv6Addr](https://doc.rust-lang.org/nightly/core/net/ip_addr/struct.Ipv6Addr.html "struct core::net::ip_addr::Ipv6Addr")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-23)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-SocketAddrV4)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [SocketAddrV4](https://doc.rust-lang.org/nightly/core/net/socket_addr/struct.SocketAddrV4.html "struct core::net::socket_addr::SocketAddrV4")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-24)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-SocketAddrV6)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [SocketAddrV6](https://doc.rust-lang.org/nightly/core/net/socket_addr/struct.SocketAddrV6.html "struct core::net::socket_addr::SocketAddrV6")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-25)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#412-419)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-Date)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [Date](https://docs.rs/time/0.3.44/time/date/struct.Date.html "struct time::date::Date")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#413-418)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-26)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#431-439)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-PrimitiveDateTime)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [PrimitiveDateTime](https://docs.rs/time/0.3.44/time/primitive_date_time/struct.PrimitiveDateTime.html "struct time::primitive_date_time::PrimitiveDateTime")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#432-438)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-27)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#421-429)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-Time)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [Time](https://docs.rs/time/0.3.44/time/time/struct.Time.html "struct time::time::Time")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#422-428)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-28)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-NonZero%3Ci8%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [NonZeroI8](https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroI8.html "type core::num::nonzero::NonZeroI8")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-29)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-NonZero%3Ci16%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [NonZeroI16](https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroI16.html "type core::num::nonzero::NonZeroI16")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-30)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-NonZero%3Ci32%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [NonZeroI32](https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroI32.html "type core::num::nonzero::NonZeroI32")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-31)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-NonZero%3Ci64%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [NonZeroI64](https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroI64.html "type core::num::nonzero::NonZeroI64")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-32)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-NonZero%3Ci128%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [NonZeroI128](https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroI128.html "type core::num::nonzero::NonZeroI128")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-33)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-NonZero%3Cisize%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [NonZeroIsize](https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroIsize.html "type core::num::nonzero::NonZeroIsize")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-34)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-NonZero%3Cu8%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [NonZeroU8](https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroU8.html "type core::num::nonzero::NonZeroU8")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-35)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-NonZero%3Cu16%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [NonZeroU16](https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroU16.html "type core::num::nonzero::NonZeroU16")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-36)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-NonZero%3Cu32%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [NonZeroU32](https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroU32.html "type core::num::nonzero::NonZeroU32")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-37)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-NonZero%3Cu64%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [NonZeroU64](https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroU64.html "type core::num::nonzero::NonZeroU64")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-38)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-NonZero%3Cu128%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [NonZeroU128](https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroU128.html "type core::num::nonzero::NonZeroU128")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-39)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-NonZero%3Cusize%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [NonZeroUsize](https://doc.rust-lang.org/nightly/core/num/nonzero/type.NonZeroUsize.html "type core::num::nonzero::NonZeroUsize")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#393-401)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value-40)\ \ #### fn [from\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#method.from_value)\ (field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField")\ <'v>) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result")\ <'v, Self>\ \ Implementors[§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#implementors)\ \ -----------------------------------------------------------------------------------------\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/fs/temp_file.rs.html#551)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-TempFile%3C'v%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [TempFile](https://api.rocket.rs/v0.5/rocket/fs/enum.TempFile.html "enum rocket::fs::TempFile")\ <'v>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#290-306)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-Capped%3C%26str%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [Capped](https://api.rocket.rs/v0.5/rocket/data/struct.Capped.html "struct rocket::data::Capped")\ <&'v [str](https://doc.rust-lang.org/nightly/std/primitive.str.html)\ \>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#347-363)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-Capped%3C%26%5Bu8%5D%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [Capped](https://api.rocket.rs/v0.5/rocket/data/struct.Capped.html "struct rocket::data::Capped")\ <&'v \[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \]>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/fs/temp_file.rs.html#518-529)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-Capped%3CTempFile%3C'v%3E%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [Capped](https://api.rocket.rs/v0.5/rocket/data/struct.Capped.html "struct rocket::data::Capped")\ <[TempFile](https://api.rocket.rs/v0.5/rocket/fs/enum.TempFile.html "enum rocket::fs::TempFile")\ <'v>>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#368-378)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-Capped%3CCow%3C'v,+str%3E%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [Capped](https://api.rocket.rs/v0.5/rocket/data/struct.Capped.html "struct rocket::data::Capped")\ <[Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow")\ <'v, [str](https://doc.rust-lang.org/nightly/std/primitive.str.html)\ \>>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#311-327)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-Capped%3CString%3E)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [Capped](https://api.rocket.rs/v0.5/rocket/data/struct.Capped.html "struct rocket::data::Capped")\ <[String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String")\ \>\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#329)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-String)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/serde/uuid.rs.html#99-104)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-Uuid)\ \ ### impl<'v> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [Uuid](https://api.rocket.rs/v0.5/rocket/serde/uuid/struct.Uuid.html "struct rocket::serde::uuid::Uuid")\ \ Available on **crate feature `uuid`** only.\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/serde/json.rs.html#288-296)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-Json%3CT%3E)\ \ ### impl<'v, T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize")\ <'v> + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send")\ \> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [Json](https://api.rocket.rs/v0.5/rocket/serde/json/struct.Json.html "struct rocket::serde::json::Json")\ \ \ Available on **crate feature `json`** only.\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/serde/msgpack.rs.html#202-215)\ [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField#impl-FromFormField%3C'v%3E-for-MsgPack%3CT%3E)\ \ ### impl<'v, T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize")\ <'v> + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send")\ \> [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField")\ <'v> for [MsgPack](https://api.rocket.rs/v0.5/rocket/serde/msgpack/struct.MsgPack.html "struct rocket::serde::msgpack::MsgPack")\ \ \ Available on **crate feature `msgpack`** only. --- # FromForm in rocket::form - Rust [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#) ------------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[form](https://api.rocket.rs/v0.5/rocket/form/index.html) Trait FromForm Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#532-564) pub trait FromForm<'r>: Send + Sized { type Context: Send; // Required methods fn init(opts: Options) -> Self::Context; fn push_value(ctxt: &mut Self::Context, field: ValueField<'r>); fn push_data<'life0, 'life1, 'async_trait>( ctxt: &'life0 mut Self::Context, field: DataField<'r, 'life1>, ) -> Pin + Send + 'async_trait>> where Self: 'async_trait, 'r: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn finalize(ctxt: Self::Context) -> Result<'r, Self>; // Provided methods fn push_error(_ctxt: &mut Self::Context, _error: Error<'r>) { ... } fn default(opts: Options) -> Option { ... } } Expand description Trait implemented by form guards: types parseable from HTTP forms. Only form guards that are _collections_, that is, collect more than one form field while parsing, should implement `FromForm`. All other types should implement [`FromFormField`](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField") instead, which offers a simplified interface to parsing a single form field. For a gentle introduction to forms in Rocket, see the [forms guide](https://rocket.rs/v0.5/guide/requests/#forms) . [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#form-guards) Form Guards ---------------------------------------------------------------------------------- A form guard is a guard that operates on form fields, typically those with a particular name prefix. Form guards validate and parse form field data via implementations of `FromForm`. In other words, a type is a form guard _iff_ it implements `FromForm`. Form guards are used as the inner type of the [`Form`](https://api.rocket.rs/v0.5/rocket/form/struct.Form.html "struct rocket::form::Form") data guard: use rocket::form::Form; #[post("/submit", data = "")] fn submit(var: Form) { /* ... */ } [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#deriving) Deriving ---------------------------------------------------------------------------- This trait can, and largely _should_, be automatically derived. When deriving `FromForm`, every field in the structure must implement [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") . Form fields with the struct field’s name are [shifted](https://api.rocket.rs/v0.5/rocket/form/name/struct.NameView.html#method.shift "method rocket::form::name::NameView::shift") and then pushed to the struct field’s `FromForm` parser. use rocket::form::FromForm; #[derive(FromForm)] struct TodoTask<'r> { #[field(validate = len(1..))] description: &'r str, #[field(name = "done")] completed: bool } For full details on deriving `FromForm`, see the [`FromForm` derive](https://api.rocket.rs/v0.5/rocket/derive.FromForm.html "derive rocket::FromForm") . [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#parsing-strategy) Parsing Strategy -------------------------------------------------------------------------------------------- Form parsing is either _strict_ or _lenient_, controlled by [`Options::strict`](https://api.rocket.rs/v0.5/rocket/form/struct.Options.html#structfield.strict "field rocket::form::Options::strict") . A _strict_ parse errors when there are missing or extra fields, while a _lenient_ parse allows both, providing there is a [`default()`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#method.default "associated function rocket::form::FromForm::default") in the case of a missing field. Most type inherit their strategy on [`FromForm::init()`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#tymethod.init "associated function rocket::form::FromForm::init") , but some types like `Option` override the requested strategy. The strategy can also be overwritten manually, per-field or per-value, by using the [`Strict`](https://api.rocket.rs/v0.5/rocket/form/struct.Strict.html "struct rocket::form::Strict") or [`Lenient`](https://api.rocket.rs/v0.5/rocket/form/struct.Lenient.html "struct rocket::form::Lenient") form guard: use rocket::form::{self, FromForm, Strict, Lenient}; #[derive(FromForm)] struct TodoTask<'r> { strict_bool: Strict, lenient_inner_option: Option>, strict_inner_result: form::Result<'r, Strict>, } [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#defaults) Defaults ---------------------------------------------------------------------------- A form guard may have a _default_ which is used in case of a missing field when parsing is _lenient_. When parsing is strict, all errors, including missing fields, are propagated directly. [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#provided-implementations) Provided Implementations ------------------------------------------------------------------------------------------------------------ Rocket implements `FromForm` for many common types. As a result, most applications will never need a custom implementation of `FromForm` or `FromFormField`. Their behavior is documented in the table below. | Type | Strategy | Default | Data | Value | Notes | | --- | --- | --- | --- | --- | --- | | [`Strict`](https://api.rocket.rs/v0.5/rocket/form/struct.Strict.html "struct rocket::form::Strict") | **strict** | if `strict` `T` | if `T` | if `T` | `T: FromForm` | | [`Lenient`](https://api.rocket.rs/v0.5/rocket/form/struct.Lenient.html "struct rocket::form::Lenient") | **lenient** | if `lenient` `T` | if `T` | if `T` | `T: FromForm` | | `Option` | **strict** | `None` | if `T` | if `T` | Infallible, `T: FromForm` | | [`Result`](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result") | _inherit_ | `T::finalize()` | if `T` | if `T` | Infallible, `T: FromForm` | | `Vec` | _inherit_ | `vec![]` | if `T` | if `T` | `T: FromForm` | | [`HashMap`](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.HashMap.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::collections::HashMap") | _inherit_ | `HashMap::new()` | if `V` | if `V` | `K: FromForm + Eq + Hash`, `V: FromForm` | | [`BTreeMap`](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.BTreeMap.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::collections::BTreeMap") | _inherit_ | `BTreeMap::new()` | if `V` | if `V` | `K: FromForm + Ord`, `V: FromForm` | | [`Range`](https://doc.rust-lang.org/stable/std/ops/struct.Range.html) | _inherit_ | **no default** | if `T` | if `T` | `T: FromForm`, expects `start`, `end` fields | | [`RangeFrom`](https://doc.rust-lang.org/stable/std/ops/struct.RangeFrom.html) | _inherit_ | **no default** | if `T` | if `T` | `T: FromForm`, expects `start` field | | [`RangeTo`](https://doc.rust-lang.org/stable/std/ops/struct.RangeTo.html) | _inherit_ | **no default** | if `T` | if `T` | `T: FromForm`, expects `end` field | | [`RangeToInclusive`](https://doc.rust-lang.org/stable/std/ops/struct.RangeToInclusive.html) | _inherit_ | **no default** | if `T` | if `T` | `T: FromForm`, expects `end` field | | `bool` | _inherit_ | `false` | No | Yes | `"yes"/"on"/"true"`, `"no"/"off"/"false"` | | (un)signed int | _inherit_ | **no default** | No | Yes | `{u,i}{size,8,16,32,64,128}` | | _nonzero_ int | _inherit_ | **no default** | No | Yes | `NonZero{I,U}{size,8,16,32,64,128}` | | float | _inherit_ | **no default** | No | Yes | `f{32,64}` | | `&str` | _inherit_ | **no default** | Yes | Yes | Percent-decoded. Data limit `string` applies. | | `&[u8]` | _inherit_ | **no default** | Yes | Yes | Raw bytes. Data limit `bytes` applies. | | `String` | _inherit_ | **no default** | Yes | Yes | Exactly `&str`, but owned. Prefer `&str`. | | IP Address | _inherit_ | **no default** | No | Yes | [`IpAddr`](https://doc.rust-lang.org/nightly/core/net/ip_addr/enum.IpAddr.html "enum core::net::ip_addr::IpAddr")
, [`Ipv4Addr`](https://doc.rust-lang.org/nightly/core/net/ip_addr/struct.Ipv4Addr.html "struct core::net::ip_addr::Ipv4Addr")
, [`Ipv6Addr`](https://doc.rust-lang.org/nightly/core/net/ip_addr/struct.Ipv6Addr.html "struct core::net::ip_addr::Ipv6Addr") | | Socket Address | _inherit_ | **no default** | No | Yes | [`SocketAddr`](https://doc.rust-lang.org/nightly/core/net/socket_addr/enum.SocketAddr.html "enum core::net::socket_addr::SocketAddr")
, [`SocketAddrV4`](https://doc.rust-lang.org/nightly/core/net/socket_addr/struct.SocketAddrV4.html "struct core::net::socket_addr::SocketAddrV4")
, [`SocketAddrV6`](https://doc.rust-lang.org/nightly/core/net/socket_addr/struct.SocketAddrV6.html "struct core::net::socket_addr::SocketAddrV6") | | [`TempFile`](https://api.rocket.rs/v0.5/rocket/fs/enum.TempFile.html "enum rocket::fs::TempFile") | _inherit_ | **no default** | Yes | Yes | Data limits apply. See [`TempFile`](https://api.rocket.rs/v0.5/rocket/fs/enum.TempFile.html "enum rocket::fs::TempFile")
. | | [`Capped`](https://api.rocket.rs/v0.5/rocket/data/struct.Capped.html "struct rocket::data::Capped") | _inherit_ | **no default** | Yes | Yes | `C` is `&str`, `String`, `&[u8]` or `TempFile`. | | [`time::Date`](https://docs.rs/time/0.3.44/time/date/struct.Date.html "struct time::date::Date") | _inherit_ | **no default** | No | Yes | `%F` (`YYYY-MM-DD`). HTML “date” input. | | [`time::DateTime`](https://docs.rs/time/0.3.44/time/primitive_date_time/struct.PrimitiveDateTime.html "struct time::primitive_date_time::PrimitiveDateTime") | _inherit_ | **no default** | No | Yes | `%FT%R` or `%FT%T` (`YYYY-MM-DDTHH:MM[:SS]`) | | [`time::Time`](https://docs.rs/time/0.3.44/time/time/struct.Time.html "struct time::time::Time") | _inherit_ | **no default** | No | Yes | `%R` or `%T` (`HH:MM[:SS]`) | ### [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#additional-notes) Additional Notes * **`Vec` where `T: FromForm`** Parses a sequence of `T`’s. A new `T` is created whenever the field name’s key changes or is empty; the previous `T` is finalized and errors are stored. While the key remains the same and non-empty, form values are pushed to the current `T` after being shifted. All collected errors are returned at finalization, if any, or the successfully created vector is returned. * **`HashMap` where `K: FromForm + Eq + Hash`, `V: FromForm`** **`BTreeMap` where `K: FromForm + Ord`, `V: FromForm`** Parses a sequence of `(K, V)`’s. A new pair is created for every unique first index of the key. If the key has only one index (`map[index]=value`), the index itself is pushed to `K`’s parser and the remaining shifted field is pushed to `V`’s parser. If the key has two indices (`map[k:index]=value` or `map[v:index]=value`), the first index must start with `k` or `v`. If the first index starts with `k`, the shifted field is pushed to `K`’s parser. If the first index starts with `v`, the shifted field is pushed to `V`’s parser. If the first index is anything else, an error is created for the offending form field. Errors are collected as they occur. Finalization finalizes all pairs and returns errors, if any, or the map. * **`bool`** Parses as `false` for missing values (when lenient) and case-insensitive values of `off`, `false`, and `no`. Parses as `true` for values of `on`, `true`, `yes`, and the empty value. Failed to parse otherwise. * **[`time::DateTime`](https://docs.rs/time/0.3.44/time/primitive_date_time/struct.PrimitiveDateTime.html "struct time::primitive_date_time::PrimitiveDateTime") ** Parses a date in `%FT%R` or `%FT%T` format, that is, `YYYY-MM-DDTHH:MM` or `YYYY-MM-DDTHH:MM:SS`. This is the `"datetime-local"` HTML input type without support for the millisecond variant. * **[`time::Time`](https://docs.rs/time/0.3.44/time/time/struct.Time.html "struct time::time::Time") ** Parses a time in `%R` or `%T` format, that is, `HH:MM` or `HH:MM:SS`. This is the `"time"` HTML input type without support for the millisecond variant. [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#push-parsing) Push Parsing ------------------------------------------------------------------------------------ `FromForm` describes a push-based parser for Rocket’s [field wire format](https://api.rocket.rs/v0.5/rocket/form/index.html#field-wire-format "mod rocket::form") . Fields are preprocessed into either [`ValueField`](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField") s or [`DataField`](https://api.rocket.rs/v0.5/rocket/form/struct.DataField.html "struct rocket::form::DataField") s which are then pushed to the parser in [`FromForm::push_value()`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#tymethod.push_value "associated function rocket::form::FromForm::push_value") or [`FromForm::push_data()`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#tymethod.push_data "associated function rocket::form::FromForm::push_data") , respectively. Both url-encoded forms and multipart forms are supported. All url-encoded form fields are preprocessed as [`ValueField`](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField") s. Multipart form fields with Content-Types are processed as [`DataField`](https://api.rocket.rs/v0.5/rocket/form/struct.DataField.html "struct rocket::form::DataField") s while those without a set Content-Type are processed as [`ValueField`](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField") s. `ValueField` field names and values are percent-decoded. Parsing is split into 3 stages. After preprocessing, the three stages are: 1. **Initialization.** The type sets up a context for later `push`es. use rocket::form::Options; fn init(opts: Options) -> Self::Context { todo!("return a context for storing parse state") } 2. **Push.** The structure is repeatedly pushed form fields; the latest context is provided with each `push`. If the structure contains children, it uses the first [`key()`](https://api.rocket.rs/v0.5/rocket/form/name/struct.NameView.html#method.key "method rocket::form::name::NameView::key") to identify a child to which it then `push`es the remaining `field` to, likely with a [`shift()`ed](https://api.rocket.rs/v0.5/rocket/form/name/struct.NameView.html#method.shift "method rocket::form::name::NameView::shift") name. Otherwise, the structure parses the `value` itself. The context is updated as needed. use rocket::form::{ValueField, DataField}; fn push_value(ctxt: &mut Self::Context, field: ValueField<'r>) { todo!("modify context as necessary for `field`") } async fn push_data(ctxt: &mut Self::Context, field: DataField<'r, '_>) { todo!("modify context as necessary for `field`") } 3. **Finalization.** The structure is informed that there are no further fields. It systemizes the effects of previous `push`es via its context to return a parsed structure or generate [`Errors`](https://api.rocket.rs/v0.5/rocket/form/struct.Errors.html "struct rocket::form::Errors") . use rocket::form::Result; fn finalize(ctxt: Self::Context) -> Result<'r, Self> { todo!("inspect context to generate `Self` or `Errors`") } These three stages make up the entirety of the `FromForm` trait. ### [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#nesting-and-nameview) Nesting and [`NameView`](https://api.rocket.rs/v0.5/rocket/form/name/struct.NameView.html "struct rocket::form::name::NameView") Each field name key typically identifies a unique child of a structure. As such, when processed left-to-right, the keys of a field jointly identify a unique leaf of a structure. The value of the field typically represents the desired value of the leaf. A [`NameView`](https://api.rocket.rs/v0.5/rocket/form/name/struct.NameView.html "struct rocket::form::name::NameView") captures and simplifies this “left-to-right” processing of a field’s name by exposing a sliding-prefix view into a name. A [`shift()`](https://api.rocket.rs/v0.5/rocket/form/name/struct.NameView.html#method.shift "method rocket::form::name::NameView::shift") shifts the view one key to the right. Thus, a `Name` of `a.b.c` when viewed through a new [`NameView`](https://api.rocket.rs/v0.5/rocket/form/name/struct.NameView.html "struct rocket::form::name::NameView") is `a`. Shifted once, the view is `a.b`. [`key()`](https://api.rocket.rs/v0.5/rocket/form/name/struct.NameView.html#method.key "method rocket::form::name::NameView::key") returns the last (or “current”) key in the view. A nested structure can thus handle a field with a `NameView`, operate on the [`key()`](https://api.rocket.rs/v0.5/rocket/form/name/struct.NameView.html#method.key "method rocket::form::name::NameView::key") , [`shift()`](https://api.rocket.rs/v0.5/rocket/form/name/struct.NameView.html#method.shift "method rocket::form::name::NameView::shift") the `NameView`, and pass the field with the shifted `NameView` to the next processor which handles `b` and so on. ### [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#a-simple-example) A Simple Example The following example uses `f1=v1&f2=v2` to illustrate field/value pairs `(f1, v2)` and `(f2, v2)`. This is the same encoding used to send HTML forms over HTTP, though Rocket’s push-parsers are unaware of any specific encoding, dealing only with logical `field`s, `index`es, and `value`s. #### [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#a-single-field-t-formformfield) A Single Field (`T: FormFormField`) The simplest example parses a single value of type `T` from a string with an optional default value: this is `impl FromForm for T`: 1. **Initialization.** The context stores form options and an `Option` of `Result` for storing the `result` of parsing `T`, which is initially set to `None`. use rocket::form::{self, FromFormField}; struct Context<'r, T: FromFormField<'r>> { opts: form::Options, result: Option>, } fn init(opts: form::Options) -> Context<'r, T> { Context { opts, result: None } } 2. **Push.** If `ctxt.result` is `None`, `T` is parsed from `field`, and the result is stored in `context.result`. Otherwise a field has already been parsed and nothing is done. fn push_value(ctxt: &mut Context<'r, T>, field: ValueField<'r>) { if ctxt.result.is_none() { ctxt.result = Some(T::from_value(field)); } } 3. **Finalization.** If `ctxt.result` is `None`, parsing is lenient, and `T` has a default, the default is returned. Otherwise a `Missing` error is returned. If `ctxt.result` is `Some(v)`, the result `v` is returned. fn finalize(ctxt: Context<'r, T>) -> form::Result<'r, T> { match ctxt.result { Some(result) => result, None if ctxt.opts.strict => Err(Errors::from(ErrorKind::Missing)), None => match T::default() { Some(default) => Ok(default), None => Err(Errors::from(ErrorKind::Missing)), } } } This implementation is complete except for the following details: * handling both `push_data` and `push_value` * checking for duplicate pushes when parsing is `strict` * tracking the field’s name and value to generate a complete [`Error`](https://api.rocket.rs/v0.5/rocket/form/struct.Error.html "struct rocket::form::Error") [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#implementing) Implementing ------------------------------------------------------------------------------------ Implementing `FromForm` should be a rare occurrence. Prefer instead to use Rocket’s built-in derivation or, for custom types, implementing [`FromFormField`](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField") . An implementation of `FromForm` consists of implementing the three stages outlined above. `FromForm` is an async trait, so implementations must be decorated with an attribute of `#[rocket::async_trait]`: use rocket::form::{self, FromForm, DataField, ValueField}; #[rocket::async_trait] impl<'r> FromForm<'r> for MyType { type Context = MyContext; fn init(opts: form::Options) -> Self::Context { todo!() } fn push_value(ctxt: &mut Self::Context, field: ValueField<'r>) { todo!() } async fn push_data(ctxt: &mut Self::Context, field: DataField<'r, '_>) { todo!() } fn finalize(this: Self::Context) -> form::Result<'r, Self> { todo!() } } The lifetime `'r` corresponds to the lifetime of the request. ### [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#a-more-involved-example) A More Involved Example We illustrate implementation of `FromForm` through an example. The example implements `FromForm` for a `Pair(A, B)` type where `A: FromForm` and `B: FromForm`, parseable from forms with at least two fields, one with a key of `0` and the other with a key of `1`. The field with key `0` is parsed as an `A` while the field with key `1` is parsed as a `B`. Specifically, to parse a `Pair(A, B)` from a field with prefix `pair`, a form with the following fields must be submitted: * `pair[0]` - type A * `pair[1]` - type B Examples include: * `pair[0]=id&pair[1]=100` as `Pair(&str, usize)` * `pair[0]=id&pair[1]=100` as `Pair(&str, &str)` * `pair[0]=2012-10-12&pair[1]=100` as `Pair(time::Date, &str)` * `pair.0=2012-10-12&pair.1=100` as `Pair(time::Date, usize)` use either::Either; use rocket::form::{self, FromForm, ValueField, DataField, Error, Errors}; /// A form guard parseable from fields `.0` and `.1`. struct Pair(A, B); // The parsing context. We'll be pushing fields with key `.0` to `left` // and fields with `.1` to `right`. We'll collect errors along the way. struct PairContext<'v, A: FromForm<'v>, B: FromForm<'v>> { left: A::Context, right: B::Context, errors: Errors<'v>, } #[rocket::async_trait] impl<'v, A: FromForm<'v>, B: FromForm<'v>> FromForm<'v> for Pair { type Context = PairContext<'v, A, B>; // We initialize the `PairContext` as expected. fn init(opts: form::Options) -> Self::Context { PairContext { left: A::init(opts), right: B::init(opts), errors: Errors::new() } } // For each value, we determine if the key is `.0` (left) or `.1` // (right) and push to the appropriate parser. If it was neither, we // store the error for emission on finalization. The parsers for `A` and // `B` will handle duplicate values and so on. fn push_value(ctxt: &mut Self::Context, field: ValueField<'v>) { match ctxt.context(field.name) { Ok(Either::Left(ctxt)) => A::push_value(ctxt, field.shift()), Ok(Either::Right(ctxt)) => B::push_value(ctxt, field.shift()), Err(e) => ctxt.errors.push(e), } } // This is identical to `push_value` but for data fields. async fn push_data(ctxt: &mut Self::Context, field: DataField<'v, '_>) { match ctxt.context(field.name) { Ok(Either::Left(ctxt)) => A::push_data(ctxt, field.shift()).await, Ok(Either::Right(ctxt)) => B::push_data(ctxt, field.shift()).await, Err(e) => ctxt.errors.push(e), } } // Finally, we finalize `A` and `B`. If both returned `Ok` and we // encountered no errors during the push phase, we return our pair. If // there were errors, we return them. If `A` and/or `B` failed, we // return the commutative errors. fn finalize(mut ctxt: Self::Context) -> form::Result<'v, Self> { match (A::finalize(ctxt.left), B::finalize(ctxt.right)) { (Ok(l), Ok(r)) if ctxt.errors.is_empty() => Ok(Pair(l, r)), (Ok(_), Ok(_)) => Err(ctxt.errors), (left, right) => { if let Err(e) = left { ctxt.errors.extend(e); } if let Err(e) = right { ctxt.errors.extend(e); } Err(ctxt.errors) } } } } impl<'v, A: FromForm<'v>, B: FromForm<'v>> PairContext<'v, A, B> { // Helper method used by `push_{value, data}`. Determines which context // we should push to based on the field name's key. If the key is // neither `0` nor `1`, we return an error. fn context( &mut self, name: form::name::NameView<'v> ) -> Result, Error<'v>> { use std::borrow::Cow; match name.key().map(|k| k.as_str()) { Some("0") => Ok(Either::Left(&mut self.left)), Some("1") => Ok(Either::Right(&mut self.right)), _ => Err(Error::from(&[Cow::Borrowed("0"), Cow::Borrowed("1")]) .with_entity(form::error::Entity::Index(0)) .with_name(name)), } } } Required Associated Types[§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#required-associated-types) -------------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#534) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) : [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") The form guard’s parsing context. Required Methods[§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#required-methods) -------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#537) #### fn [init](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#tymethod.init) (opts: [Options](https://api.rocket.rs/v0.5/rocket/form/struct.Options.html "struct rocket::form::Options") ) -> Self::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") Initializes and returns the parsing context for `Self`. [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#540) #### fn [push\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#tymethod.push_value) (ctxt: &mut Self::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") , field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField") <'r>) Processes the value field `field`. [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#543) #### fn [push\_data](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#tymethod.push_data) <'life0, 'life1, 'async\_trait>( ctxt: &'life0 mut Self::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") , field: [DataField](https://api.rocket.rs/v0.5/rocket/form/struct.DataField.html "struct rocket::form::DataField") <'r, 'life1>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'r: 'async\_trait, 'life0: 'async\_trait, 'life1: 'async\_trait, Processes the data field `field`. [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#552) #### fn [finalize](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#tymethod.finalize) (ctxt: Self::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") ) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result") <'r, Self> Finalizes parsing. Returns the parsed value when successful or collection of [`Errors`](https://api.rocket.rs/v0.5/rocket/form/struct.Errors.html "struct rocket::form::Errors") otherwise. Provided Methods[§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#provided-methods) -------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#548) #### fn [push\_error](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#method.push_error) (\_ctxt: &mut Self::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") , \_error: [Error](https://api.rocket.rs/v0.5/rocket/form/struct.Error.html "struct rocket::form::Error") <'r>) Processes the external form or field error `_error`. The default implementation does nothing, which is always correct. [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#561-563) #### fn [default](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#method.default) (opts: [Options](https://api.rocket.rs/v0.5/rocket/form/struct.Options.html "struct rocket::form::Options") ) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") Returns a default value, if any, to use when a value is desired and parsing fails. The default implementation initializes `Self` with `opts` and finalizes immediately, returning the value if finalization succeeds. This is always correct and should likely not be changed. Returning a different value may result in ambiguous parses. Dyn Compatibility[§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#dyn-compatibility) ---------------------------------------------------------------------------------------------- This trait is **not** [dyn compatible](https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility) . _In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe._ Implementations on Foreign Types[§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#foreign-impls) --------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#882-920) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-(A,+B)) ### impl<'v, A: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>, B: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [(A, B)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#883) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-1) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = PairContext<'v, A, B> [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#885-891) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#method.init) #### fn [init](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#tymethod.init) (opts: [Options](https://api.rocket.rs/v0.5/rocket/form/struct.Options.html "struct rocket::form::Options") ) -> Self::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#893-899) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#method.push_value) #### fn [push\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#tymethod.push_value) (ctxt: &mut Self::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") , field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField") <'v>) [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#901-907) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#method.push_data) #### fn [push\_data](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#tymethod.push_data) <'life0, 'life1, 'async\_trait>( ctxt: &'life0 mut Self::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") , field: [DataField](https://api.rocket.rs/v0.5/rocket/form/struct.DataField.html "struct rocket::form::DataField") <'v, 'life1>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'v: 'async\_trait, 'life0: 'async\_trait, 'life1: 'async\_trait, [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#909-919) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#method.finalize) #### fn [finalize](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#tymethod.finalize) (ctxt: Self::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") ) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result") <'v, Self> [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#923-941) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-Arc%3CT%3E) ### impl<'v, T: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> + [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") \> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [Arc](https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html "struct alloc::sync::Arc") [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#924) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-2) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = >::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#926-928) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#method.init-1) #### fn [init](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#tymethod.init) (opts: [Options](https://api.rocket.rs/v0.5/rocket/form/struct.Options.html "struct rocket::form::Options") ) -> Self::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#930-932) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#method.push_value-1) #### fn [push\_value](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#tymethod.push_value) (ctxt: &mut Self::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") , field: [ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html "struct rocket::form::ValueField") <'v>) [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#934-936) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#method.push_data-1) #### fn [push\_data](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#tymethod.push_data) <'life0, 'life1, 'async\_trait>( ctxt: &'life0 mut Self::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") , field: [DataField](https://api.rocket.rs/v0.5/rocket/form/struct.DataField.html "struct rocket::form::DataField") <'v, 'life1>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'v: 'async\_trait, 'life0: 'async\_trait, 'life1: 'async\_trait, [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#938-940) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#method.finalize-1) #### fn [finalize](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#tymethod.finalize) (this: Self::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") ) -> [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result") <'v, Self> Implementors[§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#implementors) ------------------------------------------------------------------------------------ [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#795-815) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-BTreeMap%3CK,+V%3E) ### impl<'v, K, V> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [BTreeMap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.BTreeMap.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::collections::BTreeMap") where K: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> + [Ord](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Ord") , V: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>, [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#798) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-3) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = MapContext<'v, K, V> [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#772-792) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-HashMap%3CK,+V%3E) ### impl<'v, K, V> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [HashMap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.HashMap.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::collections::HashMap") where K: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> + [Eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Eq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Eq") + [Hash](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hash.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::Hash") , V: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>, [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#775) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-4) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = MapContext<'v, K, V> [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#986) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-Range%3CT%3E) ### impl<'v, T: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") \> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [Range](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.Range.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Range") where Range: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>, [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#986) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-5) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = as [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>>::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#987) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-RangeFrom%3CT%3E) ### impl<'v, T: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") \> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [RangeFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.RangeFrom.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::ops::RangeFrom") where RangeFrom: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>, [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#987) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-6) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = as [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>>::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#988) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-RangeTo%3CT%3E) ### impl<'v, T: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") \> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [RangeTo](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.RangeTo.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::ops::RangeTo") where RangeTo: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>, [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#988) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-7) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = as [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>>::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#989) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-RangeToInclusive%3CT%3E) ### impl<'v, T: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") \> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [RangeToInclusive](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.RangeToInclusive.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::ops::RangeToInclusive") where RangeToInclusive: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>, [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#989) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-8) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = as [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>>::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#613-638) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-Vec%3CT%3E) ### impl<'v, T: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> + 'v> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [Vec](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/vec/struct.Vec.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::vec::Vec") [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#614) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-9) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = VecContext<'v, T> [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#818-836) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-Option%3CT%3E) ### impl<'v, T: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#819) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-10) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = >::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") [Source](https://api.rocket.rs/v0.5/src/rocket/form/context.rs.html#365-397) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-Contextual%3C'v,+T%3E) ### impl<'v, T: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [Contextual](https://api.rocket.rs/v0.5/rocket/form/struct.Contextual.html "struct rocket::form::Contextual") <'v, T> [Source](https://api.rocket.rs/v0.5/src/rocket/form/context.rs.html#366) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-11) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = (>::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") , [Context](https://api.rocket.rs/v0.5/rocket/form/struct.Context.html "struct rocket::form::Context") <'v>) [Source](https://api.rocket.rs/v0.5/src/rocket/form/lenient.rs.html#77-99) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-Lenient%3CT%3E) ### impl<'v, T: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [Lenient](https://api.rocket.rs/v0.5/rocket/form/struct.Lenient.html "struct rocket::form::Lenient") [Source](https://api.rocket.rs/v0.5/src/rocket/form/lenient.rs.html#78) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-12) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = >::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") [Source](https://api.rocket.rs/v0.5/src/rocket/form/strict.rs.html#92-114) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-Strict%3CT%3E) ### impl<'v, T: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [Strict](https://api.rocket.rs/v0.5/rocket/form/struct.Strict.html "struct rocket::form::Strict") [Source](https://api.rocket.rs/v0.5/src/rocket/form/strict.rs.html#93) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-13) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = >::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#839-857) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-Result%3CT,+Errors%3C'v%3E%3E) ### impl<'v, T: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v>> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for [Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result") <'v, T> [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form.rs.html#840) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-14) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = >::[Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html#associatedtype.Context "type rocket::form::FromForm::Context") [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#239-287) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#impl-FromForm%3C'v%3E-for-T) ### impl<'v, T: [FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html "trait rocket::form::FromFormField") <'v>> [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'v> for T [Source](https://api.rocket.rs/v0.5/src/rocket/form/from_form_field.rs.html#240) [§](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context-15) #### type [Context](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm#associatedtype.Context) = FromFieldContext<'v, T> --- # catchers in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [catchers](https://api.rocket.rs/v0.5/rocket/macro.catchers.html#) ------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Macro catchers Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#1173) [Search](https://api.rocket.rs/v0.5/rocket/macro.catchers?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary catchers!() { /* proc-macro */ } Expand description Generates a `Vec` of [`Catcher`](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html) s from a set of catcher paths. The `catchers!` macro expands a list of catcher paths into a `Vec` of their corresponding [`Catcher`](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html) structures. For example, given the following catchers: #[catch(404)] fn not_found() { /* .. */ } mod inner { #[catch(400)] pub fn unauthorized() { /* .. */ } } #[catch(default)] fn default_catcher() { /* .. */ } The `catchers!` macro can be used as: let my_catchers = catchers![not_found, inner::unauthorized, default_catcher]; assert_eq!(my_catchers.len(), 3); let not_found = &my_catchers[0]; assert_eq!(not_found.code, Some(404)); let unauthorized = &my_catchers[1]; assert_eq!(unauthorized.code, Some(400)); let default = &my_catchers[2]; assert_eq!(default.code, None); The grammar for `catchers!` is defined as: catchers := PATH (',' PATH)* PATH := a path, as defined by Rust --- # routes in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [routes](https://api.rocket.rs/v0.5/rocket/macro.routes.html#) --------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Macro routes Copy item path =========================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#1115) [Search](https://api.rocket.rs/v0.5/rocket/macro.routes?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary routes!() { /* proc-macro */ } Expand description Generates a `Vec` of [`Route`](https://api.rocket.rs/v0.5/rocket/struct.Route.html) s from a set of route paths. The `routes!` macro expands a list of route paths into a `Vec` of their corresponding [`Route`](https://api.rocket.rs/v0.5/rocket/struct.Route.html) structures. For example, given the following routes: #[get("/")] fn index() { /* .. */ } mod person { #[post("/hi/")] pub fn hello(person: String) { /* .. */ } } The `routes!` macro can be used as: let my_routes = routes![index, person::hello]; assert_eq!(my_routes.len(), 2); let index_route = &my_routes[0]; assert_eq!(index_route.method, Method::Get); assert_eq!(index_route.name.as_ref().unwrap(), "index"); assert_eq!(index_route.uri.path(), "/"); let hello_route = &my_routes[1]; assert_eq!(hello_route.method, Method::Post); assert_eq!(hello_route.name.as_ref().unwrap(), "hello"); assert_eq!(hello_route.uri.path(), "/hi/"); The grammar for `routes!` is defined as: routes := PATH (',' PATH)* PATH := a path, as defined by Rust --- # rocket::serde - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module serde](https://api.rocket.rs/v0.5/rocket/serde/index.html#) -------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module serde Copy item path =========================== [Source](https://api.rocket.rs/v0.5/src/rocket/serde/mod.rs.html#1-55) [Search](https://api.rocket.rs/v0.5/rocket/serde/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Serialization and deserialization support. * JSON support is provided by the [`Json`](https://api.rocket.rs/v0.5/rocket/serde/json/struct.Json.html "struct rocket::serde::json::Json") type. * MessagePack support is provided by the [`MsgPack`](https://api.rocket.rs/v0.5/rocket/serde/msgpack/struct.MsgPack.html "struct rocket::serde::msgpack::MsgPack") type. * UUID support is provided by the [`UUID`](https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html "mod rocket::serde::uuid") type. Types implement one or all of [`FromParam`](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html "trait rocket::request::FromParam") , [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") , [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html "trait rocket::data::FromData") , and [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") . ### [§](https://api.rocket.rs/v0.5/rocket/serde/index.html#deriving-serialize-deserialize) Deriving `Serialize`, `Deserialize` For convenience, Rocket re-exports `serde`’s `Serialize` and `Deserialize` traits and derive macros from this module. However, due to Rust’s limited support for derive macro re-exports, using the re-exported derive macros requires annotating structures with `#[serde(crate = "rocket::serde")]`: use rocket::serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize)] #[serde(crate = "rocket::serde")] struct MyStruct { foo: String, } If you’d like to avoid this extra annotation, you must depend on `serde` directly via your crate’s `Cargo.toml`: [dependencies] serde = { version = "1.0", features = ["derive"] } Modules[§](https://api.rocket.rs/v0.5/rocket/serde/index.html#modules) ----------------------------------------------------------------------- [json](https://api.rocket.rs/v0.5/rocket/serde/json/index.html "mod rocket::serde::json") `json` Automatic JSON (de)serialization support. [msgpack](https://api.rocket.rs/v0.5/rocket/serde/msgpack/index.html "mod rocket::serde::msgpack") `msgpack` Automatic MessagePack (de)serialization support. [uuid](https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html "mod rocket::serde::uuid") `uuid` UUID path/query parameter and form value parsing support. Traits[§](https://api.rocket.rs/v0.5/rocket/serde/index.html#traits) --------------------------------------------------------------------- [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") A **data structure** that can be deserialized from any data format supported by Serde. [DeserializeOwned](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned.html "trait rocket::serde::DeserializeOwned") A data structure that can be deserialized without borrowing any data from the deserializer. [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") A **data format** that can deserialize any data structure supported by Serde. [Serialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html "trait rocket::serde::Serialize") A **data structure** that can be serialized into any data format supported by Serde. [Serializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html "trait rocket::serde::Serializer") A **data format** that can serialize any data structure supported by Serde. --- # Catcher in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#) ------------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Struct Catcher Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#112-124) [Search](https://api.rocket.rs/v0.5/rocket/struct.Catcher?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub struct Catcher { pub name: Option>, pub base: Origin<'static>, pub code: Option, pub handler: Box, } Expand description An error catching route. Catchers are routes that run when errors are produced by the application. They consist of a [`Handler`](https://api.rocket.rs/v0.5/rocket/catcher/trait.Handler.html "trait rocket::catcher::Handler") and an optional status code to match against arising errors. Errors arise from the the following sources: * A failing guard. * A failing responder. * A forwarding guard. * Routing failure. Each error or forward is paired with a status code. Guards and responders indicate the status code themselves via their `Err` and `Outcome` return value. A complete routing failure is always a `404`. Rocket invokes the error handler for the catcher with an error’s status code, or in the case of every route resulting in a forward, the last forwarded status code. #### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#error-handler-restrictions) Error Handler Restrictions Because error handlers are a last resort, they should not fail to produce a response. If an error handler _does_ fail, Rocket invokes its default `500` error catcher. Error handlers cannot forward. [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#routing) Routing -------------------------------------------------------------------------- If a route fails by returning an error [`Outcome`](https://api.rocket.rs/v0.5/rocket/request/type.Outcome.html "type rocket::request::Outcome") , Rocket routes the erroring request to the highest precedence catcher among all the catchers that match. Precedence is determined by the catcher’s _base_, which is provided as the first argument to [`Rocket::register()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.register "method rocket::Rocket::register") . Catchers with more non-empty segments have a higher precedence. Rocket provides [built-in defaults](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#built-in-default) , but _default_ catchers can also be registered. A _default_ catcher is a catcher with no explicit status code: `None`. [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#collisions) Collisions -------------------------------------------------------------------------------- Two catchers are said to _collide_ if there exists an error that matches both catchers. Colliding catchers present a routing ambiguity and are thus disallowed by Rocket. Because catchers can be constructed dynamically, collision checking is done at [`ignite`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.ignite "method rocket::Rocket::ignite") time, after it becomes statically impossible to register any more catchers on an instance of `Rocket`. #### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#built-in-default) Built-In Default Rocket’s provides a built-in default catcher that can handle all errors. It produces HTML or JSON, depending on the value of the `Accept` header. As such, catchers only need to be registered if an error needs to be handled in a custom fashion. The built-in default never conflicts with any user-registered catchers. [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#code-generation) Code Generation ------------------------------------------------------------------------------------------ Catchers should rarely be constructed or used directly. Instead, they are typically generated via the [`catch`](https://api.rocket.rs/v0.5/rocket/attr.catch.html "attr rocket::catch") attribute, as follows: #[macro_use] extern crate rocket; use rocket::Request; use rocket::http::Status; #[catch(500)] fn internal_error() -> &'static str { "Whoops! Looks like we messed up." } #[catch(404)] fn not_found(req: &Request) -> String { format!("I couldn't find '{}'. Try something else?", req.uri()) } #[catch(default)] fn default(status: Status, req: &Request) -> String { format!("{} ({})", status, req.uri()) } #[launch] fn rocket() -> _ { rocket::build().register("/", catchers![internal_error, not_found, default]) } A function decorated with `#[catch]` may take zero, one, or two arguments. It’s type signature must be one of the following, where `R:`[`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") : * `fn() -> R` * `fn(`[`&Request`](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") `) -> R` * `fn(`[`Status`](https://api.rocket.rs/v0.5/rocket/http/struct.Status.html "struct rocket::http::Status") `,` [`&Request`](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") `) -> R` See the [`catch`](https://api.rocket.rs/v0.5/rocket/attr.catch.html "attr rocket::catch") documentation for full details. Fields[§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#fields) ------------------------------------------------------------------------ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#structfield.name) `name: [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow") <'static, [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) >>` The name of this catcher, if one was given. [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#structfield.base) `base: [Origin](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html "struct rocket::http::uri::Origin") <'static>` The mount point. [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#structfield.code) `code: [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html) >` The HTTP status to match against if this route is not `default`. [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#structfield.handler) `handler: [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") ` The catcher’s associated error handler. Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#implementations) ------------------------------------------------------------------------------------------ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#126-222) [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Catcher) ### impl [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher") [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#163-177) #### pub fn [new](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.new) (code: S, handler: H) -> [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher") where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html) \>>, H: [Handler](https://api.rocket.rs/v0.5/rocket/catcher/trait.Handler.html "trait rocket::catcher::Handler") , Creates a catcher for the given `status`, or a default catcher if `status` is `None`, using the given error handler. This should only be used when routing manually. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#examples) Examples use rocket::request::Request; use rocket::catcher::{Catcher, BoxFuture}; use rocket::response::Responder; use rocket::http::Status; fn handle_404<'r>(status: Status, req: &'r Request<'_>) -> BoxFuture<'r> { let res = (status, format!("404: {}", req.uri())); Box::pin(async move { res.respond_to(req) }) } fn handle_500<'r>(_: Status, req: &'r Request<'_>) -> BoxFuture<'r> { Box::pin(async move{ "Whoops, we messed up!".respond_to(req) }) } fn handle_default<'r>(status: Status, req: &'r Request<'_>) -> BoxFuture<'r> { let res = (status, format!("{}: {}", status, req.uri())); Box::pin(async move { res.respond_to(req) }) } let not_found_catcher = Catcher::new(404, handle_404); let internal_server_error_catcher = Catcher::new(500, handle_500); let default_error_catcher = Catcher::new(None, handle_default); ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#panics) Panics Panics if `code` is not in the HTTP status code error range `[400, 600)`.\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#212-221)\ \ #### pub fn [map\_base](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.map_base)\ <'a, F>(self, mapper: F) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result")\ >\ \ where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce")\ ([Origin](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html "struct rocket::http::uri::Origin")\ <'a>) -> [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String")\ ,\ \ Maps the `base` of this catcher using `mapper`, returning a new `Catcher` with the returned base.\ \ `mapper` is called with the current base. The returned `String` is used as the new base if it is a valid URI. If the returned base URI contains a query, it is ignored. Returns an error if the base produced by `mapper` is not a valid origin URI.\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example)\ Example\ \ use rocket::request::Request;\ use rocket::catcher::{Catcher, BoxFuture};\ use rocket::response::Responder;\ use rocket::http::Status;\ \ fn handle_404<'r>(status: Status, req: &'r Request<'_>) -> BoxFuture<'r> {\ let res = (status, format!("404: {}", req.uri()));\ Box::pin(async move { res.respond_to(req) })\ }\ \ let catcher = Catcher::new(404, handle_404);\ assert_eq!(catcher.base.path(), "/");\ \ let catcher = catcher.map_base(|_| format!("/bar")).unwrap();\ assert_eq!(catcher.base.path(), "/bar");\ \ let catcher = catcher.map_base(|base| format!("/foo{}", base)).unwrap();\ assert_eq!(catcher.base.path(), "/foo/bar");\ \ let catcher = catcher.map_base(|base| format!("/foo ? {}", base));\ assert!(catcher.is_err());\ \ Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#trait-implementations)\ \ ------------------------------------------------------------------------------------------------------\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#111)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Clone-for-Catcher)\ \ ### impl [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#111)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.clone)\ \ #### fn [clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone)\ (&self) -> [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone)\ \ 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#245-247)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.clone_from)\ \ #### fn [clone\_from](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from)\ (&mut self, source: &Self)\ \ Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#274-282)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Debug-for-Catcher)\ \ ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#275-281)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.fmt-1)\ \ #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt)\ (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter")\ <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result")\ \ Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#224-234)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Default-for-Catcher)\ \ ### impl [Default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html "trait core::default::Default")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#225-233)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.default)\ \ #### fn [default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default)\ () -> Self\ \ Returns the “default value” for a type. [Read more](https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#257-272)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Display-for-Catcher)\ \ ### impl [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#258-271)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.fmt)\ \ #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt)\ (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter")\ <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result")\ \ Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt)\ \ Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#synthetic-implementations)\ \ ---------------------------------------------------------------------------------------------------------------\ \ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Freeze-for-Catcher)\ \ ### impl ![Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-RefUnwindSafe-for-Catcher)\ \ ### impl ![RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Send-for-Catcher)\ \ ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Sync-for-Catcher)\ \ ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Unpin-for-Catcher)\ \ ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-UnwindSafe-for-Catcher)\ \ ### impl ![UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#blanket-implementations)\ \ ----------------------------------------------------------------------------------------------------------\ \ [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Any-for-T)\ \ ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any")\ for T\ \ where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.type_id)\ \ #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id)\ (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId")\ \ Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id)\ \ [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-AsTaggedExplicit%3C'a%3E-for-T)\ \ ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit")\ <'a> for T\ \ where T: 'a,\ \ [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.explicit)\ \ #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit)\ (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class")\ , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html)\ ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser")\ <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit")\ , Self>\ \ [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-AsTaggedImplicit%3C'a%3E-for-T)\ \ ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit")\ <'a> for T\ \ where T: 'a,\ \ [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.implicit)\ \ #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit)\ ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class")\ , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html)\ , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html)\ , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser")\ <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit")\ , Self>\ \ [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Borrow%3CT%3E-for-T)\ \ ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow")\ for T\ \ where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.borrow)\ \ #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow)\ (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \ Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow)\ \ [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-BorrowMut%3CT%3E-for-T)\ \ ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut")\ for T\ \ where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.borrow_mut)\ \ #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut)\ (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \ Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut)\ \ [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#547)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-CloneToUninit-for-T)\ \ ### impl [CloneToUninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html "trait core::clone::CloneToUninit")\ for T\ \ where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#549)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.clone_to_uninit)\ \ #### unsafe fn [clone\_to\_uninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit)\ (&self, dest: [\*mut](https://doc.rust-lang.org/nightly/std/primitive.pointer.html)\ [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ )\ \ 🔬This is a nightly-only experimental API. (`clone_to_uninit`)\ \ Performs copy-assignment from `self` to `dest`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit)\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-From%3CT%3E-for-T)\ \ ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From")\ for T\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.from)\ \ #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from)\ (t: T) -> T\ \ Returns the argument unchanged.\ \ [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Instrument-for-T)\ \ ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument")\ for T\ \ [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.instrument)\ \ #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument)\ (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span")\ ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented")\ [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#)\ \ Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span")\ , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument)\ \ [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.in_current_span)\ \ #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span)\ (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented")\ [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#)\ \ Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current")\ [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span")\ , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span)\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Into%3CU%3E-for-T)\ \ ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into")\ for T\ \ where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.into)\ \ #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into)\ (self) -> U\ \ Calls `U::from(self)`.\ \ That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do.\ \ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-IntoCollection%3CT%3E-for-T)\ \ ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection")\ for T\ \ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.into_collection)\ \ #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection)\
(self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec")\ \ \ where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array")\ ,\ \ Converts `self` into a collection.\ \ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.mapped)\ \ #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped)\ (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec")\ \ \ where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut")\ (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array")\ ,\ \ [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-IntoEither-for-T)\ \ ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither")\ for T\ \ [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.into_either)\ \ #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either)\ (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html)\ ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either")\ [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#)\ \ Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left")\ variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either")\ if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right")\ variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either")\ otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either)\ \ [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.into_either_with)\ \ #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with)\ (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either")\ [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#)\ \ where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce")\ (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html)\ ,\ \ Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left")\ variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either")\ if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right")\ variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either")\ otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with)\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Paint-for-T)\ \ ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint")\ for T\ \ where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized")\ ,\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.fg)\ \ #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg)\ (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color")\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns a styled value derived from `self` with the foreground set to `value`.\ \ This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red())\ and [`green()`](self::green())\ , which have the same functionality but are pithier.\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-1)\ Example\ \ Set foreground color to white using `fg()`:\ \ use yansi::{Paint, Color};\ \ painted.fg(Color::White);\ \ Set foreground color to white using [`white()`](self::white())\ .\ \ use yansi::Paint;\ \ painted.white();\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.primary)\ \ #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Primary`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-2)\ Example\ \ println!("{}", value.primary());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.fixed)\ \ #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed)\ (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Fixed`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-3)\ Example\ \ println!("{}", value.fixed(color));\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.rgb)\ \ #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb)\ (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Rgb`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-4)\ Example\ \ println!("{}", value.rgb(r, g, b));\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.black)\ \ #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Black`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-5)\ Example\ \ println!("{}", value.black());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.red)\ \ #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Red`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-6)\ Example\ \ println!("{}", value.red());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.green)\ \ #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Green`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-7)\ Example\ \ println!("{}", value.green());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.yellow)\ \ #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Yellow`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-8)\ Example\ \ println!("{}", value.yellow());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.blue)\ \ #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Blue`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-9)\ Example\ \ println!("{}", value.blue());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.magenta)\ \ #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Magenta`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-10)\ Example\ \ println!("{}", value.magenta());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.cyan)\ \ #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Cyan`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-11)\ Example\ \ println!("{}", value.cyan());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.white)\ \ #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: White`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-12)\ Example\ \ println!("{}", value.white());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.bright_black)\ \ #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightBlack`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-13)\ Example\ \ println!("{}", value.bright_black());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.bright_red)\ \ #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightRed`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-14)\ Example\ \ println!("{}", value.bright_red());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.bright_green)\ \ #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightGreen`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-15)\ Example\ \ println!("{}", value.bright_green());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.bright_yellow)\ \ #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightYellow`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-16)\ Example\ \ println!("{}", value.bright_yellow());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.bright_blue)\ \ #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightBlue`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-17)\ Example\ \ println!("{}", value.bright_blue());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.bright_magenta)\ \ #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightMagenta`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-18)\ Example\ \ println!("{}", value.bright_magenta());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.bright_cyan)\ \ #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightCyan`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-19)\ Example\ \ println!("{}", value.bright_cyan());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.bright_white)\ \ #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightWhite`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-20)\ Example\ \ println!("{}", value.bright_white());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.bg)\ \ #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg)\ (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color")\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns a styled value derived from `self` with the background set to `value`.\ \ This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red())\ and [`on_green()`](self::on_green())\ , which have the same functionality but are pithier.\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-21)\ Example\ \ Set background color to red using `fg()`:\ \ use yansi::{Paint, Color};\ \ painted.bg(Color::Red);\ \ Set background color to red using [`on_red()`](self::on_red())\ .\ \ use yansi::Paint;\ \ painted.on_red();\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_primary)\ \ #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Primary`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-22)\ Example\ \ println!("{}", value.on_primary());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_fixed)\ \ #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed)\ (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Fixed`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-23)\ Example\ \ println!("{}", value.on_fixed(color));\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_rgb)\ \ #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb)\ (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Rgb`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-24)\ Example\ \ println!("{}", value.on_rgb(r, g, b));\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_black)\ \ #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Black`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-25)\ Example\ \ println!("{}", value.on_black());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_red)\ \ #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Red`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-26)\ Example\ \ println!("{}", value.on_red());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_green)\ \ #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Green`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-27)\ Example\ \ println!("{}", value.on_green());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_yellow)\ \ #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Yellow`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-28)\ Example\ \ println!("{}", value.on_yellow());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_blue)\ \ #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Blue`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-29)\ Example\ \ println!("{}", value.on_blue());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_magenta)\ \ #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Magenta`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-30)\ Example\ \ println!("{}", value.on_magenta());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_cyan)\ \ #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Cyan`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-31)\ Example\ \ println!("{}", value.on_cyan());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_white)\ \ #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: White`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-32)\ Example\ \ println!("{}", value.on_white());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_bright_black)\ \ #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightBlack`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-33)\ Example\ \ println!("{}", value.on_bright_black());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_bright_red)\ \ #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightRed`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-34)\ Example\ \ println!("{}", value.on_bright_red());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_bright_green)\ \ #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightGreen`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-35)\ Example\ \ println!("{}", value.on_bright_green());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_bright_yellow)\ \ #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightYellow`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-36)\ Example\ \ println!("{}", value.on_bright_yellow());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_bright_blue)\ \ #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightBlue`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-37)\ Example\ \ println!("{}", value.on_bright_blue());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_bright_magenta)\ \ #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightMagenta`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-38)\ Example\ \ println!("{}", value.on_bright_magenta());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_bright_cyan)\ \ #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightCyan`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-39)\ Example\ \ println!("{}", value.on_bright_cyan());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_bright_white)\ \ #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightWhite`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-40)\ Example\ \ println!("{}", value.on_bright_white());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.attr)\ \ #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr)\ (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute")\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute")\ `value`.\ \ This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold())\ and [`underline()`](self::underline())\ , which have the same functionality but are pithier.\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-41)\ Example\ \ Make text bold using `attr()`:\ \ use yansi::{Paint, Attribute};\ \ painted.attr(Attribute::Bold);\ \ Make text bold using using [`bold()`](self::bold())\ .\ \ use yansi::Paint;\ \ painted.bold();\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.bold)\ \ #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Bold`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-42)\ Example\ \ println!("{}", value.bold());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.dim)\ \ #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Dim`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-43)\ Example\ \ println!("{}", value.dim());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.italic)\ \ #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Italic`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-44)\ Example\ \ println!("{}", value.italic());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.underline)\ \ #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Underline`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-45)\ Example\ \ println!("{}", value.underline());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.blink)\ \ #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Blink`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-46)\ Example\ \ println!("{}", value.blink());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.rapid_blink)\ \ #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: RapidBlink`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-47)\ Example\ \ println!("{}", value.rapid_blink());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.invert)\ \ #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Invert`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-48)\ Example\ \ println!("{}", value.invert());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.conceal)\ \ #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Conceal`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-49)\ Example\ \ println!("{}", value.conceal());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.strike)\ \ #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Strike`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-50)\ Example\ \ println!("{}", value.strike());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.quirk)\ \ #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk)\ (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk")\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk")\ `value`.\ \ This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask())\ and [`wrap()`](self::wrap())\ , which have the same functionality but are pithier.\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-51)\ Example\ \ Enable wrapping using `.quirk()`:\ \ use yansi::{Paint, Quirk};\ \ painted.quirk(Quirk::Wrap);\ \ Enable wrapping using [`wrap()`](self::wrap())\ .\ \ use yansi::Paint;\ \ painted.wrap();\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.mask)\ \ #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: Mask`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-52)\ Example\ \ println!("{}", value.mask());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.wrap)\ \ #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: Wrap`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-53)\ Example\ \ println!("{}", value.wrap());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.linger)\ \ #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: Linger`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-54)\ Example\ \ println!("{}", value.linger());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.clear)\ \ #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release.\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: Clear`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-55)\ Example\ \ println!("{}", value.clear());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.resetting)\ \ #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: Resetting`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-56)\ Example\ \ println!("{}", value.resetting());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.bright)\ \ #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: Bright`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-57)\ Example\ \ println!("{}", value.bright());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.on_bright)\ \ #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: OnBright`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-58)\ Example\ \ println!("{}", value.on_bright());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.whenever)\ \ #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever)\ (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition")\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition")\ `value` applies. Replaces any previous condition.\ \ See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi")\ for more details.\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#example-59)\ Example\ \ Enable styling `painted` only when both `stdout` and `stderr` are TTYs:\ \ use yansi::{Paint, Condition};\ \ painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.new-1)\ \ #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new)\ (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ \ \ where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized")\ ,\ \ Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style")\ . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new)\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.paint)\ \ #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint)\ (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <&Self>\ \ where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into")\ <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style")\ \>,\ \ Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint)\ \ [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-Same-for-T)\ \ ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same")\ for T\ \ [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#associatedtype.Output)\ \ #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output)\ = T\ \ Should always be `Self`\ \ [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-ToOwned-for-T)\ \ ### impl [ToOwned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html "trait alloc::borrow::ToOwned")\ for T\ \ where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#associatedtype.Owned)\ \ #### type [Owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned)\ = T\ \ The resulting type after obtaining ownership.\ \ [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#90)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.to_owned)\ \ #### fn [to\_owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned)\ (&self) -> T\ \ Creates owned data from borrowed data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned)\ \ [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#94)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.clone_into)\ \ #### fn [clone\_into](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into)\ (&self, target: [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ )\ \ Uses borrowed data to replace owned data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into)\ \ [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2861)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-ToString-for-T)\ \ ### impl [ToString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::string::ToString")\ for T\ \ where T: [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display")\ + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2863)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.to_string)\ \ #### fn [to\_string](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string)\ (&self) -> [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String")\ \ Converts the given value to a `String`. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string)\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-TryFrom%3CU%3E-for-T)\ \ ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom")\ for T\ \ where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#associatedtype.Error-1)\ \ #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error)\ = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible")\ \ The type returned in the event of a conversion error.\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.try_from)\ \ #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from)\ (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result")\ >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error")\ \>\ \ Performs the conversion.\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-TryInto%3CU%3E-for-T)\ \ ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto")\ for T\ \ where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#associatedtype.Error)\ \ #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error)\ = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error")\ \ The type returned in the event of a conversion error.\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.try_into)\ \ #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into)\ (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result")\ >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error")\ \>\ \ Performs the conversion.\ \ [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-VZip%3CV%3E-for-T)\ \ ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip")\ for T\ \ where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane")\ ,\ \ [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.vzip)\ \ #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip)\ (self) -> V\ \ [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#impl-WithSubscriber-for-T)\ \ ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber")\ for T\ \ [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.with_subscriber)\ \ #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber)\ (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch")\ [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#)\ \ where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into")\ <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch")\ \>,\ \ Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber")\ to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch")\ wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber)\ \ [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228)\ [§](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#method.with_current_subscriber)\ \ #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber)\ (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch")\ [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#)\ \ Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher")\ [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber")\ to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch")\ wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # custom in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [custom](https://api.rocket.rs/v0.5/rocket/fn.custom.html#) ------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Function custom Copy item path ============================== [Source](https://api.rocket.rs/v0.5/src/rocket/lib.rs.html#204-206) [Search](https://api.rocket.rs/v0.5/rocket/fn.custom?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub fn custom(provider: T) -> Rocket Expand description Creates a [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") instance with a custom config provider: aliases [`Rocket::custom()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.custom "associated function rocket::Rocket::custom") . --- # build in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [build](https://api.rocket.rs/v0.5/rocket/fn.build.html#) ---------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Function build Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket/lib.rs.html#198-200) [Search](https://api.rocket.rs/v0.5/rocket/fn.build?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub fn build() -> Rocket Expand description Creates a [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") instance with the default config provider: aliases [`Rocket::build()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.build "associated function rocket::Rocket::build") . --- # execute in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [execute](https://api.rocket.rs/v0.5/rocket/fn.execute.html#) -------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Function execute Copy item path =============================== [Source](https://api.rocket.rs/v0.5/src/rocket/lib.rs.html#360-364) [Search](https://api.rocket.rs/v0.5/rocket/fn.execute?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub fn execute(future: F) -> Rwhere F: Future + Send, Expand description Executes a `future` to completion on a new tokio-based Rocket async runtime. The runtime is terminated on shutdown, and the future’s resolved value is returned. [§](https://api.rocket.rs/v0.5/rocket/fn.execute.html#considerations) Considerations ------------------------------------------------------------------------------------ This function is a low-level mechanism intended to be used to execute the future returned by [`Rocket::launch()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.launch "method rocket::Rocket::launch") in a self-contained async runtime designed for Rocket. It runs futures in exactly the same manner as [`#[launch]`](https://api.rocket.rs/v0.5/rocket/attr.launch.html "attr rocket::launch") and [`#[main]`](https://api.rocket.rs/v0.5/rocket/attr.main.html "attr rocket::main") do and is thus _never_ the preferred mechanism for running a Rocket application. _Always_ prefer to use the [`#[launch]`](https://api.rocket.rs/v0.5/rocket/attr.launch.html "attr rocket::launch") or [`#[main]`](https://api.rocket.rs/v0.5/rocket/attr.main.html "attr rocket::main") attributes. For example [`#[main]`](https://api.rocket.rs/v0.5/rocket/attr.main.html "attr rocket::main") can be used even when Rocket is just a small part of a bigger application: #[rocket::main] async fn main() { let rocket = rocket::build(); if should_start_server_in_foreground { rocket::build().launch().await; } else if should_start_server_in_background { rocket::tokio::spawn(rocket.launch()); } else { // do something else } } See [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#launching "struct rocket::Rocket") for more on using these attributes. [§](https://api.rocket.rs/v0.5/rocket/fn.execute.html#example) Example ---------------------------------------------------------------------- Build an instance of Rocket, launch it, and wait for shutdown: use rocket::fairing::AdHoc; let rocket = rocket::build() .attach(AdHoc::on_liftoff("Liftoff Printer", |_| Box::pin(async move { println!("Stalling liftoff for a second..."); rocket::tokio::time::sleep(std::time::Duration::from_secs(1)).await; println!("And we're off!"); }))); rocket::execute(rocket.launch()); Launch a pre-built instance of Rocket and wait for it to shutdown: use rocket::{Rocket, Ignite, Phase, Error}; fn launch(rocket: Rocket

[Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#768-774) #### pub fn [routes](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.routes) (&self) -> impl [Iterator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.Iterator.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::iter::Iterator") Returns an iterator over all of the routes mounted on this instance of Rocket. The order is unspecified. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-9) Example use rocket::Rocket; use rocket::fairing::AdHoc; #[get("/hello")] fn hello() -> &'static str { "Hello, world!" } let rocket = rocket::build() .mount("/", routes![hello]) .mount("/hi", routes![hello]); assert_eq!(rocket.routes().count(), 2); assert!(rocket.routes().any(|r| r.uri == "/hello")); assert!(rocket.routes().any(|r| r.uri == "/hi/hello")); [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#799-805) #### pub fn [catchers](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.catchers) (&self) -> impl [Iterator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.Iterator.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::iter::Iterator") Returns an iterator over all of the catchers registered on this instance of Rocket. The order is unspecified. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-10) Example use rocket::Rocket; use rocket::fairing::AdHoc; #[catch(404)] fn not_found() -> &'static str { "Nothing here, sorry!" } #[catch(500)] fn just_500() -> &'static str { "Whoops!?" } #[catch(default)] fn some_default() -> &'static str { "Everything else." } let rocket = rocket::build() .register("/foo", catchers![not_found]) .register("/", catchers![just_500, some_default]); assert_eq!(rocket.catchers().count(), 3); assert!(rocket.catchers().any(|c| c.code == Some(404) && c.base == "/foo")); assert!(rocket.catchers().any(|c| c.code == Some(500) && c.base == "/")); assert!(rocket.catchers().any(|c| c.code == None && c.base == "/")); [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#819-825) #### pub fn [state](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.state) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `Some` of the managed state value for the type `T` if it is being managed by `self`. Otherwise, returns `None`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-11) Example #[derive(PartialEq, Debug)] struct MyState(&'static str); let rocket = rocket::build().manage(MyState("hello!")); assert_eq!(rocket.state::().unwrap(), &MyState("hello!")); [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#837-843) #### pub fn [figment](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.figment) (&self) -> &[Figment](https://docs.rs/figment/0.10.19/figment/figment/struct.Figment.html "struct figment::figment::Figment") Returns the figment derived from the configuration provider set for `self`. To extract a typed config, prefer to use [`AdHoc::config()`](https://api.rocket.rs/v0.5/rocket/fairing/struct.AdHoc.html#method.config "associated function rocket::fairing::AdHoc::config") . ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-12) Example let rocket = rocket::build(); let figment = rocket.figment(); [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#899-905) #### pub async fn [launch](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.launch) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") <[Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") \>, [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") \> Returns a `Future` that transitions this instance of `Rocket` from any phase into the _orbit_ phase. When `await`ed, the future drives the server forward, listening for and dispatching requests to mounted routes and catchers. In addition to all of the processes that occur during [ignition](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.ignite "method rocket::Rocket::ignite") , a successful launch results in _liftoff_ fairings being executed _after_ binding to any respective network interfaces but before serving the first request. Liftoff fairings are run concurrently; resolution of all fairings is `await`ed before resuming request serving. The `Future` resolves as an `Err` if any of the following occur: * there is an error igniting; see [`Rocket::ignite()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.ignite "method rocket::Rocket::ignite") . * there is an I/O error starting the server. * an unrecoverable, system-level error occurs while running. The `Future` resolves as an `Ok` if any of the following occur: * graceful shutdown via [`Shutdown::notify()`](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.notify "method rocket::Shutdown::notify") completes. The returned value on `Ok(())` is previously running instance. The `Future` does not resolve otherwise. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#error) Error If there is a problem starting the application or the application fails unexpectedly while running, an [`Error`](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") is returned. Note that a value of type `Error` panics if dropped without first being inspected. See the [`Error`](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") documentation for more information. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-13) Example #[rocket::main] async fn main() { let result = rocket::build().launch().await; // this is reachable only after `Shutdown::notify()` or `Ctrl+C`. println!("Rocket: deorbit."); } Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#trait-implementations) ----------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#924-928) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Debug-for-Rocket%3CP%3E) ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") for [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket")

[Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#925-927) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.fmt) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#synthetic-implementations) -------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Freeze-for-Rocket%3CP%3E) ### impl

[Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket")

where

::[State](https://api.rocket.rs/v0.5/rocket/trait.Phase.html#associatedtype.State "type rocket::Phase::State") : [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") , [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-RefUnwindSafe-for-Rocket%3CP%3E) ### impl

[RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket")

where

::[State](https://api.rocket.rs/v0.5/rocket/trait.Phase.html#associatedtype.State "type rocket::Phase::State") : [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") , [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Send-for-Rocket%3CP%3E) ### impl

[Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket")

[§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Sync-for-Rocket%3CP%3E) ### impl

[Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket")

[§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Unpin-for-Rocket%3CP%3E) ### impl

[Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket")

[§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-UnwindSafe-for-Rocket%3CP%3E) ### impl

[UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket")

where

::[State](https://api.rocket.rs/v0.5/rocket/trait.Phase.html#associatedtype.State "type rocket::Phase::State") : [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") , Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#blanket-implementations) --------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-14) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-15) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-16) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-17) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-18) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-19) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-20) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-21) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-22) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-23) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-24) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-25) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-26) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-27) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-28) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-29) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-30) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-31) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-32) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-33) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-34) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-35) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-36) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-37) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-38) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-39) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-40) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-41) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-42) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-43) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-44) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-45) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-46) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-47) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-48) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-49) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-50) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-51) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-52) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-53) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-54) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-55) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-56) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-57) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-58) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-59) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-60) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-61) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-62) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-63) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-64) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-65) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-66) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-67) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-68) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-69) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-70) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-71) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-72) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://doc.rust-lang.org/nightly/src/core/ops/deref.rs.html#378-380) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Receiver-for-P) ### impl [Receiver](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Receiver.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Receiver") for P where P: [Deref](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/ops/deref.rs.html#382) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#associatedtype.Target) #### type [Target](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Receiver.html#associatedtype.Target) = T 🔬This is a nightly-only experimental API. (`arbitrary_self_types`) The target type on which the method may be called. [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#357) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Rng-for-R) ### impl [Rng](https://rust-random.github.io/rand/rand/rng/trait.Rng.html "trait rand::rng::Rng") for R where R: [RngCore](https://rust-random.github.io/rand/rand_core/trait.RngCore.html "trait rand_core::RngCore") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#95-97) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.random) #### fn [random](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random) (&mut self) -> T where [StandardUniform](https://rust-random.github.io/rand/rand/distr/struct.StandardUniform.html "struct rand::distr::StandardUniform") : [Distribution](https://rust-random.github.io/rand/rand/distr/distribution/trait.Distribution.html "trait rand::distr::distribution::Distribution") , Return a random value via the [`StandardUniform`](https://rust-random.github.io/rand/rand/distr/struct.StandardUniform.html "struct rand::distr::StandardUniform") distribution. [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#120-123) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.random_iter) #### fn [random\_iter](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_iter) (self) -> [Iter](https://rust-random.github.io/rand/rand/distr/distribution/struct.Iter.html "struct rand::distr::distribution::Iter") <[StandardUniform](https://rust-random.github.io/rand/rand/distr/struct.StandardUniform.html "struct rand::distr::StandardUniform") , Self, T> [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#) where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [StandardUniform](https://rust-random.github.io/rand/rand/distr/struct.StandardUniform.html "struct rand::distr::StandardUniform") : [Distribution](https://rust-random.github.io/rand/rand/distr/distribution/trait.Distribution.html "trait rand::distr::distribution::Distribution") , Return an iterator over [`random`](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random "method rand::rng::Rng::random::random") variates [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_iter) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#161-164) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.random_range) #### fn [random\_range](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_range) (&mut self, range: R) -> T where T: [SampleUniform](https://rust-random.github.io/rand/rand/distr/uniform/trait.SampleUniform.html "trait rand::distr::uniform::SampleUniform") , R: [SampleRange](https://rust-random.github.io/rand/rand/distr/uniform/trait.SampleRange.html "trait rand::distr::uniform::SampleRange") , Generate a random value in the given range. [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_range) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#191) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.random_bool) #### fn [random\_bool](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_bool) (&mut self, p: [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Return a bool with a probability `p` of being true. [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_bool) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#225) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.random_ratio) #### fn [random\_ratio](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_ratio) (&mut self, numerator: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , denominator: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Return a bool with a probability of `numerator/denominator` of being true. [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_ratio) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#249) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.sample) #### fn [sample](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.sample) (&mut self, distr: D) -> T where D: [Distribution](https://rust-random.github.io/rand/rand/distr/distribution/trait.Distribution.html "trait rand::distr::distribution::Distribution") , Sample a new value, using the given distribution. [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.sample) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#286-289) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.sample_iter) #### fn [sample\_iter](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.sample_iter) (self, distr: D) -> [Iter](https://rust-random.github.io/rand/rand/distr/distribution/struct.Iter.html "struct rand::distr::distribution::Iter") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#) where D: [Distribution](https://rust-random.github.io/rand/rand/distr/distribution/trait.Distribution.html "trait rand::distr::distribution::Distribution") , Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create an iterator that generates values using the given distribution. [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.sample_iter) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#314) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.fill) #### fn [fill](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.fill) (&mut self, dest: [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) where T: [Fill](https://rust-random.github.io/rand/rand/rng/trait.Fill.html "trait rand::rng::Fill") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Fill any type implementing [`Fill`](https://rust-random.github.io/rand/rand/rng/trait.Fill.html "trait rand::rng::Fill") with random data [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.fill) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#324-326) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.gen) #### fn [gen](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.gen) (&mut self) -> T where [StandardUniform](https://rust-random.github.io/rand/rand/distr/struct.StandardUniform.html "struct rand::distr::StandardUniform") : [Distribution](https://rust-random.github.io/rand/rand/distr/distribution/trait.Distribution.html "trait rand::distr::distribution::Distribution") , 👎Deprecated since 0.9.0: Renamed to `random` to avoid conflict with the new `gen` keyword in Rust 2024. Alias for [`Rng::random`](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random "method rand::rng::Rng::random") . [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#334-337) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.gen_range) #### fn [gen\_range](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.gen_range) (&mut self, range: R) -> T where T: [SampleUniform](https://rust-random.github.io/rand/rand/distr/uniform/trait.SampleUniform.html "trait rand::distr::uniform::SampleUniform") , R: [SampleRange](https://rust-random.github.io/rand/rand/distr/uniform/trait.SampleRange.html "trait rand::distr::uniform::SampleRange") , 👎Deprecated since 0.9.0: Renamed to `random_range` Alias for [`Rng::random_range`](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_range "method rand::rng::Rng::random_range") . [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#345) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.gen_bool) #### fn [gen\_bool](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.gen_bool) (&mut self, p: [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) 👎Deprecated since 0.9.0: Renamed to `random_bool` Alias for [`Rng::random_bool`](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_bool "method rand::rng::Rng::random_bool") . [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#352) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.gen_ratio) #### fn [gen\_ratio](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.gen_ratio) (&mut self, numerator: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , denominator: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) 👎Deprecated since 0.9.0: Renamed to `random_ratio` Alias for [`Rng::random_ratio`](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_ratio "method rand::rng::Rng::random_ratio") . [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#158-160) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-RngCore-for-T) ### impl [RngCore](https://rust-random.github.io/rand/rand_core/trait.RngCore.html "trait rand_core::RngCore") for T where T: [DerefMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.DerefMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::DerefMut") , ::[Target](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html#associatedtype.Target "type rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref::Target") : [RngCore](https://rust-random.github.io/rand/rand_core/trait.RngCore.html "trait rand_core::RngCore") , [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#163) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.next_u32) #### fn [next\_u32](https://rust-random.github.io/rand/rand_core/trait.RngCore.html#tymethod.next_u32) (&mut self) -> [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) Return the next random `u32`. [Read more](https://rust-random.github.io/rand/rand_core/trait.RngCore.html#tymethod.next_u32) [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#168) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.next_u64) #### fn [next\_u64](https://rust-random.github.io/rand/rand_core/trait.RngCore.html#tymethod.next_u64) (&mut self) -> [u64](https://doc.rust-lang.org/nightly/std/primitive.u64.html) Return the next random `u64`. [Read more](https://rust-random.github.io/rand/rand_core/trait.RngCore.html#tymethod.next_u64) [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#173) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.fill_bytes) #### fn [fill\_bytes](https://rust-random.github.io/rand/rand_core/trait.RngCore.html#tymethod.fill_bytes) (&mut self, dst: &mut \[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \]) Fill `dest` with random data. [Read more](https://rust-random.github.io/rand/rand_core/trait.RngCore.html#tymethod.fill_bytes) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#257) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-TryRngCore-for-R) ### impl [TryRngCore](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html "trait rand_core::TryRngCore") for R where R: [RngCore](https://rust-random.github.io/rand/rand_core/trait.RngCore.html "trait rand_core::RngCore") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#258) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#associatedtype.Error-2) #### type [Error](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a RNG error. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#261) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.try_next_u32) #### fn [try\_next\_u32](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#tymethod.try_next_u32) (&mut self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ::[Error](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#associatedtype.Error "type rand_core::TryRngCore::Error") \> Return the next random `u32`. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#266) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.try_next_u64) #### fn [try\_next\_u64](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#tymethod.try_next_u64) (&mut self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[u64](https://doc.rust-lang.org/nightly/std/primitive.u64.html) , ::[Error](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#associatedtype.Error "type rand_core::TryRngCore::Error") \> Return the next random `u64`. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#271) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.try_fill_bytes) #### fn [try\_fill\_bytes](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#tymethod.try_fill_bytes) ( &mut self, dst: &mut \[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \], ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[()](https://doc.rust-lang.org/nightly/std/primitive.unit.html) , ::[Error](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#associatedtype.Error "type rand_core::TryRngCore::Error") \> Fill `dest` entirely with random data. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#232-234) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.unwrap_err) #### fn [unwrap\_err](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#method.unwrap_err) (self) -> [UnwrapErr](https://rust-random.github.io/rand/rand_core/struct.UnwrapErr.html "struct rand_core::UnwrapErr") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Wrap RNG with the [`UnwrapErr`](https://rust-random.github.io/rand/rand_core/struct.UnwrapErr.html "struct rand_core::UnwrapErr") wrapper. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#240) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.unwrap_mut) #### fn [unwrap\_mut](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#method.unwrap_mut) (&mut self) -> [UnwrapMut](https://rust-random.github.io/rand/rand_core/struct.UnwrapMut.html "struct rand_core::UnwrapMut") <'\_, Self> Wrap RNG with the [`UnwrapMut`](https://rust-random.github.io/rand/rand_core/struct.UnwrapMut.html "struct rand_core::UnwrapMut") wrapper. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#246-248) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.read_adapter) #### fn [read\_adapter](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#method.read_adapter) (&mut self) -> [RngReadAdapter](https://rust-random.github.io/rand/rand_core/struct.RngReadAdapter.html "struct rand_core::RngReadAdapter") <'\_, Self> where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Available on **crate feature `std`** only. Convert an [`RngCore`](https://rust-random.github.io/rand/rand_core/trait.RngCore.html "trait rand_core::RngCore") to a [`RngReadAdapter`](https://rust-random.github.io/rand/rand_core/struct.RngReadAdapter.html "struct rand_core::RngReadAdapter") . [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#206) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-CryptoRng-for-T) ### impl [CryptoRng](https://rust-random.github.io/rand/rand_core/trait.CryptoRng.html "trait rand_core::CryptoRng") for T where T: [DerefMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.DerefMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::DerefMut") , ::[Target](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html#associatedtype.Target "type rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref::Target") : [CryptoRng](https://rust-random.github.io/rand/rand_core/trait.CryptoRng.html "trait rand_core::CryptoRng") , [Source](https://docs.rs/time/0.3.44/src/time/formatting/formattable.rs.html#33) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Formattable-for-T) ### impl [Formattable](https://docs.rs/time/0.3.44/time/formatting/formattable/trait.Formattable.html "trait time::formatting::formattable::Formattable") for T where T: [Deref](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref") , ::[Target](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html#associatedtype.Target "type rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref::Target") : [Formattable](https://docs.rs/time/0.3.44/time/formatting/formattable/trait.Formattable.html "trait time::formatting::formattable::Formattable") , [Source](https://docs.rs/time/0.3.44/src/time/parsing/parsable.rs.html#30) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Parsable-for-T) ### impl [Parsable](https://docs.rs/time/0.3.44/time/parsing/parsable/trait.Parsable.html "trait time::parsing::parsable::Parsable") for T where T: [Deref](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref") , ::[Target](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html#associatedtype.Target "type rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref::Target") : [Parsable](https://docs.rs/time/0.3.44/time/parsing/parsable/trait.Parsable.html "trait time::parsing::parsable::Parsable") , [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#293) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-TryCryptoRng-for-R) ### impl [TryCryptoRng](https://rust-random.github.io/rand/rand_core/trait.TryCryptoRng.html "trait rand_core::TryCryptoRng") for R where R: [CryptoRng](https://rust-random.github.io/rand/rand_core/trait.CryptoRng.html "trait rand_core::CryptoRng") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , --- # State in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [State](https://api.rocket.rs/v0.5/rocket/struct.State.html#) -------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Struct State Copy item path =========================== [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#117) [Search](https://api.rocket.rs/v0.5/rocket/struct.State?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub struct State(/* private fields */); Expand description Request guard to retrieve managed state. A reference `&State` type is a request guard which retrieves the managed state managing for some type `T`. A value for the given type must previously have been registered to be managed by Rocket via [`Rocket::manage()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.manage "method rocket::Rocket::manage") . The type being managed must be thread safe and sendable across thread boundaries as multiple handlers in multiple threads may be accessing the value at once. In other words, it must implement [`Send`](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + [`Sync`](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") + `'static`. [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example) Example ------------------------------------------------------------------------ Imagine you have some configuration struct of the type `MyConfig` that you’d like to initialize at start-up and later access it in several handlers. The following example does just this: use rocket::State; // In a real application, this would likely be more complex. struct MyConfig { user_val: String } #[get("/")] fn index(state: &State) -> String { format!("The config value is: {}", state.user_val) } #[get("/raw")] fn raw_config_value(state: &State) -> &str { &state.user_val } #[launch] fn rocket() -> _ { rocket::build() .mount("/", routes![index, raw_config_value]) .manage(MyConfig { user_val: "user input".to_string() }) } [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#within-request-guards) Within Request Guards ---------------------------------------------------------------------------------------------------- Because `State` is itself a request guard, managed state can be retrieved from another request guard’s implementation using either [`Request::guard()`](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.guard "method rocket::Request::guard") or [`Rocket::state()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.state "method rocket::Rocket::state") . In the following code example, the `Item` request guard retrieves `MyConfig` from managed state: use rocket::State; use rocket::request::{self, Request, FromRequest}; use rocket::outcome::IntoOutcome; use rocket::http::Status; struct Item<'r>(&'r str); #[rocket::async_trait] impl<'r> FromRequest<'r> for Item<'r> { type Error = (); async fn from_request(request: &'r Request<'_>) -> request::Outcome { // Using `State` as a request guard. Use `inner()` to get an `'r`. let outcome = request.guard::<&State>().await .map(|my_config| Item(&my_config.user_val)); // Or alternatively, using `Rocket::state()`: let outcome = request.rocket().state::() .map(|my_config| Item(&my_config.user_val)) .or_forward(Status::InternalServerError); outcome } } [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#testing-with-state) Testing with `State` ------------------------------------------------------------------------------------------------ When unit testing your application, you may find it necessary to manually construct a type of `State` to pass to your functions. To do so, use the [`State::get()`](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.get "associated function rocket::State::get") static method or the `From<&T>` implementation: use rocket::State; struct MyManagedState(usize); #[get("/")] fn handler(state: &State) -> String { state.0.to_string() } let mut rocket = rocket::build().manage(MyManagedState(127)); let state = State::get(&rocket).expect("managed `MyManagedState`"); assert_eq!(handler(state), "127"); let managed = MyManagedState(77); assert_eq!(handler(State::from(&managed)), "77"); Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.State.html#implementations) ---------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#119-186) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-State%3CT%3E) ### impl [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#143-145) #### pub fn [get](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.get) (rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket")

) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <&[State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") > Returns the managed state value in `rocket` for the type `T` if it is being managed by `rocket`. Otherwise, returns `None`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-1) Example use rocket::State; #[derive(Debug, PartialEq)] struct Managed(usize); #[derive(Debug, PartialEq)] struct Unmanaged(usize); let rocket = rocket::build().manage(Managed(7)); let state: Option<&State> = State::get(&rocket); assert_eq!(state.map(|s| s.inner()), Some(&Managed(7))); let state: Option<&State> = State::get(&rocket); assert_eq!(state, None); [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#183-185) #### pub fn [inner](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.inner) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Borrow the inner value. Using this method is typically unnecessary as `State` implements [`Deref`](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref") with a [`Deref::Target`](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html#associatedtype.Target "associated type rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref::Target") of `T`. This means Rocket will automatically coerce a `State` to an `&T` as required. This method should only be used when a longer lifetime is required. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-2) Example use rocket::State; #[derive(Clone)] struct MyConfig { user_val: String } fn handler1<'r>(config: &State) -> String { let config = config.inner().clone(); config.user_val } // Use the `Deref` implementation which coerces implicitly fn handler2(config: &State) -> String { config.user_val.clone() } Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.State.html#trait-implementations) ---------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Debug-for-State%3CT%3E) ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.fmt) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#230-237) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Deref-for-State%3CT%3E) ### impl [Deref](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#231) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#associatedtype.Target) #### type [Target](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html#associatedtype.Target) = T The resulting type after dereferencing. [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#234-236) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.deref) #### fn [deref](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html#tymethod.deref) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Dereferences the value. [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#224-228) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Display-for-State%3CT%3E) ### impl [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#225-227) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.fmt-1) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#188-193) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-From%3C%26T%3E-for-%26State%3CT%3E) ### impl<'r, T: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") + 'static> [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") <[&'r T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> for &'r [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#190-192) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (reference: [&'r T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> Self Converts to this type from the input type. [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#196-209) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-FromRequest%3C'r%3E-for-%26State%3CT%3E) ### impl<'r, T: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") + 'static> [FromRequest](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html "trait rocket::request::FromRequest") <'r> for &'r [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#197) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#associatedtype.Error) = [()](https://doc.rust-lang.org/nightly/std/primitive.unit.html) The associated error to be returned if derivation fails. [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#200-208) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.from_request) #### fn [from\_request](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#tymethod.from_request) <'life0, 'async\_trait>( req: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'r: 'async\_trait, 'life0: 'async\_trait, Derives an instance of `Self` from the incoming request metadata. [Read more](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#tymethod.from_request) [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Hash-for-State%3CT%3E) ### impl [Hash](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hash.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::Hash") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.hash) #### fn [hash](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hash.html#tymethod.hash) <\_\_H: [Hasher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hasher.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::Hasher") \>(&self, state: [&mut \_\_H](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) Feeds this value into the given [`Hasher`](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hasher.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::Hasher") . [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hash.html#tymethod.hash) 1.3.0 · [Source](https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#235-237) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.hash_slice) #### fn [hash\_slice](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hash.html#method.hash_slice) (data: &\[Self\], state: [&mut H](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) where H: [Hasher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hasher.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::Hasher") , Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Feeds a slice of this type into the given [`Hasher`](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hasher.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::Hasher") . [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hash.html#method.hash_slice) [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Ord-for-State%3CT%3E) ### impl [Ord](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Ord") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.cmp) #### fn [cmp](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html#tymethod.cmp) (&self, other: &[State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") ) -> [Ordering](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/enum.Ordering.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Ordering") This method returns an [`Ordering`](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/enum.Ordering.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Ordering") between `self` and `other`. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html#tymethod.cmp) 1.21.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1021-1023) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.max) #### fn [max](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html#method.max) (self, other: Self) -> Self where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Compares and returns the maximum of two values. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html#method.max) 1.21.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1060-1062) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.min) #### fn [min](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html#method.min) (self, other: Self) -> Self where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Compares and returns the minimum of two values. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html#method.min) 1.50.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1086-1088) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.clamp) #### fn [clamp](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html#method.clamp) (self, min: Self, max: Self) -> Self where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Restrict a value to a certain interval. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html#method.clamp) [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-PartialEq-for-State%3CT%3E) ### impl [PartialEq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::PartialEq") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.eq) #### fn [eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html#tymethod.eq) (&self, other: &[State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `self` and `other` values to be equal, and is used by `==`. 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#264) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.ne) #### fn [ne](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html#method.ne) (&self, other: [&Rhs](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-PartialOrd-for-State%3CT%3E) ### impl [PartialOrd](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialOrd.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::PartialOrd") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.partial_cmp) #### fn [partial\_cmp](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialOrd.html#tymethod.partial_cmp) (&self, other: &[State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") ) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[Ordering](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/enum.Ordering.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Ordering") \> This method returns an ordering between `self` and `other` values if one exists. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialOrd.html#tymethod.partial_cmp) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1398) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.lt) #### fn [lt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialOrd.html#method.lt) (&self, other: [&Rhs](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialOrd.html#method.lt) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1416) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.le) #### fn [le](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialOrd.html#method.le) (&self, other: [&Rhs](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialOrd.html#method.le) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1434) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.gt) #### fn [gt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialOrd.html#method.gt) (&self, other: [&Rhs](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialOrd.html#method.gt) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1452) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.ge) #### fn [ge](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialOrd.html#method.ge) (&self, other: [&Rhs](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialOrd.html#method.ge) [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-RefCast-for-State%3CT%3E) ### impl [RefCast](https://docs.rs/ref-cast/1.0.25/ref_cast/trait.RefCast.html "trait ref_cast::RefCast") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#associatedtype.From) #### type [From](https://docs.rs/ref-cast/1.0.25/ref_cast/trait.RefCast.html#associatedtype.From) = T [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.ref_cast) #### fn [ref\_cast](https://docs.rs/ref-cast/1.0.25/ref_cast/trait.RefCast.html#tymethod.ref_cast) (\_from: &Self::[From](https://docs.rs/ref-cast/1.0.25/ref_cast/trait.RefCast.html#associatedtype.From "type ref_cast::RefCast::From") ) -> &Self [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.ref_cast_mut) #### fn [ref\_cast\_mut](https://docs.rs/ref-cast/1.0.25/ref_cast/trait.RefCast.html#tymethod.ref_cast_mut) (\_from: &mut Self::[From](https://docs.rs/ref-cast/1.0.25/ref_cast/trait.RefCast.html#associatedtype.From "type ref_cast::RefCast::From") ) -> &mut Self [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#211-222) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Sentinel-for-%26State%3CT%3E) ### impl [Sentinel](https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html "trait rocket::Sentinel") for &[State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#212-221) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.abort) #### fn [abort](https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html#tymethod.abort) (rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") <[Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") \>) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if launch should be aborted and `false` otherwise. [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Eq-for-State%3CT%3E) ### impl [Eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Eq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Eq") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [Source](https://api.rocket.rs/v0.5/src/rocket/state.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-StructuralPartialEq-for-State%3CT%3E) ### impl [StructuralPartialEq](https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html "trait core::marker::StructuralPartialEq") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.State.html#synthetic-implementations) ------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Freeze-for-State%3CT%3E) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") where T: [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") , [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-RefUnwindSafe-for-State%3CT%3E) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") where T: [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") , [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Send-for-State%3CT%3E) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Sync-for-State%3CT%3E) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Unpin-for-State%3CT%3E) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") where T: [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") , [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-UnwindSafe-for-State%3CT%3E) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [State](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") where T: [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") , Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.State.html#blanket-implementations) -------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://docs.rs/equivalent/1.0.2/src/equivalent/lib.rs.html#104-107) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Comparable%3CK%3E-for-Q) ### impl [Comparable](https://docs.rs/equivalent/1.0.2/equivalent/trait.Comparable.html "trait equivalent::Comparable") for Q where Q: [Ord](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Ord") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , K: [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/equivalent/1.0.2/src/equivalent/lib.rs.html#110) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.compare) #### fn [compare](https://docs.rs/equivalent/1.0.2/equivalent/trait.Comparable.html#tymethod.compare) (&self, key: [&K](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [Ordering](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/enum.Ordering.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Ordering") Compare self to `key` and return their ordering. [Source](https://docs.rs/hashbrown/0.16.1/src/hashbrown/lib.rs.html#168-171) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Equivalent%3CK%3E-for-Q) ### impl [Equivalent](https://docs.rs/hashbrown/0.16.1/hashbrown/trait.Equivalent.html "trait hashbrown::Equivalent") for Q where Q: [Eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Eq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Eq") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , K: [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/hashbrown/0.16.1/src/hashbrown/lib.rs.html#173) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.equivalent) #### fn [equivalent](https://docs.rs/hashbrown/0.16.1/hashbrown/trait.Equivalent.html#tymethod.equivalent) (&self, key: [&K](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Checks if this value is equivalent to the given key. [Read more](https://docs.rs/hashbrown/0.16.1/hashbrown/trait.Equivalent.html#tymethod.equivalent) [Source](https://docs.rs/equivalent/1.0.2/src/equivalent/lib.rs.html#82-85) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Equivalent%3CK%3E-for-Q-1) ### impl [Equivalent](https://docs.rs/equivalent/1.0.2/equivalent/trait.Equivalent.html "trait equivalent::Equivalent") for Q where Q: [Eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Eq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Eq") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , K: [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/equivalent/1.0.2/src/equivalent/lib.rs.html#88) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.equivalent-1) #### fn [equivalent](https://docs.rs/equivalent/1.0.2/equivalent/trait.Equivalent.html#tymethod.equivalent) (&self, key: [&K](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Compare self to `key` and return `true` if they are equal. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.from-1) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.State.html#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.State.html#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.State.html#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.State.html#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-3) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-4) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-5) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-6) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-7) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-8) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-9) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-10) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-11) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-12) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-13) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-14) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-15) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-16) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-17) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-18) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-19) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-20) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-21) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-22) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-23) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-24) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-25) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-26) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-27) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-28) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-29) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-30) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-31) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-32) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-33) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-34) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-35) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-36) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-37) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-38) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-39) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-40) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-41) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-42) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-43) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-44) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-45) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-46) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-47) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-48) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-49) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-50) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-51) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-52) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-53) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-54) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-55) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-56) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-57) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-58) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-59) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-60) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#example-61) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://doc.rust-lang.org/nightly/src/core/ops/deref.rs.html#378-380) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Receiver-for-P) ### impl [Receiver](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Receiver.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Receiver") for P where P: [Deref](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/ops/deref.rs.html#382) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#associatedtype.Target-1) #### type [Target](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Receiver.html#associatedtype.Target) = T 🔬This is a nightly-only experimental API. (`arbitrary_self_types`) The target type on which the method may be called. [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2861) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-ToString-for-T) ### impl [ToString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::string::ToString") for T where T: [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2863) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.to_string) #### fn [to\_string](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string) (&self) -> [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") Converts the given value to a `String`. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#associatedtype.Error-2) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.State.html#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.State.html#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) [Source](https://docs.rs/time/0.3.44/src/time/formatting/formattable.rs.html#33) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Formattable-for-T) ### impl [Formattable](https://docs.rs/time/0.3.44/time/formatting/formattable/trait.Formattable.html "trait time::formatting::formattable::Formattable") for T where T: [Deref](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref") , ::[Target](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html#associatedtype.Target "type rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref::Target") : [Formattable](https://docs.rs/time/0.3.44/time/formatting/formattable/trait.Formattable.html "trait time::formatting::formattable::Formattable") , [Source](https://docs.rs/time/0.3.44/src/time/parsing/parsable.rs.html#30) [§](https://api.rocket.rs/v0.5/rocket/struct.State.html#impl-Parsable-for-T) ### impl [Parsable](https://docs.rs/time/0.3.44/time/parsing/parsable/trait.Parsable.html "trait time::parsing::parsable::Parsable") for T where T: [Deref](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref") , ::[Target](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html#associatedtype.Target "type rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Deref::Target") : [Parsable](https://docs.rs/time/0.3.44/time/parsing/parsable/trait.Parsable.html "trait time::parsing::parsable::Parsable") , --- # async_trait in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [async\_trait](https://api.rocket.rs/v0.5/rocket/attr.async_trait.html#) ------------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro async\_trait Copy item path =========================================== [Source](https://docs.rs/async-trait/0.1.89/src/async_trait/lib.rs.html#252) [Search](https://api.rocket.rs/v0.5/rocket/attr.async_trait?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[async_trait] Expand description Retrofits support for `async fn` in trait impls and declarations. Any trait declaration or trait `impl` decorated with `#[async_trait]` is retrofitted with support for `async fn`s: #[async_trait] trait MyAsyncTrait { async fn do_async_work(); } #[async_trait] impl MyAsyncTrait for () { async fn do_async_work() { /* .. */ } } All `impl`s for a trait declared with `#[async_trait]` must themselves be decorated with `#[async_trait]`. Many of Rocket’s traits, such as [`FromRequest`](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html "trait rocket::request::FromRequest") and [`Fairing`](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html "trait rocket::fairing::Fairing") are `async`. As such, implementations of said traits must be decorated with `#[async_trait]`. See the individual trait docs for trait-specific details. For more details on `#[async_trait]`, see [`async_trait`](https://docs.rs/async-trait/0.1.89/async_trait/index.html "mod async_trait") . --- # Shutdown in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) -------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Struct Shutdown Copy item path ============================== [Source](https://api.rocket.rs/v0.5/src/rocket/shutdown.rs.html#68) [Search](https://api.rocket.rs/v0.5/rocket/struct.Shutdown?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub struct Shutdown(/* private fields */); Expand description A request guard and future for graceful shutdown. A server shutdown is manually requested by calling [`Shutdown::notify()`](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.notify "method rocket::Shutdown::notify") or, if enabled, through [automatic triggers](https://api.rocket.rs/v0.5/rocket/config/struct.Shutdown.html#triggers "struct rocket::config::Shutdown") like `Ctrl-C`. Rocket will stop accepting new requests, finish handling any pending requests, wait a grace period before cancelling any outstanding I/O, and return `Ok()` to the caller of [`Rocket::launch()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.launch "method rocket::Rocket::launch") . Graceful shutdown is configured via [`config::Shutdown`](https://api.rocket.rs/v0.5/rocket/config/struct.Shutdown.html "struct rocket::config::Shutdown") . [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#detecting-shutdown) Detecting Shutdown ------------------------------------------------------------------------------------------------- `Shutdown` is also a future that resolves when [`Shutdown::notify()`](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.notify "method rocket::Shutdown::notify") is called. This can be used to detect shutdown in any part of the application: use rocket::Shutdown; #[get("/wait/for/shutdown")] async fn wait_for_shutdown(shutdown: Shutdown) -> &'static str { shutdown.await; "Somewhere, shutdown was requested." } See the [`stream`](https://api.rocket.rs/v0.5/rocket/response/stream/index.html#graceful-shutdown "mod rocket::response::stream") docs for an example of detecting shutdown in an infinite responder. Additionally, a completed shutdown request resolves the future returned from [`Rocket::launch()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.launch "method rocket::Rocket::launch") : use rocket::Shutdown; #[get("/shutdown")] fn shutdown(shutdown: Shutdown) -> &'static str { shutdown.notify(); "Shutting down..." } #[rocket::main] async fn main() { let result = rocket::build() .mount("/", routes![shutdown]) .launch() .await; // If the server shut down (by visiting `/shutdown`), `result` is `Ok`. result.expect("server failed unexpectedly"); } Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#implementations) ------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/shutdown.rs.html#70-92) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Shutdown) ### impl [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") [Source](https://api.rocket.rs/v0.5/src/rocket/shutdown.rs.html#89-91) #### pub fn [notify](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.notify) (self) Notify the application to shut down gracefully. This function returns immediately; pending requests will continue to run until completion or expiration of the grace period, which ever comes first, before the actual shutdown occurs. The grace period can be configured via [`Shutdown::grace`](https://api.rocket.rs/v0.5/rocket/config/struct.Shutdown.html#structfield.grace "field rocket::config::Shutdown::grace") . use rocket::Shutdown; #[get("/shutdown")] fn shutdown(shutdown: Shutdown) -> &'static str { shutdown.notify(); "Shutting down..." } Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#trait-implementations) ------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/shutdown.rs.html#66) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Clone-for-Shutdown) ### impl [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") for [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") [Source](https://api.rocket.rs/v0.5/src/rocket/shutdown.rs.html#66) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.clone) #### fn [clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) (&self) -> [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#245-247) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.clone_from) #### fn [clone\_from](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) (&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) [Source](https://api.rocket.rs/v0.5/src/rocket/shutdown.rs.html#66) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Debug-for-Shutdown) ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") for [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") [Source](https://api.rocket.rs/v0.5/src/rocket/shutdown.rs.html#66) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.fmt) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/shutdown.rs.html#95-102) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-FromRequest%3C'r%3E-for-Shutdown) ### impl<'r> [FromRequest](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html "trait rocket::request::FromRequest") <'r> for [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") [Source](https://api.rocket.rs/v0.5/src/rocket/shutdown.rs.html#96) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The associated error to be returned if derivation fails. [Source](https://api.rocket.rs/v0.5/src/rocket/shutdown.rs.html#99-101) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.from_request) #### fn [from\_request](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#tymethod.from_request) <'life0, 'async\_trait>( request: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'r: 'async\_trait, 'life0: 'async\_trait, Derives an instance of `Self` from the incoming request metadata. [Read more](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#tymethod.from_request) [Source](https://api.rocket.rs/v0.5/src/rocket/shutdown.rs.html#104-110) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Future-for-Shutdown) ### impl [Future](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html "trait core::future::future::Future") for [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") [Source](https://api.rocket.rs/v0.5/src/rocket/shutdown.rs.html#105) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#associatedtype.Output) #### type [Output](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output) = [()](https://doc.rust-lang.org/nightly/std/primitive.unit.html) The type of value produced on completion. [Source](https://api.rocket.rs/v0.5/src/rocket/shutdown.rs.html#107-109) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.poll) #### fn [poll](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#tymethod.poll) (self: [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <&mut Self>, cx: &mut [Context](https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html "struct core::task::wake::Context") <'\_>) -> [Poll](https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html "enum core::task::poll::Poll") Attempts to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. [Read more](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#tymethod.poll) Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#synthetic-implementations) ---------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Freeze-for-Shutdown) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-RefUnwindSafe-for-Shutdown) ### impl ![RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Send-for-Shutdown) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Sync-for-Shutdown) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Unpin-for-Shutdown) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-UnwindSafe-for-Shutdown) ### impl ![UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#blanket-implementations) ----------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#547) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-CloneToUninit-for-T) ### impl [CloneToUninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html "trait core::clone::CloneToUninit") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#549) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.clone_to_uninit) #### unsafe fn [clone\_to\_uninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) (&self, dest: [\*mut](https://doc.rust-lang.org/nightly/std/primitive.pointer.html) [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) 🔬This is a nightly-only experimental API. (`clone_to_uninit`) Performs copy-assignment from `self` to `dest`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#119) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-FutureExt-for-T) ### impl [FutureExt](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html "trait futures_util::future::future::FutureExt") for T where T: [Future](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html "trait core::future::future::Future") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#146-149) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.map) #### fn [map](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.map) (self, f: F) -> [Map](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.Map.html "struct futures_util::future::future::Map") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (Self::[Output](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output "type core::future::future::Future::Output") ) -> U, Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Map this future’s output to a different type, returning a new future of the resulting type. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.map) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#159-162) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.map_into) #### fn [map\_into](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.map_into) (self) -> [MapInto](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.MapInto.html "struct futures_util::future::future::MapInto") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where Self::[Output](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output "type core::future::future::Future::Output") : [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Map this future’s output to a different type, returning a new future of the resulting type. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.map_into) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#191-195) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.then) #### fn [then](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.then) (self, f: F) -> [Then](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.Then.html "struct futures_util::future::future::Then") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (Self::[Output](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output "type core::future::future::Future::Output") ) -> Fut, Fut: [Future](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html "trait core::future::future::Future") , Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Chain on a computation for when a future finished, passing the result of the future to the provided closure `f`. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.then) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#222-225) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.left_future) #### fn [left\_future](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.left_future) (self) -> [Either](https://docs.rs/futures-util/0.3.31/futures_util/future/either/enum.Either.html "enum futures_util::future::either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where B: [Future](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html "trait core::future::future::Future") , Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Wrap this future in an `Either` future, making it the left-hand variant of that `Either`. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.left_future) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#252-255) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.right_future) #### fn [right\_future](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.right_future) (self) -> [Either](https://docs.rs/futures-util/0.3.31/futures_util/future/either/enum.Either.html "enum futures_util::future::either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where A: [Future](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html "trait core::future::future::Future") , Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Wrap this future in an `Either` future, making it the right-hand variant of that `Either`. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.right_future) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#278-280) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.into_stream) #### fn [into\_stream](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.into_stream) (self) -> [IntoStream](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.IntoStream.html "struct futures_util::future::future::IntoStream") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Convert this future into a single element stream. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.into_stream) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#307-310) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.flatten) #### fn [flatten](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.flatten) (self) -> [Flatten](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.Flatten.html "struct futures_util::future::future::Flatten") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where Self::[Output](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output "type core::future::future::Future::Output") : [Future](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html "trait core::future::future::Future") , Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Flatten the execution of this future when the output of this future is itself another future. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.flatten) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#341-344) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.flatten_stream) #### fn [flatten\_stream](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.flatten_stream) (self) -> [FlattenStream](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.FlattenStream.html "struct futures_util::future::future::FlattenStream") where Self::[Output](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output "type core::future::future::Future::Output") : [Stream](https://docs.rs/futures-core/0.3.31/futures_core/stream/trait.Stream.html "trait futures_core::stream::Stream") , Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Flatten the execution of this future when the successful result of this future is a stream. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.flatten_stream) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#365-367) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.fuse) #### fn [fuse](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.fuse) (self) -> [Fuse](https://docs.rs/futures-util/0.3.31/futures_util/future/future/fuse/struct.Fuse.html "struct futures_util::future::future::fuse::Fuse") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Fuse a future such that `poll` will never again be called once it has completed. This method can be used to turn any `Future` into a `FusedFuture`. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.fuse) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#391-394) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.inspect) #### fn [inspect](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.inspect) (self, f: F) -> [Inspect](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.Inspect.html "struct futures_util::future::future::Inspect") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self::[Output](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output "type core::future::future::Future::Output") ), Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Do something with the output of a future before passing it on. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.inspect) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#431-433) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.catch_unwind) #### fn [catch\_unwind](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.catch_unwind) (self) -> [CatchUnwind](https://docs.rs/futures-util/0.3.31/futures_util/future/future/catch_unwind/struct.CatchUnwind.html "struct futures_util::future::future::catch_unwind::CatchUnwind") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") + [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") , Available on **crate feature `std`** only. Catches unwinding panics while polling the future. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.catch_unwind) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#482-485) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.shared) #### fn [shared](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.shared) (self) -> [Shared](https://docs.rs/futures-util/0.3.31/futures_util/future/future/shared/struct.Shared.html "struct futures_util::future::future::shared::Shared") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Self::[Output](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output "type core::future::future::Future::Output") : [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , Available on **crate feature `std`** only. Create a cloneable handle to this future where all handles will resolve to the same result. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.shared) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#501-503) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.remote_handle) #### fn [remote\_handle](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.remote_handle) (self) -> ([Remote](https://docs.rs/futures-util/0.3.31/futures_util/future/future/remote_handle/struct.Remote.html "struct futures_util::future::future::remote_handle::Remote") , [RemoteHandle](https://docs.rs/futures-util/0.3.31/futures_util/future/future/remote_handle/struct.RemoteHandle.html "struct futures_util::future::future::remote_handle::RemoteHandle") ) where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Available on **crate features `channel` and `std`** only. Turn this future into a future that yields `()` on completion and sends its output to another future on a separate task. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.remote_handle) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#514-516) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.boxed) #### fn [boxed](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.boxed) <'a>(self) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a>> where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a, Available on **crate feature `alloc`** only. Wrap the future in a Box, pinning it. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.boxed) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#528-530) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.boxed_local) #### fn [boxed\_local](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.boxed_local) <'a>(self) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") + 'a>> where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") + 'a, Available on **crate feature `alloc`** only. Wrap the future in a Box, pinning it. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.boxed_local) [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#537-539) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.unit_error) #### fn [unit\_error](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.unit_error) (self) -> [UnitError](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.UnitError.html "struct futures_util::future::future::UnitError") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Turns a [`Future`](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html "trait core::future::future::Future") into a [`TryFuture](https://docs.rs/futures-core/0.3.31/futures_core/future/trait.TryFuture.html "trait futures_core::future::TryFuture") . [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#546-548) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.never_error) #### fn [never\_error](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.never_error) (self) -> [NeverError](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.NeverError.html "struct futures_util::future::future::NeverError") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Turns a [`Future`](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html "trait core::future::future::Future") into a [`TryFuture](https://docs.rs/futures-core/0.3.31/futures_core/future/trait.TryFuture.html "trait futures_core::future::TryFuture") . [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#554-556) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.poll_unpin) #### fn [poll\_unpin](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.poll_unpin) (&mut self, cx: &mut [Context](https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html "struct core::task::wake::Context") <'\_>) -> [Poll](https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html "enum core::task::poll::Poll") where Self: [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") , A convenience for calling `Future::poll` on `Unpin` future types. [Source](https://docs.rs/futures-util/0.3.31/src/futures_util/future/future/mod.rs.html#592-594) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.now_or_never) #### fn [now\_or\_never](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.now_or_never) (self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Evaluates and consumes the future, returning the resulting output if the future is ready after the first call to `Future::poll`. [Read more](https://docs.rs/futures-util/0.3.31/futures_util/future/future/trait.FutureExt.html#method.now_or_never) [Source](https://docs.rs/tokio-util/0.7.17/src/tokio_util/future.rs.html#137) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-FutureExt-for-T-1) ### impl [FutureExt](https://docs.rs/tokio-util/0.7.17/tokio_util/future/trait.FutureExt.html "trait tokio_util::future::FutureExt") for T where T: [Future](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html "trait core::future::future::Future") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/tokio-util/0.7.17/src/tokio_util/future.rs.html#89-94) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.with_cancellation_token) #### fn [with\_cancellation\_token](https://docs.rs/tokio-util/0.7.17/tokio_util/future/trait.FutureExt.html#method.with_cancellation_token) ( self, cancellation\_token: &[CancellationToken](https://docs.rs/tokio-util/0.7.17/tokio_util/sync/cancellation_token/struct.CancellationToken.html "struct tokio_util::sync::cancellation_token::CancellationToken") , ) -> WithCancellationTokenFuture<'\_, Self> where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Similar to [`CancellationToken::run_until_cancelled`](https://docs.rs/tokio-util/0.7.17/tokio_util/sync/cancellation_token/struct.CancellationToken.html#method.run_until_cancelled "method tokio_util::sync::cancellation_token::CancellationToken::run_until_cancelled") , but with the advantage that it is easier to write fluent call chains. [Read more](https://docs.rs/tokio-util/0.7.17/tokio_util/future/trait.FutureExt.html#method.with_cancellation_token) [Source](https://docs.rs/tokio-util/0.7.17/src/tokio_util/future.rs.html#126-131) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.with_cancellation_token_owned) #### fn [with\_cancellation\_token\_owned](https://docs.rs/tokio-util/0.7.17/tokio_util/future/trait.FutureExt.html#method.with_cancellation_token_owned) ( self, cancellation\_token: [CancellationToken](https://docs.rs/tokio-util/0.7.17/tokio_util/sync/cancellation_token/struct.CancellationToken.html "struct tokio_util::sync::cancellation_token::CancellationToken") , ) -> WithCancellationTokenFutureOwned where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Similar to [`CancellationToken::run_until_cancelled_owned`](https://docs.rs/tokio-util/0.7.17/tokio_util/sync/cancellation_token/struct.CancellationToken.html#method.run_until_cancelled_owned "method tokio_util::sync::cancellation_token::CancellationToken::run_until_cancelled_owned") , but with the advantage that it is easier to write fluent call chains. [Read more](https://docs.rs/tokio-util/0.7.17/tokio_util/future/trait.FutureExt.html#method.with_cancellation_token_owned) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://doc.rust-lang.org/nightly/src/core/future/into_future.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-IntoFuture-for-F) ### impl [IntoFuture](https://doc.rust-lang.org/nightly/core/future/into_future/trait.IntoFuture.html "trait core::future::into_future::IntoFuture") for F where F: [Future](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html "trait core::future::future::Future") , [Source](https://doc.rust-lang.org/nightly/src/core/future/into_future.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#associatedtype.Output-1) #### type [Output](https://doc.rust-lang.org/nightly/core/future/into_future/trait.IntoFuture.html#associatedtype.Output) = ::[Output](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output "type core::future::future::Future::Output") The output that the future will produce on completion. [Source](https://doc.rust-lang.org/nightly/src/core/future/into_future.rs.html#140) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#associatedtype.IntoFuture) #### type [IntoFuture](https://doc.rust-lang.org/nightly/core/future/into_future/trait.IntoFuture.html#associatedtype.IntoFuture) = F Which kind of future are we turning this into? [Source](https://doc.rust-lang.org/nightly/src/core/future/into_future.rs.html#142) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.into_future) #### fn [into\_future](https://doc.rust-lang.org/nightly/core/future/into_future/trait.IntoFuture.html#tymethod.into_future) (self) -> ::[IntoFuture](https://doc.rust-lang.org/nightly/core/future/into_future/trait.IntoFuture.html#associatedtype.IntoFuture "type core::future::into_future::IntoFuture::IntoFuture") Creates a future from a value. [Read more](https://doc.rust-lang.org/nightly/core/future/into_future/trait.IntoFuture.html#tymethod.into_future) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-1) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-2) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-3) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-4) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-5) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-6) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-7) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-8) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-9) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-10) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-11) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-12) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-13) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-14) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-15) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-16) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-17) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-18) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-19) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-20) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-21) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-22) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-23) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-24) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-25) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-26) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-27) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-28) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-29) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-30) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-31) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-32) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-33) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-34) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-35) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-36) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-37) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-38) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-39) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-40) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-41) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-42) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-43) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-44) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-45) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-46) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-47) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-48) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-49) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-50) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-51) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-52) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-53) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-54) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-55) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-56) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-57) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#example-58) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#associatedtype.Output-2) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-ToOwned-for-T) ### impl [ToOwned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html "trait alloc::borrow::ToOwned") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#associatedtype.Owned) #### type [Owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned) = T The resulting type after obtaining ownership. [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#90) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.to_owned) #### fn [to\_owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) (&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#94) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.clone_into) #### fn [clone\_into](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) (&self, target: [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) Uses borrowed data to replace owned data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#associatedtype.Error-2) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # catch in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [catch](https://api.rocket.rs/v0.5/rocket/attr.catch.html#) ------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro catch Copy item path ==================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#355) [Search](https://api.rocket.rs/v0.5/rocket/attr.catch?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[catch] Expand description Attribute to generate a [`Catcher`](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html) and associated metadata. This attribute can only be applied to free functions: use rocket::Request; use rocket::http::Status; #[catch(404)] fn not_found(req: &Request) -> String { format!("Sorry, {} does not exist.", req.uri()) } #[catch(default)] fn default(status: Status, req: &Request) -> String { format!("{} ({})", status, req.uri()) } [§](https://api.rocket.rs/v0.5/rocket/attr.catch.html#grammar) Grammar ---------------------------------------------------------------------- The grammar for the `#[catch]` attributes is defined as: catch := STATUS | 'default' STATUS := valid HTTP status code (integer in [200, 599]) [§](https://api.rocket.rs/v0.5/rocket/attr.catch.html#typing-requirements) Typing Requirements ---------------------------------------------------------------------------------------------- The decorated function may take zero, one, or two arguments. It’s type signature must be one of the following, where `R:`[`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) : * `fn() -> R` * `fn(`[`&Request`](https://api.rocket.rs/v0.5/rocket/struct.Request.html) `) -> R` * `fn(`[`Status`](https://api.rocket.rs/v0.5/rocket/http/struct.Status.html) `,` [`&Request`](https://api.rocket.rs/v0.5/rocket/struct.Request.html) `) -> R` [§](https://api.rocket.rs/v0.5/rocket/attr.catch.html#semantics) Semantics -------------------------------------------------------------------------- The attribute generates two items: 1. An error [`Handler`](https://api.rocket.rs/v0.5/rocket/catcher/trait.Handler.html) . The generated handler calls the decorated function, passing in the [`Status`](https://api.rocket.rs/v0.5/rocket/http/struct.Status.html) and [`&Request`](https://api.rocket.rs/v0.5/rocket/struct.Request.html) values if requested. The returned value is used to generate a [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) via the type’s [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) implementation. 2. A static structure used by [`catchers!`](https://api.rocket.rs/v0.5/rocket/macro.catchers.html) to generate a [`Catcher`](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html) . The static structure (and resulting [`Catcher`](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html) ) is populated with the name (the function’s name) and status code from the route attribute or `None` if `default`. The handler is set to the generated handler. --- # Response in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html#) -------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Struct Response Copy item path ============================== [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#487-492) [Search](https://api.rocket.rs/v0.5/rocket/struct.Response?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub struct Response<'r> { /* private fields */ } Expand description A response, as returned by types implementing [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") . See [`Builder`](https://api.rocket.rs/v0.5/rocket/response/struct.Builder.html "struct rocket::response::Builder") for docs on how a `Response` is typically created and the [module docs](https://api.rocket.rs/v0.5/rocket/response/index.html "mod rocket::response") for notes on composing responses ### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#upgrading) Upgrading A response may optionally register [`IoHandler`](https://api.rocket.rs/v0.5/rocket/data/trait.IoHandler.html "trait rocket::data::IoHandler") s for upgraded requests via [`Response::add_upgrade()`](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.add_upgrade "method rocket::Response::add_upgrade") or the corresponding builder method [`Builder::upgrade()`](https://api.rocket.rs/v0.5/rocket/response/struct.Builder.html#method.upgrade "method rocket::response::Builder::upgrade") . If the incoming request 1) requests an upgrade via a `Connection: Upgrade` header _and_ 2) includes a protocol in its `Upgrade` header that is registered by the returned `Response`, the connection will be upgraded. An upgrade response is sent to the client, and the registered `IoHandler` for the client’s preferred protocol is invoked with an [`IoStream`](https://api.rocket.rs/v0.5/rocket/data/struct.IoStream.html "struct rocket::data::IoStream") representing a raw byte stream to the client. Note that protocol names are treated case-insensitively during matching. If a connection is upgraded, Rocket automatically set the following in the upgrade response: * The response status to `101 Switching Protocols`. * The `Connection: Upgrade` header. * The `Upgrade` header’s value to the selected protocol. As such, a response **should never** set a `101` status nor the `Connection` or `Upgrade` headers: Rocket handles this automatically. Instead, it should set a status and headers to use in case the connection is not upgraded, either due to an error or because the client did not request an upgrade. If a connection _is not_ upgraded due to an error, even though there was a matching, registered protocol, the `IoHandler` is not invoked, and the original response is sent to the client without alteration. Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#implementations) ------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#494-1115) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-Response%3C'r%3E) ### impl<'r> [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'r> [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#513-515) #### pub fn [new](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.new) () -> [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'r> Creates a new, empty `Response` without a status, body, or headers. Because all HTTP responses must have a status, if a default `Response` is written to the client without a status, the status defaults to `200 Ok`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example) Example use rocket::Response; use rocket::http::Status; let mut response = Response::new(); assert_eq!(response.status(), Status::Ok); assert_eq!(response.headers().len(), 0); assert!(response.body().is_none()); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#528-530) #### pub fn [build](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.build) () -> [Builder](https://api.rocket.rs/v0.5/rocket/response/struct.Builder.html "struct rocket::response::Builder") <'r> Returns a `Builder` with a base of `Response::new()`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-1) Example use rocket::Response; let builder = Response::build(); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#544-546) #### pub fn [build\_from](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.build_from) (other: [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'r>) -> [Builder](https://api.rocket.rs/v0.5/rocket/response/struct.Builder.html "struct rocket::response::Builder") <'r> Returns a `Builder` with a base of `other`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-2) Example use rocket::Response; let other = Response::new(); let builder = Response::build_from(other); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#563-565) #### pub fn [status](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.status) (&self) -> [Status](https://api.rocket.rs/v0.5/rocket/http/struct.Status.html "struct rocket::http::Status") Returns the status of `self`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-3) Example use rocket::Response; use rocket::http::Status; let mut response = Response::new(); assert_eq!(response.status(), Status::Ok); response.set_status(Status::NotFound); assert_eq!(response.status(), Status::NotFound); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#580-582) #### pub fn [set\_status](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.set_status) (&mut self, status: [Status](https://api.rocket.rs/v0.5/rocket/http/struct.Status.html "struct rocket::http::Status") ) Sets the status of `self` to `status`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-4) Example use rocket::Response; use rocket::http::Status; let mut response = Response::new(); response.set_status(Status::ImATeapot); assert_eq!(response.status(), Status::ImATeapot); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#598-600) #### pub fn [content\_type](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.content_type) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[ContentType](https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html "struct rocket::http::ContentType") \> Returns the Content-Type header of `self`. If the header is not present or is malformed, returns `None`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-5) Example use rocket::Response; use rocket::http::ContentType; let mut response = Response::new(); response.set_header(ContentType::HTML); assert_eq!(response.content_type(), Some(ContentType::HTML)); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#616-620) #### pub fn [cookies](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.cookies) (&self) -> impl [Iterator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.Iterator.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::iter::Iterator") > Returns an iterator over the cookies in `self` as identified by the `Set-Cookie` header. Malformed cookies are skipped. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-6) Example use rocket::Response; use rocket::http::Cookie; let mut response = Response::new(); response.set_header(Cookie::new("hello", "world!")); let cookies: Vec<_> = response.cookies().collect(); assert_eq!(cookies, vec![Cookie::new("hello", "world!")]); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#640-642) #### pub fn [headers](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.headers) (&self) -> &[HeaderMap](https://api.rocket.rs/v0.5/rocket/http/struct.HeaderMap.html "struct rocket::http::HeaderMap") <'r> Returns a [`HeaderMap`](https://api.rocket.rs/v0.5/rocket/http/struct.HeaderMap.html "struct rocket::http::HeaderMap") of all of the headers in `self`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-7) Example use rocket::Response; use rocket::http::Header; let mut response = Response::new(); response.adjoin_raw_header("X-Custom", "1"); response.adjoin_raw_header("X-Custom", "2"); let mut custom_headers = response.headers().iter(); assert_eq!(custom_headers.next(), Some(Header::new("X-Custom", "1"))); assert_eq!(custom_headers.next(), Some(Header::new("X-Custom", "2"))); assert_eq!(custom_headers.next(), None); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#667-669) #### pub fn [set\_header](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.set_header) <'h: 'r, H: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Header](https://api.rocket.rs/v0.5/rocket/http/struct.Header.html "struct rocket::http::Header") <'h>>>(&mut self, header: H) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Sets the header `header` in `self`. Any existing headers with the name `header.name` will be lost, and only `header` will remain. The type of `header` can be any type that implements `Into

`. This includes `Header` itself, [`ContentType`](https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html "struct rocket::http::ContentType") and [`hyper::header` types](https://api.rocket.rs/v0.5/rocket/http/hyper/header/index.html "mod rocket::http::hyper::header") . ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-8) Example use rocket::Response; use rocket::http::ContentType; let mut response = Response::new(); response.set_header(ContentType::HTML); assert_eq!(response.headers().iter().next(), Some(ContentType::HTML.into())); assert_eq!(response.headers().len(), 1); response.set_header(ContentType::JSON); assert_eq!(response.headers().iter().next(), Some(ContentType::JSON.into())); assert_eq!(response.headers().len(), 1); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#693-697) #### pub fn [set\_raw\_header](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.set_raw_header) <'a: 'r, 'b: 'r, N, V>( &mut self, name: N, value: V, ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) where N: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow") <'a, [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) \>>, V: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow") <'b, [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) \>>, Sets the custom header with name `name` and value `value` in `self`. Any existing headers with the same `name` will be lost, and the new custom header will remain. This method should be used sparingly; prefer to use [set\_header](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.set_header) instead. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-9) Example use rocket::Response; use rocket::http::Header; let mut response = Response::new(); response.set_raw_header("X-Custom", "1"); assert_eq!(response.headers().get_one("X-Custom"), Some("1")); assert_eq!(response.headers().len(), 1); response.set_raw_header("X-Custom", "2"); assert_eq!(response.headers().get_one("X-Custom"), Some("2")); assert_eq!(response.headers().len(), 1); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#723-725) #### pub fn [adjoin\_header](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.adjoin_header) <'h: 'r, H: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Header](https://api.rocket.rs/v0.5/rocket/http/struct.Header.html "struct rocket::http::Header") <'h>>>(&mut self, header: H) Adds the header `header` to `self`. If `self` contains headers with the name `header.name`, another header with the same name and value `header.value` is added. The type of `header` can be any type that implements `Into
`. This includes `Header` itself, [`ContentType`](https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html "struct rocket::http::ContentType") and [`hyper::header` types](https://api.rocket.rs/v0.5/rocket/http/hyper/header/index.html "mod rocket::http::hyper::header") . ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-10) Example use rocket::Response; use rocket::http::Header; use rocket::http::hyper::header::ACCEPT; let mut response = Response::new(); response.adjoin_header(Header::new(ACCEPT.as_str(), "application/json")); response.adjoin_header(Header::new(ACCEPT.as_str(), "text/plain")); let mut accept_headers = response.headers().iter(); assert_eq!(accept_headers.next(), Some(Header::new(ACCEPT.as_str(), "application/json"))); assert_eq!(accept_headers.next(), Some(Header::new(ACCEPT.as_str(), "text/plain"))); assert_eq!(accept_headers.next(), None); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#750-754) #### pub fn [adjoin\_raw\_header](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.adjoin_raw_header) <'a: 'r, 'b: 'r, N, V>(&mut self, name: N, value: V) where N: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow") <'a, [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) \>>, V: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow") <'b, [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) \>>, Adds a custom header with name `name` and value `value` to `self`. If `self` already contains headers with the name `name`, another header with the same `name` and `value` is added. The type of `header` can be any type implements `Into
`. This includes `Header` itself, [`ContentType`](https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html "struct rocket::http::ContentType") and [`hyper::header` types](https://api.rocket.rs/v0.5/rocket/http/hyper/header/index.html "mod rocket::http::hyper::header") . ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-11) Example use rocket::Response; use rocket::http::Header; let mut response = Response::new(); response.adjoin_raw_header("X-Custom", "one"); response.adjoin_raw_header("X-Custom", "two"); let mut custom_headers = response.headers().iter(); assert_eq!(custom_headers.next(), Some(Header::new("X-Custom", "one"))); assert_eq!(custom_headers.next(), Some(Header::new("X-Custom", "two"))); assert_eq!(custom_headers.next(), None); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#774-776) #### pub fn [remove\_header](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.remove_header) (&mut self, name: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) ) Removes all headers with the name `name`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-12) Example use rocket::Response; let mut response = Response::new(); response.adjoin_raw_header("X-Custom", "one"); response.adjoin_raw_header("X-Custom", "two"); response.adjoin_raw_header("X-Other", "hi"); assert_eq!(response.headers().len(), 3); response.remove_header("X-Custom"); assert_eq!(response.headers().len(), 1); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#796-798) #### pub fn [body](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.body) (&self) -> &[Body](https://api.rocket.rs/v0.5/rocket/response/struct.Body.html "struct rocket::response::Body") <'r> Returns an immutable borrow of the body of `self`, if there is one. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-13) Example use std::io::Cursor; use rocket::Response; let mut response = Response::new(); assert!(response.body().is_none()); let string = "Hello, world!"; response.set_sized_body(string.len(), Cursor::new(string)); assert!(response.body().is_some()); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#857-859) #### pub fn [upgrade](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.upgrade) (&mut self, proto: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) ) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <&mut (dyn [IoHandler](https://api.rocket.rs/v0.5/rocket/data/trait.IoHandler.html "trait rocket::data::IoHandler") + 'r)>> Returns the [`IoHandler`](https://api.rocket.rs/v0.5/rocket/data/trait.IoHandler.html "trait rocket::data::IoHandler") for the protocol `proto`. Returns `Some` if such a handler was registered via [`Response::add_upgrade()`](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.add_upgrade "method rocket::Response::add_upgrade") or the corresponding builder method [`upgrade()`](https://api.rocket.rs/v0.5/rocket/response/struct.Builder.html#method.upgrade "method rocket::response::Builder::upgrade") . Otherwise returns `None`. use std::pin::Pin; use rocket::Response; use rocket::data::{IoHandler, IoStream}; use rocket::tokio::io; struct EchoHandler; #[rocket::async_trait] impl IoHandler for EchoHandler { async fn io(self: Pin>, io: IoStream) -> io::Result<()> { let (mut reader, mut writer) = io::split(io); io::copy(&mut reader, &mut writer).await?; Ok(()) } } let mut response = Response::new(); assert!(response.upgrade("raw-echo").is_none()); response.add_upgrade("raw-echo", EchoHandler); assert!(response.upgrade("raw-echo").is_some()); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#881-883) #### pub fn [body\_mut](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.body_mut) (&mut self) -> &mut [Body](https://api.rocket.rs/v0.5/rocket/response/struct.Body.html "struct rocket::response::Body") <'r> Returns a mutable borrow of the body of `self`, if there is one. A mutable borrow allows for reading the body. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-14) Example use std::io::Cursor; use rocket::Response; let mut response = Response::new(); assert!(response.body().is_none()); let string = "Hello, world!"; response.set_sized_body(string.len(), Cursor::new(string)); let string = response.body_mut().to_string().await; assert_eq!(string.unwrap(), "Hello, world!"); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#913-918) #### pub fn [set\_sized\_body](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.set_sized_body) (&mut self, size: S, body: B) where B: [AsyncRead](https://docs.rs/tokio/1.48.0/tokio/io/async_read/trait.AsyncRead.html "trait tokio::io::async_read::AsyncRead") + [AsyncSeek](https://docs.rs/tokio/1.48.0/tokio/io/async_seek/trait.AsyncSeek.html "trait tokio::io::async_seek::AsyncSeek") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'r, S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) \>>, Sets the body of `self` to be the fixed-sized `body` with size `size`, which may be `None`. If `size` is `None`, the body’s size will be computing with calls to `seek` just before being written out in a response. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-15) Example use std::io; use rocket::Response; let string = "Hello, world!"; let mut response = Response::new(); response.set_sized_body(string.len(), io::Cursor::new(string)); assert_eq!(response.body_mut().to_string().await?, "Hello, world!"); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#941-945) #### pub fn [set\_streamed\_body](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.set_streamed_body) (&mut self, body: B) where B: [AsyncRead](https://docs.rs/tokio/1.48.0/tokio/io/async_read/trait.AsyncRead.html "trait tokio::io::async_read::AsyncRead") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'r, Sets the body of `self` to `body`, which will be streamed. The max chunk size is configured via [`Response::set_max_chunk_size()`](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.set_max_chunk_size "method rocket::Response::set_max_chunk_size") and defaults to [`Body::DEFAULT_MAX_CHUNK`](https://api.rocket.rs/v0.5/rocket/response/struct.Body.html#associatedconstant.DEFAULT_MAX_CHUNK "associated constant rocket::response::Body::DEFAULT_MAX_CHUNK") . ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-16) Example use tokio::io::{repeat, AsyncReadExt}; use rocket::Response; let mut response = Response::new(); response.set_streamed_body(repeat(97).take(5)); assert_eq!(response.body_mut().to_string().await?, "aaaaa"); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#990-994) #### pub fn [add\_upgrade](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.add_upgrade) (&mut self, protocol: N, handler: H) where N: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Uncased](https://api.rocket.rs/v0.5/rocket/http/uncased/struct.Uncased.html "struct rocket::http::uncased::Uncased") <'r>>, H: [IoHandler](https://api.rocket.rs/v0.5/rocket/data/trait.IoHandler.html "trait rocket::data::IoHandler") + 'r, Registers `handler` as the I/O handler for upgrade protocol `protocol`. Responses registering I/O handlers for upgraded protocols **should not** set the response status to `101`, nor set the `Connection` or `Upgrade` headers. Rocket automatically sets these headers as needed. See [`Response`#upgrading](https://api.rocket.rs/v0.5/rocket/struct.Response.html#upgrading "struct rocket::Response") for details. If a handler was previously registered for `protocol`, this `handler` replaces it. If the connection is upgraded to `protocol`, the last `handler` registered for the protocol is used to handle the connection. See [`IoHandler`](https://api.rocket.rs/v0.5/rocket/data/trait.IoHandler.html "trait rocket::data::IoHandler") for details on implementing an I/O handler. For details on connection upgrading, see [`Response`#upgrading](https://api.rocket.rs/v0.5/rocket/struct.Response.html#upgrading "struct rocket::Response") . ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-17) Example use std::pin::Pin; use rocket::Response; use rocket::data::{IoHandler, IoStream}; use rocket::tokio::io; struct EchoHandler; #[rocket::async_trait] impl IoHandler for EchoHandler { async fn io(self: Pin>, io: IoStream) -> io::Result<()> { let (mut reader, mut writer) = io::split(io); io::copy(&mut reader, &mut writer).await?; Ok(()) } } let mut response = Response::new(); assert!(response.upgrade("raw-echo").is_none()); response.add_upgrade("raw-echo", EchoHandler); assert!(response.upgrade("raw-echo").is_some()); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#1022-1024) #### pub fn [set\_max\_chunk\_size](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.set_max_chunk_size) (&mut self, size: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) Sets the body’s maximum chunk size to `size` bytes. The default max chunk size is [`Body::DEFAULT_MAX_CHUNK`](https://api.rocket.rs/v0.5/rocket/response/struct.Body.html#associatedconstant.DEFAULT_MAX_CHUNK "associated constant rocket::response::Body::DEFAULT_MAX_CHUNK") . The max chunk size is a property of the body and is thus reset whenever a body is set via [`Response::set_streamed_body()`](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.set_streamed_body "method rocket::Response::set_streamed_body") , [`Response::set_sized_body()`](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.set_sized_body "method rocket::Response::set_sized_body") , or the corresponding builder methods. This setting does not typically need to be changed. Configuring a high value can result in high memory usage. Similarly, configuring a low value can result in excessive network writes. When unsure, leave the value unchanged. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-18) Example use tokio::io::{repeat, AsyncReadExt}; use rocket::Response; let mut response = Response::new(); response.set_streamed_body(repeat(97).take(5)); response.set_max_chunk_size(3072); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#1057-1069) #### pub fn [merge](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.merge) (&mut self, other: [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'r>) Replaces this response’s status and body with that of `other`, if they exist in `other`. Any headers that exist in `other` replace the ones in `self`. Any in `self` that aren’t in `other` remain in `self`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-19) Example use rocket::Response; use rocket::http::{Status, ContentType}; let base = Response::build() .status(Status::NotFound) .header(ContentType::HTML) .raw_header("X-Custom", "value 1") .finalize(); let response = Response::build() .status(Status::ImATeapot) .raw_header("X-Custom", "value 2") .raw_header_adjoin("X-Custom", "value 3") .merge(base) .finalize(); assert_eq!(response.status(), Status::NotFound); let ctype: Vec<_> = response.headers().get("Content-Type").collect(); assert_eq!(ctype, vec![ContentType::HTML.to_string()]); let custom_values: Vec<_> = response.headers().get("X-Custom").collect(); assert_eq!(custom_values, vec!["value 1"]); [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#1102-1114) #### pub fn [join](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.join) (&mut self, other: [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'r>) Sets `self`’s status and body to that of `other` if they are not already set in `self`. Any headers present in both `other` and `self` are adjoined. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-20) Example use rocket::Response; use rocket::http::{Status, ContentType}; let other = Response::build() .status(Status::NotFound) .header(ContentType::HTML) .raw_header("X-Custom", "value 1") .finalize(); let response = Response::build() .status(Status::ImATeapot) .raw_header("X-Custom", "value 2") .raw_header_adjoin("X-Custom", "value 3") .join(other) .finalize(); assert_eq!(response.status(), Status::ImATeapot); let ctype: Vec<_> = response.headers().get("Content-Type").collect(); assert_eq!(ctype, vec![ContentType::HTML.to_string()]); let custom_values: Vec<_> = response.headers().get("X-Custom").collect(); assert_eq!(custom_values, vec!["value 2", "value 3", "value 1"]); Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#trait-implementations) ------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#1117-1127) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-Debug-for-Response%3C'_%3E) ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") for [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'\_> [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#1118-1126) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.fmt) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#486) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-Default-for-Response%3C'r%3E) ### impl<'r> [Default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html "trait core::default::Default") for [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'r> [Source](https://api.rocket.rs/v0.5/src/rocket/response/response.rs.html#486) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.default) #### fn [default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default) () -> [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'r> Returns the “default value” for a type. [Read more](https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default) Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#synthetic-implementations) ---------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-Freeze-for-Response%3C'r%3E) ### impl<'r> [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-RefUnwindSafe-for-Response%3C'r%3E) ### impl<'r> ![RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-Send-for-Response%3C'r%3E) ### impl<'r> [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-Sync-for-Response%3C'r%3E) ### impl<'r> ![Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-Unpin-for-Response%3C'r%3E) ### impl<'r> [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-UnwindSafe-for-Response%3C'r%3E) ### impl<'r> ![UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html "struct rocket::Response") <'r> Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#blanket-implementations) ----------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Response.html#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Response.html#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Response.html#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Response.html#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-21) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-22) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-23) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-24) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-25) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-26) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-27) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-28) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-29) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-30) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-31) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-32) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-33) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-34) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-35) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-36) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-37) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-38) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-39) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-40) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-41) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-42) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-43) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-44) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-45) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-46) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-47) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-48) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-49) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-50) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-51) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-52) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-53) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-54) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-55) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-56) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-57) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-58) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-59) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-60) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-61) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-62) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-63) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-64) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-65) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-66) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-67) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-68) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-69) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-70) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-71) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-72) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-73) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-74) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-75) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-76) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-77) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-78) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#example-79) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.new-1) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Response.html#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Response.html#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # Request in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html#) ------------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Struct Request Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#28-34) [Search](https://api.rocket.rs/v0.5/rocket/struct.Request?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub struct Request<'r> { /* private fields */ } Expand description The type of an incoming web request. This should be used sparingly in Rocket applications. In particular, it should likely only be used when writing [`FromRequest`](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html "trait rocket::request::FromRequest") implementations. It contains all of the information for a given web request except for the body data. This includes the HTTP method, URI, cookies, headers, and more. Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#implementations) ------------------------------------------------------------------------------------------ [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#81-919) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-Request%3C'r%3E) ### impl<'r> [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'r> [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#123-125) #### pub fn [method](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.method) (&self) -> [Method](https://api.rocket.rs/v0.5/rocket/http/enum.Method.html "enum rocket::http::Method") Retrieve the method from `self`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example) Example use rocket::http::Method; assert_eq!(get("/").method(), Method::Get); assert_eq!(post("/").method(), Method::Post); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#143-145) #### pub fn [set\_method](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.set_method) (&mut self, method: [Method](https://api.rocket.rs/v0.5/rocket/http/enum.Method.html "enum rocket::http::Method") ) Set the method of `self` to `method`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-1) Example use rocket::http::Method; assert_eq!(request.method(), Method::Get); request.set_method(Method::Post); assert_eq!(request.method(), Method::Post); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#158-160) #### pub fn [uri](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.uri) (&self) -> &[Origin](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html "struct rocket::http::uri::Origin") <'r> Borrow the [`Origin`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html "struct rocket::http::uri::Origin") URI from `self`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-2) Example assert_eq!(get("/hello/rocketeer").uri().path(), "/hello/rocketeer"); assert_eq!(get("/hello").uri().query(), None); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#183-185) #### pub fn [set\_uri](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.set_uri) (&mut self, uri: [Origin](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html "struct rocket::http::uri::Origin") <'r>) Set the URI in `self` to `uri`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-3) Example use rocket::http::uri::Origin; let uri = Origin::parse("/hello/Sergio?type=greeting").unwrap(); request.set_uri(uri); assert_eq!(request.uri().path(), "/hello/Sergio"); assert_eq!(request.uri().query().unwrap(), "type=greeting"); let new_uri = request.uri().map_path(|p| format!("/foo{}", p)).unwrap(); request.set_uri(new_uri); assert_eq!(request.uri().path(), "/foo/hello/Sergio"); assert_eq!(request.uri().query().unwrap(), "type=greeting"); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#275-277) #### pub fn [host](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.host) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <&[Host](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Host.html "struct rocket::http::uri::Host") <'r>> Returns the [`Host`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Host.html "struct rocket::http::uri::Host") identified in the request, if any. If the request is made via HTTP/1.1 (or earlier), this method returns the value in the `HOST` header without the deprecated `user_info` component. Otherwise, this method returns the contents of the `:authority` pseudo-header request field. Note that this method _only_ reflects the `HOST` header in the _initial_ request and not any changes made thereafter. To change the value returned by this method, use [`Request::set_host()`](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.set_host "method rocket::Request::set_host") . ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#-danger-) ⚠️ DANGER ⚠️ Using the user-controlled `host` to construct URLs is a security hazard! _Never_ do so without first validating the host against a whitelist. For this reason, Rocket disallows constructing host-prefixed URIs with [`uri!`](https://api.rocket.rs/v0.5/rocket/macro.uri.html "macro rocket::uri") . _Always_ use [`uri!`](https://api.rocket.rs/v0.5/rocket/macro.uri.html "macro rocket::uri") to construct URIs. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-4) Example Retrieve the raw host, unusable to construct safe URIs: use rocket::http::uri::Host; assert_eq!(request.host(), None); request.set_host(Host::from(uri!("rocket.rs"))); let host = request.host().unwrap(); assert_eq!(host.domain(), "rocket.rs"); assert_eq!(host.port(), None); request.set_host(Host::from(uri!("rocket.rs:2392"))); let host = request.host().unwrap(); assert_eq!(host.domain(), "rocket.rs"); assert_eq!(host.port(), Some(2392)); Retrieve the raw host, check it against a whitelist, and construct a URI: use rocket::http::uri::Host; // A sensitive URI we want to prefix with safe hosts. #[get("/token?")] fn token(secret: Token) { /* .. */ } // Whitelist of known hosts. In a real setting, you might retrieve this // list from config at ignite-time using tools like `AdHoc::config()`. const WHITELIST: [Host<'static>; 3] = [\ Host::new(uri!("rocket.rs")),\ Host::new(uri!("rocket.rs:443")),\ Host::new(uri!("guide.rocket.rs:443")),\ ]; // A request with a host of "rocket.rs". Note the case-insensitivity. request.set_host(Host::from(uri!("ROCKET.rs"))); let prefix = request.host().and_then(|h| h.to_absolute("https", &WHITELIST)); // `rocket.rs` is in the whitelist, so we'll get back a `Some`. assert!(prefix.is_some()); if let Some(prefix) = prefix { // We can use this prefix to safely construct URIs. let uri = uri!(prefix, token("some-secret-token")); assert_eq!(uri, "https://ROCKET.rs/token?secret=some-secret-token"); } // A request with a host of "attacker-controlled.com". request.set_host(Host::from(uri!("attacker-controlled.com"))); let prefix = request.host().and_then(|h| h.to_absolute("https", &WHITELIST)); // `attacker-controlled.come` is _not_ on the whitelist. assert!(prefix.is_none()); assert!(request.host().is_some()); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#300-302) #### pub fn [set\_host](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.set_host) (&mut self, host: [Host](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Host.html "struct rocket::http::uri::Host") <'r>) Sets the host of `self` to `host`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-5) Example Set the host to `rocket.rs:443`. use rocket::http::uri::Host; assert_eq!(request.host(), None); request.set_host(Host::from(uri!("rocket.rs:443"))); let host = request.host().unwrap(); assert_eq!(host.domain(), "rocket.rs"); assert_eq!(host.port(), Some(443)); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#333-335) #### pub fn [remote](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.remote) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[SocketAddr](https://doc.rust-lang.org/nightly/core/net/socket_addr/enum.SocketAddr.html "enum core::net::socket_addr::SocketAddr") \> Returns the raw address of the remote connection that initiated this request if the address is known. If the address is not known, `None` is returned. Because it is common for proxies to forward connections for clients, the remote address may contain information about the proxy instead of the client. For this reason, proxies typically set a “X-Real-IP” header [`ip_header`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.ip_header "field rocket::Config::ip_header") with the client’s true IP. To extract this IP from the request, use the [`real_ip()`](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.real_ip) or [`client_ip()`](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.client_ip) methods. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-6) Example use std::net::{SocketAddrV4, Ipv4Addr}; assert_eq!(request.remote(), None); let localhost = SocketAddrV4::new(Ipv4Addr::LOCALHOST, 8000).into(); request.set_remote(localhost); assert_eq!(request.remote(), Some(localhost)); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#356-358) #### pub fn [set\_remote](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.set_remote) (&mut self, address: [SocketAddr](https://doc.rust-lang.org/nightly/core/net/socket_addr/enum.SocketAddr.html "enum core::net::socket_addr::SocketAddr") ) Sets the remote address of `self` to `address`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-7) Example Set the remote address to be 127.0.0.1:8000: use std::net::{SocketAddrV4, Ipv4Addr}; assert_eq!(request.remote(), None); let localhost = SocketAddrV4::new(Ipv4Addr::LOCALHOST, 8000).into(); request.set_remote(localhost); assert_eq!(request.remote(), Some(localhost)); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#378-387) #### pub fn [real\_ip](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.real_ip) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[IpAddr](https://doc.rust-lang.org/nightly/core/net/ip_addr/enum.IpAddr.html "enum core::net::ip_addr::IpAddr") \> Returns the IP address of the configured [`ip_header`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.ip_header "field rocket::Config::ip_header") of the request if such a header is configured, exists and contains a valid IP address. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-8) Example use std::net::Ipv4Addr; use rocket::http::Header; assert_eq!(req.real_ip(), None); // `ip_header` defaults to `X-Real-IP`. let req = req.header(Header::new("X-Real-IP", "127.0.0.1")); assert_eq!(req.real_ip(), Some(Ipv4Addr::LOCALHOST.into())); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#430-432) #### pub fn [client\_ip](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.client_ip) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[IpAddr](https://doc.rust-lang.org/nightly/core/net/ip_addr/enum.IpAddr.html "enum core::net::ip_addr::IpAddr") \> Attempts to return the client’s IP address by first inspecting the [`ip_header`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.ip_header "field rocket::Config::ip_header") and then using the remote connection’s IP address. Note that the built-in `IpAddr` request guard can be used to retrieve the same information in a handler: use std::net::IpAddr; #[get("/")] fn get_ip(client_ip: IpAddr) { /* ... */ } #[get("/")] fn try_get_ip(client_ip: Option) { /* ... */ } If the `ip_header` exists and contains a valid IP address, that address is returned. Otherwise, if the address of the remote connection is known, that address is returned. Otherwise, `None` is returned. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-9) Example // starting without an "X-Real-IP" header or remote address assert!(request.client_ip().is_none()); // add a remote address; this is done by Rocket automatically request.set_remote("127.0.0.1:8000".parse().unwrap()); assert_eq!(request.client_ip(), Some("127.0.0.1".parse().unwrap())); // now with an X-Real-IP header, the default value for `ip_header`. request.add_header(Header::new("X-Real-IP", "8.8.8.8")); assert_eq!(request.client_ip(), Some("8.8.8.8".parse().unwrap())); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#456-458) #### pub fn [cookies](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.cookies) (&self) -> &[CookieJar](https://api.rocket.rs/v0.5/rocket/http/struct.CookieJar.html "struct rocket::http::CookieJar") <'r> Returns a wrapped borrow to the cookies in `self`. [`CookieJar`](https://api.rocket.rs/v0.5/rocket/http/struct.CookieJar.html "struct rocket::http::CookieJar") implements internal mutability, so this method allows you to get _and_ add/remove cookies in `self`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-10) Example Add a new cookie to a request’s cookies: use rocket::http::Cookie; req.cookies().add(("key", "val")); req.cookies().add(("ans", format!("life: {}", 38 + 4))); assert_eq!(req.cookies().get_pending("key").unwrap().value(), "val"); assert_eq!(req.cookies().get_pending("ans").unwrap().value(), "life: 42"); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#475-477) #### pub fn [headers](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.headers) (&self) -> &[HeaderMap](https://api.rocket.rs/v0.5/rocket/http/struct.HeaderMap.html "struct rocket::http::HeaderMap") <'r> Returns a [`HeaderMap`](https://api.rocket.rs/v0.5/rocket/http/struct.HeaderMap.html "struct rocket::http::HeaderMap") of all of the headers in `self`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-11) Example use rocket::http::{Accept, ContentType}; assert!(get("/").headers().is_empty()); let req = get("/").header(Accept::HTML).header(ContentType::HTML); assert_eq!(req.headers().len(), 2); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#498-502) #### pub fn [add\_header](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.add_header) <'h: 'r, H: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Header](https://api.rocket.rs/v0.5/rocket/http/struct.Header.html "struct rocket::http::Header") <'h>>>(&mut self, header: H) Add `header` to `self`’s headers. The type of `header` can be any type that implements the `Into
` trait. This includes common types such as [`ContentType`](https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html "struct rocket::http::ContentType") and [`Accept`](https://api.rocket.rs/v0.5/rocket/http/struct.Accept.html "struct rocket::http::Accept") . ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-12) Example use rocket::http::ContentType; assert!(request.headers().is_empty()); request.add_header(ContentType::HTML); assert!(request.headers().contains("Content-Type")); assert_eq!(request.headers().len(), 1); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#527-531) #### pub fn [replace\_header](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.replace_header) <'h: 'r, H: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Header](https://api.rocket.rs/v0.5/rocket/http/struct.Header.html "struct rocket::http::Header") <'h>>>(&mut self, header: H) Replaces the value of the header with name `header.name` with `header.value`. If no such header exists, `header` is added as a header to `self`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-13) Example use rocket::http::ContentType; assert!(request.headers().is_empty()); request.add_header(ContentType::Any); assert_eq!(request.headers().get_one("Content-Type"), Some("*/*")); assert_eq!(request.content_type(), Some(&ContentType::Any)); request.replace_header(ContentType::PNG); assert_eq!(request.headers().get_one("Content-Type"), Some("image/png")); assert_eq!(request.content_type(), Some(&ContentType::PNG)); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#549-553) #### pub fn [content\_type](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.content_type) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <&[ContentType](https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html "struct rocket::http::ContentType") \> Returns the Content-Type header of `self`. If the header is not present, returns `None`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-14) Example use rocket::http::ContentType; assert_eq!(get("/").content_type(), None); let req = get("/").header(ContentType::JSON); assert_eq!(req.content_type(), Some(&ContentType::JSON)); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#569-573) #### pub fn [accept](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.accept) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <&[Accept](https://api.rocket.rs/v0.5/rocket/http/struct.Accept.html "struct rocket::http::Accept") \> Returns the Accept header of `self`. If the header is not present, returns `None`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-15) Example use rocket::http::Accept; assert_eq!(get("/").accept(), None); assert_eq!(get("/").header(Accept::JSON).accept(), Some(&Accept::JSON)); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#610-622) #### pub fn [format](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.format) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <&[MediaType](https://api.rocket.rs/v0.5/rocket/http/struct.MediaType.html "struct rocket::http::MediaType") \> Returns the media type “format” of the request. The “format” of a request is either the Content-Type, if the request methods indicates support for a payload, or the preferred media type in the Accept header otherwise. If the method indicates no payload and no Accept header is specified, a media type of `Any` is returned. The media type returned from this method is used to match against the `format` route attribute. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-16) Example use rocket::http::{Accept, ContentType, MediaType}; // Non-payload-bearing: format is accept header. let req = get("/").header(Accept::HTML); assert_eq!(req.format(), Some(&MediaType::HTML)); let req = get("/").header(ContentType::JSON).header(Accept::HTML); assert_eq!(req.format(), Some(&MediaType::HTML)); // Payload: format is content-type header. let req = post("/").header(ContentType::HTML); assert_eq!(req.format(), Some(&MediaType::HTML)); let req = post("/").header(ContentType::JSON).header(Accept::HTML); assert_eq!(req.format(), Some(&MediaType::JSON)); // Non-payload-bearing method and no accept header: `Any`. assert_eq!(get("/").format(), Some(&MediaType::Any)); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#643-645) #### pub fn [rocket](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.rocket) (&self) -> &'r [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") <[Orbit](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html "enum rocket::Orbit") \> Returns the [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") instance that is handling this request. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-17) Example // Retrieve the application config via `Rocket::config()`. let config = request.rocket().config(); // Retrieve managed state via `Rocket::state()`. let state = request.rocket().state::(); // Get a list of all of the registered routes and catchers. let routes = request.rocket().routes(); let catchers = request.rocket().catchers(); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#672-674) #### pub fn [limits](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.limits) (&self) -> &'r [Limits](https://api.rocket.rs/v0.5/rocket/data/struct.Limits.html "struct rocket::data::Limits") Returns the configured application data limits. This is convenience function equivalent to: &request.rocket().config().limits ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-18) Example use rocket::data::ToByteUnit; // This is the default `form` limit. assert_eq!(request.limits().get("form"), Some(32.kibibytes())); // Retrieve the limit for files with extension `.pdf`; etails to 1MiB. assert_eq!(request.limits().get("file/pdf"), Some(1.mebibytes())); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#690-692) #### pub fn [route](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.route) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <&'r [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") \> Get the presently matched route, if any. This method returns `Some` any time a handler or its guards are being invoked. This method returns `None` _before_ routing has commenced; this includes during request fairing callbacks. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-19) Example let route = request.route(); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#709-713) #### pub fn [guard](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.guard) <'z, 'a, T>(&'a self) -> [BoxFuture](https://docs.rs/futures-core/0.3.31/futures_core/future/type.BoxFuture.html "type futures_core::future::BoxFuture") <'z, [Outcome](https://api.rocket.rs/v0.5/rocket/request/type.Outcome.html "type rocket::request::Outcome") > where T: [FromRequest](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html "trait rocket::request::FromRequest") <'a> + 'z, 'a: 'z, 'r: 'z, Invokes the request guard implementation for `T`, returning its outcome. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-20) Example Assuming a `User` request guard exists, invoke it: let outcome = request.guard::().await; [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#741-750) #### pub fn [local\_cache](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.local_cache) (&self, f: F) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") () -> T, T: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") + 'static, Retrieves the cached value for type `T` from the request-local cached state of `self`. If no such value has previously been cached for this request, `f` is called to produce the value which is subsequently returned. Different values of the same type _cannot_ be cached without using a proxy, wrapper type. To avoid the need to write these manually, or for libraries wishing to store values of public types, use the [`local_cache!`](https://api.rocket.rs/v0.5/rocket/request/macro.local_cache.html "macro rocket::request::local_cache") or [`local_cache_once!`](https://api.rocket.rs/v0.5/rocket/request/macro.local_cache_once.html "macro rocket::request::local_cache_once") macros to generate a locally anonymous wrapper type, store, and retrieve the wrapped value from request-local cache. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-21) Example // The first store into local cache for a given type wins. let value = request.local_cache(|| "hello"); assert_eq!(*request.local_cache(|| "hello"), "hello"); // The following return the cached, previously stored value for the type. assert_eq!(*request.local_cache(|| "goodbye"), "hello"); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#775-786) #### pub async fn [local\_cache\_async](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.local_cache_async) <'a, T, F>(&'a self, fut: F) -> [&'a T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) where F: [Future](https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html "trait core::future::future::Future") , T: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") + 'static, Retrieves the cached value for type `T` from the request-local cached state of `self`. If no such value has previously been cached for this request, `fut` is `await`ed to produce the value which is subsequently returned. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-22) Example async fn current_user<'r>(request: &Request<'r>) -> User { // validate request for a given user, load from database, etc } let current_user = request.local_cache_async(async { current_user(&request).await }).await; [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#817-821) #### pub fn [param](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.param) <'a, T>(&'a self, n: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") > where T: [FromParam](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html "trait rocket::request::FromParam") <'a>, Retrieves and parses into `T` the 0-indexed `n`th non-empty segment from the _routed_ request, that is, the `n`th segment _after_ the mount point. If the request has not been routed, then this is simply the `n`th non-empty request URI segment. Returns `None` if `n` is greater than the number of non-empty segments. Returns `Some(Err(T::Error))` if the parameter type `T` failed to be parsed from the `n`th dynamic parameter. This method exists only to be used by manual routing. To retrieve parameters from a request, use Rocket’s code generation facilities. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-23) Example assert_eq!(get("/a/b/c").param(0), Some(Ok("a"))); assert_eq!(get("/a/b/c").param(1), Some(Ok("b"))); assert_eq!(get("/a/b/c").param(2), Some(Ok("c"))); assert_eq!(get("/a/b/c").param::<&str>(3), None); assert_eq!(get("/1/b/3").param(0), Some(Ok(1))); assert!(get("/1/b/3").param::(1).unwrap().is_err()); assert_eq!(get("/1/b/3").param(2), Some(Ok(3))); assert_eq!(get("/").param::<&str>(0), None); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#855-859) #### pub fn [segments](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.segments) <'a, T>(&'a self, n: [RangeFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.RangeFrom.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::ops::RangeFrom") <[usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) \>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") where T: [FromSegments](https://api.rocket.rs/v0.5/rocket/request/trait.FromSegments.html "trait rocket::request::FromSegments") <'a>, Retrieves and parses into `T` all of the path segments in the request URI beginning and including the 0-indexed `n`th non-empty segment _after_ the mount point.,that is, the `n`th segment _after_ the mount point. If the request has not been routed, then this is simply the `n`th non-empty request URI segment. `T` must implement [`FromSegments`](https://api.rocket.rs/v0.5/rocket/request/trait.FromSegments.html "trait rocket::request::FromSegments") , which is used to parse the segments. If there are no non-empty segments, the `Segments` iterator will be empty. This method exists only to be used by manual routing. To retrieve segments from a request, use Rocket’s code generation facilities. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-24) Example use std::path::PathBuf; assert_eq!(get("/").segments(0..), Ok(PathBuf::new())); assert_eq!(get("/").segments(2..), Ok(PathBuf::new())); // Empty segments are skipped. assert_eq!(get("///").segments(2..), Ok(PathBuf::new())); assert_eq!(get("/a/b/c").segments(0..), Ok(PathBuf::from("a/b/c"))); assert_eq!(get("/a/b/c").segments(1..), Ok(PathBuf::from("b/c"))); assert_eq!(get("/a/b/c").segments(2..), Ok(PathBuf::from("c"))); assert_eq!(get("/a/b/c").segments(3..), Ok(PathBuf::new())); assert_eq!(get("/a/b/c").segments(4..), Ok(PathBuf::new())); [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#904-918) #### pub fn [query\_value](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.query_value) <'a, T>(&'a self, name: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) ) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html "type rocket::form::Result") <'a, T>> where T: [FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") <'a>, Retrieves and parses into `T` the query value with field name `name`. `T` must implement [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html "trait rocket::form::FromForm") , which is used to parse the query’s value. Key matching is performed case-sensitively. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#warning) Warning This method exists _only_ to be used by manual routing and should _never_ be used in a regular Rocket application. It is much more expensive to use this method than to retrieve query parameters via Rocket’s codegen. To retrieve query values from a request, _always_ prefer to use Rocket’s code generation facilities. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#error) Error If a query segment with name `name` isn’t present, returns `None`. If parsing the value fails, returns `Some(Err(_))`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-25) Example use rocket::form::FromForm; #[derive(Debug, PartialEq, FromForm)] struct Dog<'r> { name: &'r str, age: usize } let req = get("/?a=apple&z=zebra&a=aardvark"); assert_eq!(req.query_value::<&str>("a").unwrap(), Ok("apple")); assert_eq!(req.query_value::<&str>("z").unwrap(), Ok("zebra")); assert_eq!(req.query_value::<&str>("b"), None); let a_seq = req.query_value::>("a"); assert_eq!(a_seq.unwrap().unwrap(), ["apple", "aardvark"]); let req = get("/?dog.name=Max+Fido&dog.age=3"); let dog = req.query_value::("dog"); assert_eq!(dog.unwrap().unwrap(), Dog { name: "Max Fido", age: 3 }); Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#trait-implementations) ------------------------------------------------------------------------------------------------------ [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#1094-1104) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-Debug-for-Request%3C'_%3E) ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") for [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_> [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#1095-1103) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.fmt) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) (&self, fmt: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#1106-1120) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-Display-for-Request%3C'_%3E) ### impl [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") for [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_> [Source](https://api.rocket.rs/v0.5/src/rocket/request/request.rs.html#1108-1119) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.fmt-1) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Pretty prints a Request. Primarily used by Rocket’s logging. Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#synthetic-implementations) --------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-Freeze-for-Request%3C'r%3E) ### impl<'r> ![Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-RefUnwindSafe-for-Request%3C'r%3E) ### impl<'r> ![RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-Send-for-Request%3C'r%3E) ### impl<'r> [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-Sync-for-Request%3C'r%3E) ### impl<'r> [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-Unpin-for-Request%3C'r%3E) ### impl<'r> [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'r> [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-UnwindSafe-for-Request%3C'r%3E) ### impl<'r> ![UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'r> Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#blanket-implementations) ---------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Request.html#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Request.html#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Request.html#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Request.html#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-26) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-27) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-28) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-29) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-30) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-31) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-32) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-33) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-34) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-35) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-36) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-37) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-38) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-39) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-40) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-41) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-42) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-43) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-44) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-45) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-46) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-47) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-48) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-49) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-50) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-51) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-52) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-53) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-54) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-55) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-56) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-57) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-58) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-59) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-60) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-61) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-62) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-63) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-64) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-65) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-66) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-67) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-68) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-69) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-70) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-71) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-72) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-73) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-74) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-75) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-76) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-77) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-78) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-79) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-80) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-81) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-82) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-83) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#example-84) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2861) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-ToString-for-T) ### impl [ToString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::string::ToString") for T where T: [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2863) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.to_string) #### fn [to\_string](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string) (&self) -> [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") Converts the given value to a `String`. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Request.html#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Request.html#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # delete in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [delete](https://api.rocket.rs/v0.5/rocket/attr.delete.html#) -------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro delete Copy item path ===================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#275) [Search](https://api.rocket.rs/v0.5/rocket/attr.delete?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[delete] Expand description Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. This and all other route attributes can only be applied to free functions: #[get("/")] fn index() -> &'static str { "Hello, world!" } There are 7 method-specific route attributes: * [`get`](https://api.rocket.rs/v0.5/rocket/attr.get.html) - `GET` specific route * [`put`](https://api.rocket.rs/v0.5/rocket/attr.put.html) - `PUT` specific route * [`post`](https://api.rocket.rs/v0.5/rocket/attr.post.html) - `POST` specific route * [`delete`](https://api.rocket.rs/v0.5/rocket/attr.delete.html) - `DELETE` specific route * [`head`](https://api.rocket.rs/v0.5/rocket/attr.head.html) - `HEAD` specific route * [`options`](https://api.rocket.rs/v0.5/rocket/attr.options.html) - `OPTIONS` specific route * [`patch`](https://api.rocket.rs/v0.5/rocket/attr.patch.html) - `PATCH` specific route Additionally, [`route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) allows the method and uri to be explicitly specified: #[route(GET, uri = "/")] fn index() -> &'static str { "Hello, world!" } [§](https://api.rocket.rs/v0.5/rocket/attr.delete.html#grammar) Grammar ----------------------------------------------------------------------- The grammar for all method-specific route attributes is defined as: route := '"' uri ('?' query)? '"' (',' parameter)* uri := ('/' segment)* query := segment ('&' segment)* segment := URI_SEG | SINGLE_PARAM | TRAILING_PARAM parameter := 'rank' '=' INTEGER | 'format' '=' '"' MEDIA_TYPE '"' | 'data' '=' '"' SINGLE_PARAM '"' SINGLE_PARAM := '<' IDENT '>' TRAILING_PARAM := '<' IDENT '..>' URI_SEG := valid, non-percent-encoded HTTP URI segment MEDIA_TYPE := valid HTTP media type or known shorthand INTEGER := unsigned integer, as defined by Rust IDENT := valid identifier, as defined by Rust The generic route attribute is defined as: generic-route := METHOD ',' 'uri' '=' route [§](https://api.rocket.rs/v0.5/rocket/attr.delete.html#typing-requirements) Typing Requirements ----------------------------------------------------------------------------------------------- Every identifier, except for `_`, that appears in a dynamic parameter (`SINGLE_PARAM` or `TRAILING_PARAM`) must appear as an argument to the function. For example, the following route requires the decorated function to have the arguments `foo`, `baz`, `msg`, `rest`, and `form`: #[get("//bar/?&closed&", data = "
")] The type of each function argument corresponding to a dynamic parameter is required to implement one of Rocket’s guard traits. The exact trait that is required to be implemented depends on the kind of dynamic parameter (`SINGLE` or `TRAILING`) and where in the route attribute the parameter appears. The table below summarizes trait requirements: | position | kind | trait | | --- | --- | --- | | path | `` | [`FromParam`](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html) | | path | `` | [`FromSegments`](https://api.rocket.rs/v0.5/rocket/request/trait.FromSegments.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | data | `` | [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) | The type of each function argument that _does not_ have a corresponding dynamic parameter is required to implement the [`FromRequest`](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html) trait. A route argument declared a `_` must _not_ appear in the function argument list and has no typing requirements. The return type of the decorated function must implement the [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) trait. [§](https://api.rocket.rs/v0.5/rocket/attr.delete.html#semantics) Semantics --------------------------------------------------------------------------- The attribute generates three items: 1. A route [`Handler`](https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html) . The generated handler validates and generates all arguments for the generated function according to the trait that their type must implement. The order in which arguments are processed is: 1. Request guards from left to right. If a request guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromRequest` Outcomes](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#outcomes) for further detail. 2. Path and query guards in an unspecified order. If a path or query guard fails, the request is forwarded. 3. Data guard, if any. If a data guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) for further detail. If all validation succeeds, the decorated function is called. The returned value is used to generate a [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) via the type’s [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) implementation. 2. A static structure used by [`routes!`](https://api.rocket.rs/v0.5/rocket/macro.routes.html) to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) . The static structure (and resulting [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) ) is populated with the name (the function’s name), path, query, rank, and format from the route attribute. The handler is set to the generated handler. 3. A macro used by [`uri!`](https://api.rocket.rs/v0.5/rocket/macro.uri.html) to type-check and generate an [`Origin`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html) . --- # launch in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [launch](https://api.rocket.rs/v0.5/rocket/attr.launch.html#) -------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro launch Copy item path ===================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#478) [Search](https://api.rocket.rs/v0.5/rocket/attr.launch?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[launch] Expand description Generates a `main` function that launches a returned `Rocket`. When applied to a function that returns a `Rocket` instance, `#[launch]` automatically initializes an `async` runtime and launches the function’s returned instance: use rocket::{Rocket, Build}; #[launch] fn rocket() -> Rocket { rocket::build() } This generates code equivalent to the following: #[rocket::main] async fn main() { // Recall that an uninspected `Error` will cause a pretty-printed panic, // so rest assured errors do not go undetected when using `#[launch]`. let _ = rocket().launch().await; } To avoid needing to import _any_ items in the common case, the `launch` attribute will infer a return type written as `_` as `Rocket`: #[launch] fn rocket() -> _ { rocket::build() } The attributed function may be `async`: #[launch] async fn rocket() -> _ { some_async_work().await; rocket::build() } --- # route in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [route](https://api.rocket.rs/v0.5/rocket/attr.route.html#) ------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro route Copy item path ==================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#275) [Search](https://api.rocket.rs/v0.5/rocket/attr.route?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[route] Expand description Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. This and all other route attributes can only be applied to free functions: #[get("/")] fn index() -> &'static str { "Hello, world!" } There are 7 method-specific route attributes: * [`get`](https://api.rocket.rs/v0.5/rocket/attr.get.html) - `GET` specific route * [`put`](https://api.rocket.rs/v0.5/rocket/attr.put.html) - `PUT` specific route * [`post`](https://api.rocket.rs/v0.5/rocket/attr.post.html) - `POST` specific route * [`delete`](https://api.rocket.rs/v0.5/rocket/attr.delete.html) - `DELETE` specific route * [`head`](https://api.rocket.rs/v0.5/rocket/attr.head.html) - `HEAD` specific route * [`options`](https://api.rocket.rs/v0.5/rocket/attr.options.html) - `OPTIONS` specific route * [`patch`](https://api.rocket.rs/v0.5/rocket/attr.patch.html) - `PATCH` specific route Additionally, [`route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) allows the method and uri to be explicitly specified: #[route(GET, uri = "/")] fn index() -> &'static str { "Hello, world!" } [§](https://api.rocket.rs/v0.5/rocket/attr.route.html#grammar) Grammar ---------------------------------------------------------------------- The grammar for all method-specific route attributes is defined as: route := '"' uri ('?' query)? '"' (',' parameter)* uri := ('/' segment)* query := segment ('&' segment)* segment := URI_SEG | SINGLE_PARAM | TRAILING_PARAM parameter := 'rank' '=' INTEGER | 'format' '=' '"' MEDIA_TYPE '"' | 'data' '=' '"' SINGLE_PARAM '"' SINGLE_PARAM := '<' IDENT '>' TRAILING_PARAM := '<' IDENT '..>' URI_SEG := valid, non-percent-encoded HTTP URI segment MEDIA_TYPE := valid HTTP media type or known shorthand INTEGER := unsigned integer, as defined by Rust IDENT := valid identifier, as defined by Rust The generic route attribute is defined as: generic-route := METHOD ',' 'uri' '=' route [§](https://api.rocket.rs/v0.5/rocket/attr.route.html#typing-requirements) Typing Requirements ---------------------------------------------------------------------------------------------- Every identifier, except for `_`, that appears in a dynamic parameter (`SINGLE_PARAM` or `TRAILING_PARAM`) must appear as an argument to the function. For example, the following route requires the decorated function to have the arguments `foo`, `baz`, `msg`, `rest`, and `form`: #[get("//bar/?&closed&", data = "")] The type of each function argument corresponding to a dynamic parameter is required to implement one of Rocket’s guard traits. The exact trait that is required to be implemented depends on the kind of dynamic parameter (`SINGLE` or `TRAILING`) and where in the route attribute the parameter appears. The table below summarizes trait requirements: | position | kind | trait | | --- | --- | --- | | path | `` | [`FromParam`](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html) | | path | `` | [`FromSegments`](https://api.rocket.rs/v0.5/rocket/request/trait.FromSegments.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | data | `` | [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) | The type of each function argument that _does not_ have a corresponding dynamic parameter is required to implement the [`FromRequest`](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html) trait. A route argument declared a `_` must _not_ appear in the function argument list and has no typing requirements. The return type of the decorated function must implement the [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) trait. [§](https://api.rocket.rs/v0.5/rocket/attr.route.html#semantics) Semantics -------------------------------------------------------------------------- The attribute generates three items: 1. A route [`Handler`](https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html) . The generated handler validates and generates all arguments for the generated function according to the trait that their type must implement. The order in which arguments are processed is: 1. Request guards from left to right. If a request guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromRequest` Outcomes](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#outcomes) for further detail. 2. Path and query guards in an unspecified order. If a path or query guard fails, the request is forwarded. 3. Data guard, if any. If a data guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) for further detail. If all validation succeeds, the decorated function is called. The returned value is used to generate a [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) via the type’s [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) implementation. 2. A static structure used by [`routes!`](https://api.rocket.rs/v0.5/rocket/macro.routes.html) to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) . The static structure (and resulting [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) ) is populated with the name (the function’s name), path, query, rank, and format from the route attribute. The handler is set to the generated handler. 3. A macro used by [`uri!`](https://api.rocket.rs/v0.5/rocket/macro.uri.html) to type-check and generate an [`Origin`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html) . --- # rocket::route - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module route](https://api.rocket.rs/v0.5/rocket/route/index.html#) -------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module route Copy item path =========================== [Source](https://api.rocket.rs/v0.5/src/rocket/route/mod.rs.html#1-12) [Search](https://api.rocket.rs/v0.5/rocket/route/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Types and traits for routes and their request handlers and return types. Structs[§](https://api.rocket.rs/v0.5/rocket/route/index.html#structs) ----------------------------------------------------------------------- [Route](https://api.rocket.rs/v0.5/rocket/route/struct.Route.html "struct rocket::route::Route") A request handling route. [RouteUri](https://api.rocket.rs/v0.5/rocket/route/struct.RouteUri.html "struct rocket::route::RouteUri") A route URI which is matched against requests. Traits[§](https://api.rocket.rs/v0.5/rocket/route/index.html#traits) --------------------------------------------------------------------- [Cloneable](https://api.rocket.rs/v0.5/rocket/route/trait.Cloneable.html "trait rocket::route::Cloneable") Helper trait to make a [`Route`](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") ’s `Box` `Clone`. [Handler](https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html "trait rocket::route::Handler") Trait implemented by [`Route`](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") request handlers. Type Aliases[§](https://api.rocket.rs/v0.5/rocket/route/index.html#types) -------------------------------------------------------------------------- [BoxFuture](https://api.rocket.rs/v0.5/rocket/route/type.BoxFuture.html "type rocket::route::BoxFuture") Type alias for the return type of a _raw_ [`Route`](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") ’s [`Handler`](https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html "trait rocket::route::Handler") . [Outcome](https://api.rocket.rs/v0.5/rocket/route/type.Outcome.html "type rocket::route::Outcome") Type alias for the return type of a [`Route`](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") ’s [`Handler::handle()`](https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html#tymethod.handle "method rocket::route::Handler::handle") . --- # Config in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html#) ---------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Struct Config Copy item path ============================ [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#60-138) [Search](https://api.rocket.rs/v0.5/rocket/struct.Config?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub struct Config {Show 15 fields pub profile: Profile, pub address: IpAddr, pub port: u16, pub workers: usize, pub max_blocking: usize, pub ident: Ident, pub ip_header: Option>, pub limits: Limits, pub temp_dir: RelativePathBuf, pub keep_alive: u32, pub tls: Option, pub secret_key: SecretKey, pub shutdown: Shutdown, pub log_level: LogLevel, pub cli_colors: bool, /* private fields */ } Expand description Rocket server configuration. See the [module level docs](https://api.rocket.rs/v0.5/rocket/config/index.html "mod rocket::config") as well as the [configuration guide](https://rocket.rs/v0.5/guide/configuration/) for further details. [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#defaults) Defaults --------------------------------------------------------------------------- All configuration values have a default, documented in the [fields](https://api.rocket.rs/v0.5/rocket/struct.Config.html#fields) section below. [`Config::debug_default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.debug_default "associated function rocket::Config::debug_default") returns the default values for the debug profile while [`Config::release_default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.release_default "associated function rocket::Config::release_default") the default values for the release profile. The [`Config::default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.default "associated function rocket::Config::default") method automatically selects the appropriate of the two based on the selected profile. With the exception of `log_level`, which is `normal` in `debug` and `critical` in `release`, and `secret_key`, which is regenerated from a random value if not set in “debug” mode only, all default values are identical in all profiles. [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#provider-details) Provider Details ------------------------------------------------------------------------------------------- `Config` is a Figment [`Provider`](https://docs.rs/figment/0.10.19/figment/provider/trait.Provider.html "trait figment::provider::Provider") with the following characteristics: * **Profile** The profile is set to the value of the `profile` field. * **Metadata** This provider is named `Rocket Config`. It does not specify a [`Source`](https://docs.rs/figment/0.10.19/figment/metadata/enum.Source.html "enum figment::metadata::Source") and uses default interpolation. * **Data** The data emitted by this provider are the keys and values corresponding to the fields and values of the structure. The dictionary is emitted to the “default” meta-profile. Note that these behaviors differ from those of [`Config::figment()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.figment "associated function rocket::Config::figment") . Fields[§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#fields) ----------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.profile) `profile: [Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") ` The selected profile. **(default: _debug_ `debug` / _release_ `release`)** _**Note:** This field is never serialized nor deserialized. When a `Config` is merged into a `Figment` as a `Provider`, this profile is selected on the `Figment`. When a `Config` is extracted, this field is set to the extracting Figment’s selected `Profile`._ [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.address) `address: [IpAddr](https://doc.rust-lang.org/nightly/core/net/ip_addr/enum.IpAddr.html "enum core::net::ip_addr::IpAddr") ` IP address to serve on. **(default: `127.0.0.1`)** [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.port) `port: [u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html) ` Port to serve on. **(default: `8000`)** [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.workers) `workers: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ` Number of threads to use for executing futures. **(default: `num_cores`)** _**Note:** Rocket only reads this value from sources in the [default provider](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.figment "associated function rocket::Config::figment") ._ [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.max_blocking) `max_blocking: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ` Limit on threads to start for blocking tasks. **(default: `512`)** [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.ident) `ident: [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") ` How, if at all, to identify the server via the `Server` header. **(default: `"Rocket"`)** [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.ip_header) `ip_header: [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[Uncased](https://api.rocket.rs/v0.5/rocket/http/uncased/struct.Uncased.html "struct rocket::http::uncased::Uncased") <'static>>` The name of a header, whose value is typically set by an intermediary server or proxy, which contains the real IP address of the connecting client. Used internally and by [`Request::client_ip()`](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.client_ip "method rocket::Request::client_ip") and [`Request::real_ip()`](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.real_ip "method rocket::Request::real_ip") . To disable using any header for this purpose, set this value to `false`. Deserialization semantics are identical to those of [`Ident`](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") except that the value must syntactically be a valid HTTP header name. **(default: `"X-Real-IP"`)** [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.limits) `limits: [Limits](https://api.rocket.rs/v0.5/rocket/data/struct.Limits.html "struct rocket::data::Limits") ` Streaming read size limits. **(default: [`Limits::default()`](https://api.rocket.rs/v0.5/rocket/data/struct.Limits.html#method.default "associated function rocket::data::Limits::default") )** [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.temp_dir) `temp_dir: [RelativePathBuf](https://docs.rs/figment/0.10.19/figment/value/magic/struct.RelativePathBuf.html "struct figment::value::magic::RelativePathBuf") ` Directory to store temporary files in. **(default: [`std::env::temp_dir()`](https://doc.rust-lang.org/nightly/std/env/fn.temp_dir.html "fn std::env::temp_dir") )** [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.keep_alive) `keep_alive: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ` Keep-alive timeout in seconds; disabled when `0`. **(default: `5`)** [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.tls) `tls: [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[TlsConfig](https://api.rocket.rs/v0.5/rocket/config/struct.TlsConfig.html "struct rocket::config::TlsConfig") >` Available on **crate feature `tls`** only. The TLS configuration, if any. **(default: `None`)** [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.secret_key) `secret_key: [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") ` Available on **crate feature `secrets`** only. The secret key for signing and encrypting. **(default: `0`)** _**Note:** This field _always_ serializes as a 256-bit array of `0`s to aid in preventing leakage of the secret key._ [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.shutdown) `shutdown: [Shutdown](https://api.rocket.rs/v0.5/rocket/config/struct.Shutdown.html "struct rocket::config::Shutdown") ` Graceful shutdown configuration. **(default: [`Shutdown::default()`](https://api.rocket.rs/v0.5/rocket/config/struct.Shutdown.html#method.default "associated function rocket::config::Shutdown::default") )** [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.log_level) `log_level: [LogLevel](https://api.rocket.rs/v0.5/rocket/config/enum.LogLevel.html "enum rocket::config::LogLevel") ` Max level to log. **(default: _debug_ `normal` / _release_ `critical`)** [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.cli_colors) `cli_colors: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ` Whether to use colors and emoji when logging. **(default: `true`)** Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#implementations) ----------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#158-469) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Config) ### impl [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#183-204) #### pub fn [debug\_default](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.debug_default) () -> [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Returns the default configuration for the `debug` profile, _irrespective of the Rust compilation profile_ and `ROCKET_PROFILE`. This may differ from the configuration used by default, [`Config::default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.default "associated function rocket::Config::default") , which is selected based on the Rust compilation profile. See [defaults](https://api.rocket.rs/v0.5/rocket/struct.Config.html#defaults) and [provider details](https://api.rocket.rs/v0.5/rocket/struct.Config.html#provider-details) for specifics. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example) Example use rocket::Config; let config = Config::debug_default(); [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#221-227) #### pub fn [release\_default](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.release_default) () -> [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Returns the default configuration for the `release` profile, _irrespective of the Rust compilation profile_ and `ROCKET_PROFILE`. This may differ from the configuration used by default, [`Config::default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.default "associated function rocket::Config::default") , which is selected based on the Rust compilation profile. See [defaults](https://api.rocket.rs/v0.5/rocket/struct.Config.html#defaults) and [provider details](https://api.rocket.rs/v0.5/rocket/struct.Config.html#provider-details) for specifics. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-1) Example use rocket::Config; let config = Config::release_default(); [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#257-262) #### pub fn [figment](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.figment) () -> [Figment](https://docs.rs/figment/0.10.19/figment/figment/struct.Figment.html "struct figment::figment::Figment") Returns the default provider figment used by [`rocket::build()`](https://api.rocket.rs/v0.5/rocket/fn.build.html "fn rocket::build") . The default figment reads from the following sources, in ascending priority order: 1. [`Config::default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.default "associated function rocket::Config::default") (see [defaults](https://api.rocket.rs/v0.5/rocket/struct.Config.html#defaults) ) 2. `Rocket.toml` _or_ filename in `ROCKET_CONFIG` environment variable 3. `ROCKET_` prefixed environment variables The profile selected is the value set in the `ROCKET_PROFILE` environment variable. If it is not set, it defaults to `debug` when compiled in debug mode and `release` when compiled in release mode. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-2) Example use rocket::Config; use serde::Deserialize; #[derive(Deserialize)] struct MyConfig { app_key: String, } let my_config = Config::figment().extract::(); [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#280-285) #### pub fn [try\_from](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.try_from) (provider: T) -> [Result](https://docs.rs/figment/0.10.19/figment/error/type.Result.html "type figment::error::Result") Attempts to extract a `Config` from `provider`, returning the result. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-3) Example use rocket::Config; use rocket::figment::providers::{Toml, Format, Env}; // Use Rocket's default `Figment`, but allow values from `MyApp.toml` // and `MY_APP_` prefixed environment variables to supersede its values. let figment = Config::figment() .merge(("some-thing", 123)) .merge(Env::prefixed("CONFIG_")); let config = Config::try_from(figment); [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#308-310) #### pub fn [from](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.from) (provider: T) -> Self Extract a `Config` from `provider`, panicking if extraction fails. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#panics) Panics If extraction fails, prints an error message indicating the error and panics. For a version that doesn’t panic, use [`Config::try_from()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.try_from "associated function rocket::Config::try_from") . ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-4) Example use rocket::Config; use rocket::figment::providers::{Toml, Format, Env}; // Use Rocket's default `Figment`, but allow values from `MyApp.toml` // and `MY_APP_` prefixed environment variables to supersede its values. let figment = Config::figment() .merge(Toml::file("MyApp.toml").nested()) .merge(Env::prefixed("MY_APP_")); let config = Config::from(figment); [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#329-335) #### pub fn [tls\_enabled](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.tls_enabled) (&self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if TLS is enabled. TLS is enabled when the `tls` feature is enabled and TLS has been configured with at least one ciphersuite. Note that without changing defaults, all supported ciphersuites are enabled in the recommended configuration. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-5) Example let config = rocket::Config::default(); if config.tls_enabled() { println!("TLS is enabled!"); } else { println!("TLS is disabled."); } [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#353-363) #### pub fn [mtls\_enabled](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.mtls_enabled) (&self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if mTLS is enabled. mTLS is enabled when TLS is enabled ([`Config::tls_enabled()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.tls_enabled "method rocket::Config::tls_enabled") ) _and_ the `mtls` feature is enabled _and_ mTLS has been configured with a CA certificate chain. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-6) Example let config = rocket::Config::default(); if config.mtls_enabled() { println!("mTLS is enabled!"); } else { println!("mTLS is disabled."); } [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#472-486) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Config-1) ### impl [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Associated constants for default profiles. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#474) #### pub const [DEBUG\_PROFILE](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.DEBUG_PROFILE) : [Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") The default debug profile: `debug`. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#477) #### pub const [RELEASE\_PROFILE](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.RELEASE_PROFILE) : [Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") The default release profile: `release`. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#481) #### pub const [DEFAULT\_PROFILE](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.DEFAULT_PROFILE) : [Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") = Self::DEBUG\_PROFILE Available on **debug-assertions enabled** only. The default profile: “debug” on `debug`, “release” on `release`. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#489-544) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Config-2) ### impl [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Associated constants for stringy versions of configuration parameters. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#496) #### pub const [ADDRESS](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.ADDRESS) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "address" The stringy parameter name for setting/extracting [`Config::address`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.address "field rocket::Config::address") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#499) #### pub const [PORT](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.PORT) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "port" The stringy parameter name for setting/extracting [`Config::port`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.port "field rocket::Config::port") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#502) #### pub const [WORKERS](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.WORKERS) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "workers" The stringy parameter name for setting/extracting [`Config::workers`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.workers "field rocket::Config::workers") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#505) #### pub const [MAX\_BLOCKING](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.MAX_BLOCKING) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "max\_blocking" The stringy parameter name for setting/extracting [`Config::max_blocking`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.max_blocking "field rocket::Config::max_blocking") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#508) #### pub const [KEEP\_ALIVE](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.KEEP_ALIVE) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "keep\_alive" The stringy parameter name for setting/extracting [`Config::keep_alive`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.keep_alive "field rocket::Config::keep_alive") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#511) #### pub const [IDENT](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.IDENT) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "ident" The stringy parameter name for setting/extracting [`Config::ident`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.ident "field rocket::Config::ident") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#514) #### pub const [IP\_HEADER](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.IP_HEADER) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "ip\_header" The stringy parameter name for setting/extracting [`Config::ip_header`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.ip_header "field rocket::Config::ip_header") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#517) #### pub const [LIMITS](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.LIMITS) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "limits" The stringy parameter name for setting/extracting [`Config::limits`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.limits "field rocket::Config::limits") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#520) #### pub const [TLS](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.TLS) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "tls" The stringy parameter name for setting/extracting [`Config::tls`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.tls "field rocket::Config::tls") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#523) #### pub const [SECRET\_KEY](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.SECRET_KEY) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "secret\_key" The stringy parameter name for setting/extracting [`Config::secret_key`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.secret_key "field rocket::Config::secret_key") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#526) #### pub const [TEMP\_DIR](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.TEMP_DIR) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "temp\_dir" The stringy parameter name for setting/extracting [`Config::temp_dir`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.temp_dir "field rocket::Config::temp_dir") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#529) #### pub const [LOG\_LEVEL](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.LOG_LEVEL) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "log\_level" The stringy parameter name for setting/extracting [`Config::log_level`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.log_level "field rocket::Config::log_level") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#532) #### pub const [SHUTDOWN](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.SHUTDOWN) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "shutdown" The stringy parameter name for setting/extracting [`Config::shutdown`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.shutdown "field rocket::Config::shutdown") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#535) #### pub const [CLI\_COLORS](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.CLI_COLORS) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "cli\_colors" The stringy parameter name for setting/extracting [`Config::cli_colors`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.cli_colors "field rocket::Config::cli_colors") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#538-543) #### pub const [PARAMETERS](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedconstant.PARAMETERS) : &'static \[&'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html)\ \] An array of all of the stringy parameter names. Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#trait-implementations) ----------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Clone-for-Config) ### impl [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.clone) #### fn [clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) (&self) -> [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#245-247) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.clone_from) #### fn [clone\_from](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) (&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Debug-for-Config) ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.fmt) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#140-156) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Default-for-Config) ### impl [Default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html "trait core::default::Default") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#152-155) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.default) #### fn [default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default) () -> [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Returns the default configuration based on the Rust compilation profile. This is [`Config::debug_default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.debug_default "associated function rocket::Config::debug_default") in `debug` and [`Config::release_default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.release_default "associated function rocket::Config::release_default") in `release`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-7) Example use rocket::Config; let config = Config::default(); [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Deserialize%3C'de%3E-for-Config) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.deserialize) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html#tymethod.deserialize) <\_\_D>(\_\_deserializer: \_\_D) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") where \_\_D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, Deserialize this value from the given Serde deserializer. [Read more](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html#tymethod.deserialize) [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#578-584) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-FromRequest%3C'r%3E-for-%26Config) ### impl<'r> [FromRequest](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html "trait rocket::request::FromRequest") <'r> for &'r [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#579) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The associated error to be returned if derivation fails. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#581-583) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.from_request) #### fn [from\_request](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#tymethod.from_request) <'life0, 'async\_trait>( req: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'r: 'async\_trait, 'life0: 'async\_trait, Derives an instance of `Self` from the incoming request metadata. [Read more](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#tymethod.from_request) [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-PartialEq-for-Config) ### impl [PartialEq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::PartialEq") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.eq) #### fn [eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html#tymethod.eq) (&self, other: &[Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `self` and `other` values to be equal, and is used by `==`. 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#264) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.ne) #### fn [ne](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html#method.ne) (&self, other: [&Rhs](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#546-575) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Provider-for-Config) ### impl [Provider](https://docs.rs/figment/0.10.19/figment/provider/trait.Provider.html "trait figment::provider::Provider") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#548-554) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.metadata) #### fn [metadata](https://docs.rs/figment/0.10.19/figment/provider/trait.Provider.html#tymethod.metadata) (&self) -> [Metadata](https://docs.rs/figment/0.10.19/figment/metadata/struct.Metadata.html "struct figment::metadata::Metadata") Returns the [`Metadata`](https://docs.rs/figment/0.10.19/figment/metadata/struct.Metadata.html "struct figment::metadata::Metadata") for this provider, identifying itself and its configuration sources. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#557-570) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.data) #### fn [data](https://docs.rs/figment/0.10.19/figment/provider/trait.Provider.html#tymethod.data) (&self) -> [Result](https://docs.rs/figment/0.10.19/figment/error/type.Result.html "type figment::error::Result") <[Map](https://docs.rs/figment/0.10.19/figment/value/value/type.Map.html "type figment::value::value::Map") <[Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") , [Dict](https://docs.rs/figment/0.10.19/figment/value/value/type.Dict.html "type figment::value::value::Dict") \>> Returns the configuration data. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#572-574) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.profile) #### fn [profile](https://docs.rs/figment/0.10.19/figment/provider/trait.Provider.html#method.profile) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") \> Optionally returns a profile to set on the [`Figment`](https://docs.rs/figment/0.10.19/figment/figment/struct.Figment.html "struct figment::figment::Figment") this provider is merged into. The profile is only set if `self` is _merged_. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Serialize-for-Config) ### impl [Serialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html "trait rocket::serde::Serialize") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.serialize) #### fn [serialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html#tymethod.serialize) <\_\_S>(&self, \_\_serializer: \_\_S) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <\_\_S::[Ok](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html#associatedtype.Ok "type rocket::serde::Serializer::Ok") , \_\_S::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html#associatedtype.Error "type rocket::serde::Serializer::Error") \> where \_\_S: [Serializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html "trait rocket::serde::Serializer") , Serialize this value into the given Serde serializer. [Read more](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html#tymethod.serialize) [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-StructuralPartialEq-for-Config) ### impl [StructuralPartialEq](https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html "trait core::marker::StructuralPartialEq") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#synthetic-implementations) -------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Freeze-for-Config) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-RefUnwindSafe-for-Config) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Send-for-Config) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Sync-for-Config) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Unpin-for-Config) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-UnwindSafe-for-Config) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#blanket-implementations) --------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#547) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-CloneToUninit-for-T) ### impl [CloneToUninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html "trait core::clone::CloneToUninit") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#549) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.clone_to_uninit) #### unsafe fn [clone\_to\_uninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) (&self, dest: [\*mut](https://doc.rust-lang.org/nightly/std/primitive.pointer.html) [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) 🔬This is a nightly-only experimental API. (`clone_to_uninit`) Performs copy-assignment from `self` to `dest`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.from-1) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Config.html#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Config.html#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Config.html#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Config.html#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-8) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-9) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-10) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-11) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-12) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-13) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-14) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-15) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-16) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-17) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-18) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-19) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-20) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-21) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-22) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-23) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-24) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-25) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-26) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-27) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-28) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-29) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-30) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-31) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-32) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-33) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-34) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-35) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-36) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-37) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-38) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-39) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-40) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-41) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-42) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-43) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-44) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-45) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-46) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-47) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-48) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-49) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-50) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-51) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-52) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-53) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-54) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-55) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-56) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-57) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-58) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-59) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-60) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-61) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-62) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-63) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-64) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-65) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#example-66) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-ToOwned-for-T) ### impl [ToOwned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html "trait alloc::borrow::ToOwned") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedtype.Owned) #### type [Owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned) = T The resulting type after obtaining ownership. [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#90) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.to_owned) #### fn [to\_owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) (&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#94) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.clone_into) #### fn [clone\_into](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) (&self, target: [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) Uses borrowed data to replace owned data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedtype.Error-2) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.try_from-1) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Config.html#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Config.html#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/mod.rs.html#633) [§](https://api.rocket.rs/v0.5/rocket/struct.Config.html#impl-DeserializeOwned-for-T) ### impl [DeserializeOwned](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned.html "trait rocket::serde::DeserializeOwned") for T where T: for<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, --- # FromForm in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [FromForm](https://api.rocket.rs/v0.5/rocket/derive.FromForm.html#) -------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Derive Macro FromForm Copy item path ==================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#746) [Search](https://api.rocket.rs/v0.5/rocket/derive.FromForm?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[derive(FromForm)] { // Attributes available to this derive: #[form] #[field] } Expand description Derive for the [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) trait. The [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) derive can be applied to structures with named or unnamed fields: use rocket::form::FromForm; #[derive(FromForm)] struct MyStruct<'r> { field: usize, #[field(name = "renamed_field")] #[field(name = uncased("RenamedField"))] other: &'r str, #[field(validate = range(1..), default = 3)] r#type: usize, #[field(default = None)] is_nice: bool, } #[derive(FromForm)] #[field(validate = len(6..))] #[field(validate = neq("password"))] struct Password<'r>(&'r str); Each field type is required to implement [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) . The derive generates an implementation of the [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) trait. **Named Fields** If the structure has named fields, the implementation parses a form whose field names match the field names of the structure on which the derive was applied. Each field’s value is parsed with the [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) implementation of the field’s type. The `FromForm` implementation succeeds only when all fields parse successfully or return a default. Errors are collected into a [`form::Errors`](https://api.rocket.rs/v0.5/rocket/form/struct.Errors.html) and returned if non-empty after parsing all fields. **Unnamed Fields** If the structure is a tuple struct, it must have exactly one field. The implementation parses a form exactly when the internal field parses a form _and_ any `#[field]` validations succeed. ### [§](https://api.rocket.rs/v0.5/rocket/derive.FromForm.html#syntax) Syntax The derive accepts one field attribute: `field`, and one container attribute, `form`, with the following syntax: field := name? default? validate* name := 'name' '=' name_val ','? name_val := '"' FIELD_NAME '"' | 'uncased(' '"' FIELD_NAME '"' ') default := 'default' '=' EXPR ','? | 'default_with' '=' EXPR ','? validate := 'validate' '=' EXPR ','? FIELD_NAME := valid field name, according to the HTML5 spec EXPR := valid expression, as defined by Rust `#[field]` can be applied any number of times on a field. `default` and `default_with` are mutually exclusive: at most _one_ of `default` or `default_with` can be present per field. #[derive(FromForm)] struct MyStruct { #[field(name = uncased("number"))] #[field(default = 42)] field: usize, #[field(name = "renamed_field")] #[field(name = uncased("anotherName"))] #[field(validate = eq("banana"))] #[field(validate = neq("orange"))] other: String } For tuples structs, the `field` attribute can be applied to the structure itself: #[derive(FromForm)] #[field(default = 42, validate = eq(42))] struct Meaning(usize); ### [§](https://api.rocket.rs/v0.5/rocket/derive.FromForm.html#field-attribute-parameters) Field Attribute Parameters * **`name`** A `name` attribute changes the name to match against when parsing the form field. The value is either an exact string to match against (`"foo"`), or `uncased("foo")`, which causes the match to be case-insensitive but case-preserving. When more than one `name` attribute is applied, the field will match against _any_ of the names. * **`validate = expr`** The validation `expr` is run if the field type parses successfully. The expression must return a value of type `Result<(), form::Errors>`. On `Err`, the errors are added to the thus-far collected errors. If more than one `validate` attribute is applied, _all_ validations are run. * **`default = expr`** If `expr` is not literally `None`, the parameter sets the default value of the field to be `expr.into()`. If `expr` _is_ `None`, the parameter _unsets_ the default value of the field, if any. The expression is only evaluated if the attributed field is missing in the incoming form. Except when `expr` is `None`, `expr` must be of type `T: Into` where `F` is the field’s type. * **`default_with = expr`** The parameter sets the default value of the field to be exactly `expr` which must be of type `Option` where `F` is the field’s type. If the expression evaluates to `None`, there is no default. Otherwise the value wrapped in `Some` is used. The expression is only evaluated if the attributed field is missing in the incoming form. use std::num::NonZeroUsize; #[derive(FromForm)] struct MyForm { // `NonZeroUsize::new()` return an `Option`. #[field(default_with = NonZeroUsize::new(42))] num: NonZeroUsize, } [§](https://api.rocket.rs/v0.5/rocket/derive.FromForm.html#generics) Generics ----------------------------------------------------------------------------- The derive accepts any number of type generics and at most one lifetime generic. If a type generic is present, the generated implementation will require a bound of `FromForm<'r>` for the field type containing the generic. For example, for a struct `struct Foo(Json)`, the bound `Json: FromForm<'r>` will be added to the generated implementation. use rocket::form::FromForm; use rocket::serde::json::Json; // The bounds `A: FromForm<'r>`, `B: FromForm<'r>` will be required. #[derive(FromForm)] struct FancyForm { first: A, second: B, }; // The bound `Json: FromForm<'r>` will be required. #[derive(FromForm)] struct JsonToken { token: Json, id: usize, } If a lifetime generic is present, it is replaced with `'r` in the generated implementation `impl FromForm<'r>`: // Generates `impl<'r> FromForm<'r> for MyWrapper<'r>`. #[derive(FromForm)] struct MyWrapper<'a>(&'a str); Both type generics and one lifetime generic may be used: use rocket::form::{self, FromForm}; // The bound `form::Result<'r, T>: FromForm<'r>` will be required. #[derive(FromForm)] struct SomeResult<'o, T>(form::Result<'o, T>); The special bounds on `Json` and `Result` are required due to incomplete and incorrect support for lifetime generics in `async` blocks in Rust. See [rust-lang/#64552](https://github.com/rust-lang/rust/issues/64552) for further details. --- # main in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [main](https://api.rocket.rs/v0.5/rocket/attr.main.html#) ---------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro main Copy item path =================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#419) [Search](https://api.rocket.rs/v0.5/rocket/attr.main?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[main] Expand description Retrofits `async fn` support in `main` functions. A `main` `async fn` function decorated with `#[rocket::main]` is transformed into a regular `main` function that internally initializes a Rocket-specific tokio runtime and runs the attributed `async fn` inside of it: #[rocket::main] async fn main() -> Result<(), rocket::Error> { let _rocket = rocket::build() .ignite().await? .launch().await?; Ok(()) } It should be used only when the return values of `ignite()` or `launch()` are to be inspected: #[rocket::main] async fn main() -> Result<(), rocket::Error> { let rocket = rocket::build().ignite().await?; println!("Hello, Rocket: {:?}", rocket); let rocket = rocket.launch().await?; println!("Welcome back, Rocket: {:?}", rocket); Ok(()) } For all other cases, use [`#[launch]`](https://api.rocket.rs/v0.5/rocket/launch) instead. The function attributed with `#[rocket::main]` _must_ be `async` and _must_ be called `main`. Violation of either results in a compile-time error. --- # uri in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [uri](https://api.rocket.rs/v0.5/rocket/macro.uri.html#) --------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Macro uri Copy item path ======================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#1469) [Search](https://api.rocket.rs/v0.5/rocket/macro.uri?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary uri!() { /* proc-macro */ } Expand description Type-safe, encoding-safe route and non-route URI generation. The `uri!` macro creates type-safe, URL-safe URIs given a route and concrete parameters for its URI or a URI string literal. [§](https://api.rocket.rs/v0.5/rocket/macro.uri.html#string-literal-parsing) String Literal Parsing --------------------------------------------------------------------------------------------------- Given a string literal as input, `uri!` parses the string using [`Uri::parse_any()`](https://api.rocket.rs/v0.5/rocket/http/uri/enum.Uri.html#method.parse_any) and emits a `'static`, `const` value whose type is one of [`Asterisk`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Asterisk.html) , [`Origin`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html) , [`Authority`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Authority.html) , [`Absolute`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Absolute.html) , or [`Reference`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Reference.html) , reflecting the parsed value. If the type allows normalization, the value is normalized before being emitted. Parse errors are caught and emitted at compile-time. The grammar for this variant of `uri!` is: uri := STRING STRING := an uncooked string literal, as defined by Rust (example: `"/hi"`) `STRING` is expected to be an undecoded URI of any variant. ### [§](https://api.rocket.rs/v0.5/rocket/macro.uri.html#examples) Examples use rocket::http::uri::Absolute; // Values returned from `uri!` are `const` and `'static`. const ROOT_CONST: Absolute<'static> = uri!("https://rocket.rs"); static ROOT_STATIC: Absolute<'static> = uri!("https://rocket.rs?root"); // Any variant can be parsed, but beware of ambiguities. let asterisk = uri!("*"); let origin = uri!("/foo/bar/baz"); let authority = uri!("rocket.rs:443"); let absolute = uri!("https://rocket.rs:443"); let reference = uri!("foo?bar#baz"); [§](https://api.rocket.rs/v0.5/rocket/macro.uri.html#type-safe-route-uris) Type-Safe Route URIs ----------------------------------------------------------------------------------------------- A URI to a route name `foo` is generated using `uri!(foo(v1, v2, v3))` or `uri!(foo(a = v1, b = v2, c = v3))`, where `v1`, `v2`, `v3` are the values to fill in for route parameters named `a`, `b`, and `c`. If the named parameter syntax is used (`a = v1`, etc.), parameters can appear in any order. More concretely, for the route `person` defined below: #[get("/person/?")] fn person(name: &str, age: Option) { } …a URI can be created as follows: // with unnamed parameters, in route path declaration order let mike = uri!(person("Mike Smith", Some(28))); assert_eq!(mike.to_string(), "/person/Mike%20Smith?age=28"); // with named parameters, order irrelevant let mike = uri!(person(name = "Mike", age = Some(28))); let mike = uri!(person(age = Some(28), name = "Mike")); assert_eq!(mike.to_string(), "/person/Mike?age=28"); // with unnamed values, explicitly `None`. let mike = uri!(person("Mike", None::)); assert_eq!(mike.to_string(), "/person/Mike"); // with named values, explicitly `None` let option: Option = None; let mike = uri!(person(name = "Mike", age = None::)); assert_eq!(mike.to_string(), "/person/Mike"); For optional query parameters, those of type `Option` or `Result`, a `_` can be used in-place of `None` or `Err`: // with named values ignored let mike = uri!(person(name = "Mike", age = _)); assert_eq!(mike.to_string(), "/person/Mike"); // with named values ignored let mike = uri!(person(age = _, name = "Mike")); assert_eq!(mike.to_string(), "/person/Mike"); // with unnamed values ignored let mike = uri!(person("Mike", _)); assert_eq!(mike.to_string(), "/person/Mike"); It is a type error to attempt to ignore query parameters that are neither `Option` or `Result`. Path parameters can never be ignored. A path parameter of type `Option` or `Result` must be filled by a value that can target a type of `T`: #[get("/person/")] fn maybe(name: Option<&str>) { } let bob1 = uri!(maybe(name = "Bob")); let bob2 = uri!(maybe("Bob Smith")); assert_eq!(bob1.to_string(), "/person/Bob"); assert_eq!(bob2.to_string(), "/person/Bob%20Smith"); #[get("/person/")] fn ok(age: Result) { } let kid1 = uri!(ok(age = 10)); let kid2 = uri!(ok(12)); assert_eq!(kid1.to_string(), "/person/10"); assert_eq!(kid2.to_string(), "/person/12"); Values for ignored route segments can be of any type as long as the type implements [`UriDisplay`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.UriDisplay.html) for the appropriate URI part. If a route URI contains ignored segments, the route URI invocation cannot use named arguments. #[get("/ignore/<_>/")] fn ignore(other: &str) { } let bob = uri!(ignore("Bob Hope", "hello")); let life = uri!(ignore(42, "cat&dog")); assert_eq!(bob.to_string(), "/ignore/Bob%20Hope/hello"); assert_eq!(life.to_string(), "/ignore/42/cat%26dog"); ### [§](https://api.rocket.rs/v0.5/rocket/macro.uri.html#prefixes-and-suffixes) Prefixes and Suffixes A route URI can be be optionally prefixed and/or suffixed by a URI generated from a string literal or an arbitrary expression. This takes the form `uri!(prefix, foo(v1, v2, v3), suffix)`, where both `prefix` and `suffix` are optional, and either `prefix` or `suffix` may be `_` to specify the value as empty. #[get("/person/?")] fn person(name: &str, age: Option) { } // with a specific mount-point of `/api`. let bob = uri!("/api", person("Bob", Some(28))); assert_eq!(bob.to_string(), "/api/person/Bob?age=28"); // with an absolute URI as a prefix let bob = uri!("https://rocket.rs", person("Bob", Some(28))); assert_eq!(bob.to_string(), "https://rocket.rs/person/Bob?age=28"); // with another absolute URI as a prefix let bob = uri!("https://rocket.rs/foo", person("Bob", Some(28))); assert_eq!(bob.to_string(), "https://rocket.rs/foo/person/Bob?age=28"); // with an expression as a prefix let host = uri!("http://bob.me"); let bob = uri!(host, person("Bob", Some(28))); assert_eq!(bob.to_string(), "http://bob.me/person/Bob?age=28"); // with a suffix but no prefix let bob = uri!(_, person("Bob", Some(28)), "#baz"); assert_eq!(bob.to_string(), "/person/Bob?age=28#baz"); // with both a prefix and suffix let bob = uri!("https://rocket.rs/", person("Bob", Some(28)), "#woo"); assert_eq!(bob.to_string(), "https://rocket.rs/person/Bob?age=28#woo"); // with an expression suffix. if the route URI already has a query, the // query part is ignored. otherwise it is added. let suffix = uri!("?woo#bam"); let bob = uri!(_, person("Bob", Some(28)), suffix.clone()); assert_eq!(bob.to_string(), "/person/Bob?age=28#bam"); let bob = uri!(_, person("Bob", None::), suffix.clone()); assert_eq!(bob.to_string(), "/person/Bob?woo#bam"); ### [§](https://api.rocket.rs/v0.5/rocket/macro.uri.html#grammar) Grammar The grammar for this variant of the `uri!` macro is: uri := (prefix ',')? route | prefix ',' route ',' suffix prefix := STRING | expr ; `Origin` or `Absolute` suffix := STRING | expr ; `Reference` or `Absolute` route := PATH '(' (named | unnamed) ')' named := IDENT = expr (',' named)? ','? unnamed := expr (',' unnamed)? ','? expr := EXPR | '_' EXPR := a valid Rust expression (examples: `foo()`, `12`, `"hey"`) IDENT := a valid Rust identifier (examples: `name`, `age`) STRING := an uncooked string literal, as defined by Rust (example: `"hi"`) PATH := a path, as defined by Rust (examples: `route`, `my_mod::route`) ### [§](https://api.rocket.rs/v0.5/rocket/macro.uri.html#dynamic-semantics) Dynamic Semantics The returned value is that of the prefix (minus any query part) concatenated with the route URI concatenated with the query (if the route has no query part) and fragment parts of the suffix. The route URI is generated by interpolating the declared route URI with the URL-safe version of the route values in `uri!()`. The generated URI is guaranteed to be URI-safe. Each route value is rendered in its appropriate place in the URI using the [`UriDisplay`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.UriDisplay.html) implementation for the value’s type. The `UriDisplay` implementation ensures that the rendered value is URL-safe. A `uri!()` invocation allocated at-most once. ### [§](https://api.rocket.rs/v0.5/rocket/macro.uri.html#static-semantics) Static Semantics The `uri!` macro returns one of [`Origin`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html) , [`Absolute`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Absolute.html) , or [`Reference`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Reference.html) , depending on the types of the prefix and suffix, if any. The table below specifies all combinations: | Prefix | Suffix | Output | | --- | --- | --- | | None | None | `Origin` | | None | `Absolute` | `Origin` | | None | `Reference` | `Reference` | | `Origin` | None | `Origin` | | `Origin` | `Absolute` | `Origin` | | `Origin` | `Reference` | `Reference` | | `Absolute` | None | `Absolute` | | `Absolute` | `Absolute` | `Absolute` | | `Absolute` | `Reference` | `Reference` | A `uri!` invocation only typechecks if the type of every route URI value in the invocation matches the type declared for the parameter in the given route, after conversion with [`FromUriParam`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.FromUriParam.html) , or if a value is ignored using `_` and the corresponding route type implements [`Ignorable`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.Ignorable.html) . #### [§](https://api.rocket.rs/v0.5/rocket/macro.uri.html#conversion) Conversion The [`FromUriParam`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.FromUriParam.html) trait is used to typecheck and perform a conversion for each value passed to `uri!`. If a `FromUriParam for T` implementation exists for a type `T` for part URI part `P`, then a value of type `S` can be used in `uri!` macro for a route URI parameter declared with a type of `T` in part `P`. For example, the following implementation, provided by Rocket, allows an `&str` to be used in a `uri!` invocation for route URI parameters declared as `String`: [ⓘ](https://api.rocket.rs/v0.5/rocket/macro.uri.html# "This example is not tested") impl FromUriParam for String { .. } #### [§](https://api.rocket.rs/v0.5/rocket/macro.uri.html#ignorables) Ignorables Query parameters can be ignored using `_` in place of an expression. The corresponding type in the route URI must implement [`Ignorable`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.Ignorable.html) . Ignored parameters are not interpolated into the resulting `Origin`. Path parameters are not ignorable. --- # get in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [get](https://api.rocket.rs/v0.5/rocket/attr.get.html#) -------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro get Copy item path ================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#275) [Search](https://api.rocket.rs/v0.5/rocket/attr.get?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[get] Expand description Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. This and all other route attributes can only be applied to free functions: #[get("/")] fn index() -> &'static str { "Hello, world!" } There are 7 method-specific route attributes: * [`get`](https://api.rocket.rs/v0.5/rocket/attr.get.html) - `GET` specific route * [`put`](https://api.rocket.rs/v0.5/rocket/attr.put.html) - `PUT` specific route * [`post`](https://api.rocket.rs/v0.5/rocket/attr.post.html) - `POST` specific route * [`delete`](https://api.rocket.rs/v0.5/rocket/attr.delete.html) - `DELETE` specific route * [`head`](https://api.rocket.rs/v0.5/rocket/attr.head.html) - `HEAD` specific route * [`options`](https://api.rocket.rs/v0.5/rocket/attr.options.html) - `OPTIONS` specific route * [`patch`](https://api.rocket.rs/v0.5/rocket/attr.patch.html) - `PATCH` specific route Additionally, [`route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) allows the method and uri to be explicitly specified: #[route(GET, uri = "/")] fn index() -> &'static str { "Hello, world!" } [§](https://api.rocket.rs/v0.5/rocket/attr.get.html#grammar) Grammar -------------------------------------------------------------------- The grammar for all method-specific route attributes is defined as: route := '"' uri ('?' query)? '"' (',' parameter)* uri := ('/' segment)* query := segment ('&' segment)* segment := URI_SEG | SINGLE_PARAM | TRAILING_PARAM parameter := 'rank' '=' INTEGER | 'format' '=' '"' MEDIA_TYPE '"' | 'data' '=' '"' SINGLE_PARAM '"' SINGLE_PARAM := '<' IDENT '>' TRAILING_PARAM := '<' IDENT '..>' URI_SEG := valid, non-percent-encoded HTTP URI segment MEDIA_TYPE := valid HTTP media type or known shorthand INTEGER := unsigned integer, as defined by Rust IDENT := valid identifier, as defined by Rust The generic route attribute is defined as: generic-route := METHOD ',' 'uri' '=' route [§](https://api.rocket.rs/v0.5/rocket/attr.get.html#typing-requirements) Typing Requirements -------------------------------------------------------------------------------------------- Every identifier, except for `_`, that appears in a dynamic parameter (`SINGLE_PARAM` or `TRAILING_PARAM`) must appear as an argument to the function. For example, the following route requires the decorated function to have the arguments `foo`, `baz`, `msg`, `rest`, and `form`: #[get("//bar/?&closed&", data = "")] The type of each function argument corresponding to a dynamic parameter is required to implement one of Rocket’s guard traits. The exact trait that is required to be implemented depends on the kind of dynamic parameter (`SINGLE` or `TRAILING`) and where in the route attribute the parameter appears. The table below summarizes trait requirements: | position | kind | trait | | --- | --- | --- | | path | `` | [`FromParam`](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html) | | path | `` | [`FromSegments`](https://api.rocket.rs/v0.5/rocket/request/trait.FromSegments.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | data | `` | [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) | The type of each function argument that _does not_ have a corresponding dynamic parameter is required to implement the [`FromRequest`](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html) trait. A route argument declared a `_` must _not_ appear in the function argument list and has no typing requirements. The return type of the decorated function must implement the [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) trait. [§](https://api.rocket.rs/v0.5/rocket/attr.get.html#semantics) Semantics ------------------------------------------------------------------------ The attribute generates three items: 1. A route [`Handler`](https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html) . The generated handler validates and generates all arguments for the generated function according to the trait that their type must implement. The order in which arguments are processed is: 1. Request guards from left to right. If a request guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromRequest` Outcomes](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#outcomes) for further detail. 2. Path and query guards in an unspecified order. If a path or query guard fails, the request is forwarded. 3. Data guard, if any. If a data guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) for further detail. If all validation succeeds, the decorated function is called. The returned value is used to generate a [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) via the type’s [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) implementation. 2. A static structure used by [`routes!`](https://api.rocket.rs/v0.5/rocket/macro.routes.html) to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) . The static structure (and resulting [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) ) is populated with the name (the function’s name), path, query, rank, and format from the route attribute. The handler is set to the generated handler. 3. A macro used by [`uri!`](https://api.rocket.rs/v0.5/rocket/macro.uri.html) to type-check and generate an [`Origin`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html) . --- # head in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [head](https://api.rocket.rs/v0.5/rocket/attr.head.html#) ---------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro head Copy item path =================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#275) [Search](https://api.rocket.rs/v0.5/rocket/attr.head?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[head] Expand description Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. This and all other route attributes can only be applied to free functions: #[get("/")] fn index() -> &'static str { "Hello, world!" } There are 7 method-specific route attributes: * [`get`](https://api.rocket.rs/v0.5/rocket/attr.get.html) - `GET` specific route * [`put`](https://api.rocket.rs/v0.5/rocket/attr.put.html) - `PUT` specific route * [`post`](https://api.rocket.rs/v0.5/rocket/attr.post.html) - `POST` specific route * [`delete`](https://api.rocket.rs/v0.5/rocket/attr.delete.html) - `DELETE` specific route * [`head`](https://api.rocket.rs/v0.5/rocket/attr.head.html) - `HEAD` specific route * [`options`](https://api.rocket.rs/v0.5/rocket/attr.options.html) - `OPTIONS` specific route * [`patch`](https://api.rocket.rs/v0.5/rocket/attr.patch.html) - `PATCH` specific route Additionally, [`route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) allows the method and uri to be explicitly specified: #[route(GET, uri = "/")] fn index() -> &'static str { "Hello, world!" } [§](https://api.rocket.rs/v0.5/rocket/attr.head.html#grammar) Grammar --------------------------------------------------------------------- The grammar for all method-specific route attributes is defined as: route := '"' uri ('?' query)? '"' (',' parameter)* uri := ('/' segment)* query := segment ('&' segment)* segment := URI_SEG | SINGLE_PARAM | TRAILING_PARAM parameter := 'rank' '=' INTEGER | 'format' '=' '"' MEDIA_TYPE '"' | 'data' '=' '"' SINGLE_PARAM '"' SINGLE_PARAM := '<' IDENT '>' TRAILING_PARAM := '<' IDENT '..>' URI_SEG := valid, non-percent-encoded HTTP URI segment MEDIA_TYPE := valid HTTP media type or known shorthand INTEGER := unsigned integer, as defined by Rust IDENT := valid identifier, as defined by Rust The generic route attribute is defined as: generic-route := METHOD ',' 'uri' '=' route [§](https://api.rocket.rs/v0.5/rocket/attr.head.html#typing-requirements) Typing Requirements --------------------------------------------------------------------------------------------- Every identifier, except for `_`, that appears in a dynamic parameter (`SINGLE_PARAM` or `TRAILING_PARAM`) must appear as an argument to the function. For example, the following route requires the decorated function to have the arguments `foo`, `baz`, `msg`, `rest`, and `form`: #[get("//bar/?&closed&", data = "")] The type of each function argument corresponding to a dynamic parameter is required to implement one of Rocket’s guard traits. The exact trait that is required to be implemented depends on the kind of dynamic parameter (`SINGLE` or `TRAILING`) and where in the route attribute the parameter appears. The table below summarizes trait requirements: | position | kind | trait | | --- | --- | --- | | path | `` | [`FromParam`](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html) | | path | `` | [`FromSegments`](https://api.rocket.rs/v0.5/rocket/request/trait.FromSegments.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | data | `` | [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) | The type of each function argument that _does not_ have a corresponding dynamic parameter is required to implement the [`FromRequest`](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html) trait. A route argument declared a `_` must _not_ appear in the function argument list and has no typing requirements. The return type of the decorated function must implement the [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) trait. [§](https://api.rocket.rs/v0.5/rocket/attr.head.html#semantics) Semantics ------------------------------------------------------------------------- The attribute generates three items: 1. A route [`Handler`](https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html) . The generated handler validates and generates all arguments for the generated function according to the trait that their type must implement. The order in which arguments are processed is: 1. Request guards from left to right. If a request guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromRequest` Outcomes](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#outcomes) for further detail. 2. Path and query guards in an unspecified order. If a path or query guard fails, the request is forwarded. 3. Data guard, if any. If a data guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) for further detail. If all validation succeeds, the decorated function is called. The returned value is used to generate a [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) via the type’s [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) implementation. 2. A static structure used by [`routes!`](https://api.rocket.rs/v0.5/rocket/macro.routes.html) to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) . The static structure (and resulting [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) ) is populated with the name (the function’s name), path, query, rank, and format from the route attribute. The handler is set to the generated handler. 3. A macro used by [`uri!`](https://api.rocket.rs/v0.5/rocket/macro.uri.html) to type-check and generate an [`Origin`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html) . --- # options in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [options](https://api.rocket.rs/v0.5/rocket/attr.options.html#) ---------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro options Copy item path ====================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#275) [Search](https://api.rocket.rs/v0.5/rocket/attr.options?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[options] Expand description Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. This and all other route attributes can only be applied to free functions: #[get("/")] fn index() -> &'static str { "Hello, world!" } There are 7 method-specific route attributes: * [`get`](https://api.rocket.rs/v0.5/rocket/attr.get.html) - `GET` specific route * [`put`](https://api.rocket.rs/v0.5/rocket/attr.put.html) - `PUT` specific route * [`post`](https://api.rocket.rs/v0.5/rocket/attr.post.html) - `POST` specific route * [`delete`](https://api.rocket.rs/v0.5/rocket/attr.delete.html) - `DELETE` specific route * [`head`](https://api.rocket.rs/v0.5/rocket/attr.head.html) - `HEAD` specific route * [`options`](https://api.rocket.rs/v0.5/rocket/attr.options.html) - `OPTIONS` specific route * [`patch`](https://api.rocket.rs/v0.5/rocket/attr.patch.html) - `PATCH` specific route Additionally, [`route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) allows the method and uri to be explicitly specified: #[route(GET, uri = "/")] fn index() -> &'static str { "Hello, world!" } [§](https://api.rocket.rs/v0.5/rocket/attr.options.html#grammar) Grammar ------------------------------------------------------------------------ The grammar for all method-specific route attributes is defined as: route := '"' uri ('?' query)? '"' (',' parameter)* uri := ('/' segment)* query := segment ('&' segment)* segment := URI_SEG | SINGLE_PARAM | TRAILING_PARAM parameter := 'rank' '=' INTEGER | 'format' '=' '"' MEDIA_TYPE '"' | 'data' '=' '"' SINGLE_PARAM '"' SINGLE_PARAM := '<' IDENT '>' TRAILING_PARAM := '<' IDENT '..>' URI_SEG := valid, non-percent-encoded HTTP URI segment MEDIA_TYPE := valid HTTP media type or known shorthand INTEGER := unsigned integer, as defined by Rust IDENT := valid identifier, as defined by Rust The generic route attribute is defined as: generic-route := METHOD ',' 'uri' '=' route [§](https://api.rocket.rs/v0.5/rocket/attr.options.html#typing-requirements) Typing Requirements ------------------------------------------------------------------------------------------------ Every identifier, except for `_`, that appears in a dynamic parameter (`SINGLE_PARAM` or `TRAILING_PARAM`) must appear as an argument to the function. For example, the following route requires the decorated function to have the arguments `foo`, `baz`, `msg`, `rest`, and `form`: #[get("//bar/?&closed&", data = "")] The type of each function argument corresponding to a dynamic parameter is required to implement one of Rocket’s guard traits. The exact trait that is required to be implemented depends on the kind of dynamic parameter (`SINGLE` or `TRAILING`) and where in the route attribute the parameter appears. The table below summarizes trait requirements: | position | kind | trait | | --- | --- | --- | | path | `` | [`FromParam`](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html) | | path | `` | [`FromSegments`](https://api.rocket.rs/v0.5/rocket/request/trait.FromSegments.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | data | `` | [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) | The type of each function argument that _does not_ have a corresponding dynamic parameter is required to implement the [`FromRequest`](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html) trait. A route argument declared a `_` must _not_ appear in the function argument list and has no typing requirements. The return type of the decorated function must implement the [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) trait. [§](https://api.rocket.rs/v0.5/rocket/attr.options.html#semantics) Semantics ---------------------------------------------------------------------------- The attribute generates three items: 1. A route [`Handler`](https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html) . The generated handler validates and generates all arguments for the generated function according to the trait that their type must implement. The order in which arguments are processed is: 1. Request guards from left to right. If a request guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromRequest` Outcomes](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#outcomes) for further detail. 2. Path and query guards in an unspecified order. If a path or query guard fails, the request is forwarded. 3. Data guard, if any. If a data guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) for further detail. If all validation succeeds, the decorated function is called. The returned value is used to generate a [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) via the type’s [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) implementation. 2. A static structure used by [`routes!`](https://api.rocket.rs/v0.5/rocket/macro.routes.html) to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) . The static structure (and resulting [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) ) is populated with the name (the function’s name), path, query, rank, and format from the route attribute. The handler is set to the generated handler. 3. A macro used by [`uri!`](https://api.rocket.rs/v0.5/rocket/macro.uri.html) to type-check and generate an [`Origin`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html) . --- # patch in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [patch](https://api.rocket.rs/v0.5/rocket/attr.patch.html#) ------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro patch Copy item path ==================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#275) [Search](https://api.rocket.rs/v0.5/rocket/attr.patch?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[patch] Expand description Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. This and all other route attributes can only be applied to free functions: #[get("/")] fn index() -> &'static str { "Hello, world!" } There are 7 method-specific route attributes: * [`get`](https://api.rocket.rs/v0.5/rocket/attr.get.html) - `GET` specific route * [`put`](https://api.rocket.rs/v0.5/rocket/attr.put.html) - `PUT` specific route * [`post`](https://api.rocket.rs/v0.5/rocket/attr.post.html) - `POST` specific route * [`delete`](https://api.rocket.rs/v0.5/rocket/attr.delete.html) - `DELETE` specific route * [`head`](https://api.rocket.rs/v0.5/rocket/attr.head.html) - `HEAD` specific route * [`options`](https://api.rocket.rs/v0.5/rocket/attr.options.html) - `OPTIONS` specific route * [`patch`](https://api.rocket.rs/v0.5/rocket/attr.patch.html) - `PATCH` specific route Additionally, [`route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) allows the method and uri to be explicitly specified: #[route(GET, uri = "/")] fn index() -> &'static str { "Hello, world!" } [§](https://api.rocket.rs/v0.5/rocket/attr.patch.html#grammar) Grammar ---------------------------------------------------------------------- The grammar for all method-specific route attributes is defined as: route := '"' uri ('?' query)? '"' (',' parameter)* uri := ('/' segment)* query := segment ('&' segment)* segment := URI_SEG | SINGLE_PARAM | TRAILING_PARAM parameter := 'rank' '=' INTEGER | 'format' '=' '"' MEDIA_TYPE '"' | 'data' '=' '"' SINGLE_PARAM '"' SINGLE_PARAM := '<' IDENT '>' TRAILING_PARAM := '<' IDENT '..>' URI_SEG := valid, non-percent-encoded HTTP URI segment MEDIA_TYPE := valid HTTP media type or known shorthand INTEGER := unsigned integer, as defined by Rust IDENT := valid identifier, as defined by Rust The generic route attribute is defined as: generic-route := METHOD ',' 'uri' '=' route [§](https://api.rocket.rs/v0.5/rocket/attr.patch.html#typing-requirements) Typing Requirements ---------------------------------------------------------------------------------------------- Every identifier, except for `_`, that appears in a dynamic parameter (`SINGLE_PARAM` or `TRAILING_PARAM`) must appear as an argument to the function. For example, the following route requires the decorated function to have the arguments `foo`, `baz`, `msg`, `rest`, and `form`: #[get("//bar/?&closed&", data = "")] The type of each function argument corresponding to a dynamic parameter is required to implement one of Rocket’s guard traits. The exact trait that is required to be implemented depends on the kind of dynamic parameter (`SINGLE` or `TRAILING`) and where in the route attribute the parameter appears. The table below summarizes trait requirements: | position | kind | trait | | --- | --- | --- | | path | `` | [`FromParam`](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html) | | path | `` | [`FromSegments`](https://api.rocket.rs/v0.5/rocket/request/trait.FromSegments.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | data | `` | [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) | The type of each function argument that _does not_ have a corresponding dynamic parameter is required to implement the [`FromRequest`](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html) trait. A route argument declared a `_` must _not_ appear in the function argument list and has no typing requirements. The return type of the decorated function must implement the [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) trait. [§](https://api.rocket.rs/v0.5/rocket/attr.patch.html#semantics) Semantics -------------------------------------------------------------------------- The attribute generates three items: 1. A route [`Handler`](https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html) . The generated handler validates and generates all arguments for the generated function according to the trait that their type must implement. The order in which arguments are processed is: 1. Request guards from left to right. If a request guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromRequest` Outcomes](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#outcomes) for further detail. 2. Path and query guards in an unspecified order. If a path or query guard fails, the request is forwarded. 3. Data guard, if any. If a data guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) for further detail. If all validation succeeds, the decorated function is called. The returned value is used to generate a [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) via the type’s [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) implementation. 2. A static structure used by [`routes!`](https://api.rocket.rs/v0.5/rocket/macro.routes.html) to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) . The static structure (and resulting [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) ) is populated with the name (the function’s name), path, query, rank, and format from the route attribute. The handler is set to the generated handler. 3. A macro used by [`uri!`](https://api.rocket.rs/v0.5/rocket/macro.uri.html) to type-check and generate an [`Origin`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html) . --- # post in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [post](https://api.rocket.rs/v0.5/rocket/attr.post.html#) ---------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro post Copy item path =================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#275) [Search](https://api.rocket.rs/v0.5/rocket/attr.post?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[post] Expand description Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. This and all other route attributes can only be applied to free functions: #[get("/")] fn index() -> &'static str { "Hello, world!" } There are 7 method-specific route attributes: * [`get`](https://api.rocket.rs/v0.5/rocket/attr.get.html) - `GET` specific route * [`put`](https://api.rocket.rs/v0.5/rocket/attr.put.html) - `PUT` specific route * [`post`](https://api.rocket.rs/v0.5/rocket/attr.post.html) - `POST` specific route * [`delete`](https://api.rocket.rs/v0.5/rocket/attr.delete.html) - `DELETE` specific route * [`head`](https://api.rocket.rs/v0.5/rocket/attr.head.html) - `HEAD` specific route * [`options`](https://api.rocket.rs/v0.5/rocket/attr.options.html) - `OPTIONS` specific route * [`patch`](https://api.rocket.rs/v0.5/rocket/attr.patch.html) - `PATCH` specific route Additionally, [`route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) allows the method and uri to be explicitly specified: #[route(GET, uri = "/")] fn index() -> &'static str { "Hello, world!" } [§](https://api.rocket.rs/v0.5/rocket/attr.post.html#grammar) Grammar --------------------------------------------------------------------- The grammar for all method-specific route attributes is defined as: route := '"' uri ('?' query)? '"' (',' parameter)* uri := ('/' segment)* query := segment ('&' segment)* segment := URI_SEG | SINGLE_PARAM | TRAILING_PARAM parameter := 'rank' '=' INTEGER | 'format' '=' '"' MEDIA_TYPE '"' | 'data' '=' '"' SINGLE_PARAM '"' SINGLE_PARAM := '<' IDENT '>' TRAILING_PARAM := '<' IDENT '..>' URI_SEG := valid, non-percent-encoded HTTP URI segment MEDIA_TYPE := valid HTTP media type or known shorthand INTEGER := unsigned integer, as defined by Rust IDENT := valid identifier, as defined by Rust The generic route attribute is defined as: generic-route := METHOD ',' 'uri' '=' route [§](https://api.rocket.rs/v0.5/rocket/attr.post.html#typing-requirements) Typing Requirements --------------------------------------------------------------------------------------------- Every identifier, except for `_`, that appears in a dynamic parameter (`SINGLE_PARAM` or `TRAILING_PARAM`) must appear as an argument to the function. For example, the following route requires the decorated function to have the arguments `foo`, `baz`, `msg`, `rest`, and `form`: #[get("//bar/?&closed&", data = "")] The type of each function argument corresponding to a dynamic parameter is required to implement one of Rocket’s guard traits. The exact trait that is required to be implemented depends on the kind of dynamic parameter (`SINGLE` or `TRAILING`) and where in the route attribute the parameter appears. The table below summarizes trait requirements: | position | kind | trait | | --- | --- | --- | | path | `` | [`FromParam`](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html) | | path | `` | [`FromSegments`](https://api.rocket.rs/v0.5/rocket/request/trait.FromSegments.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | data | `` | [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) | The type of each function argument that _does not_ have a corresponding dynamic parameter is required to implement the [`FromRequest`](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html) trait. A route argument declared a `_` must _not_ appear in the function argument list and has no typing requirements. The return type of the decorated function must implement the [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) trait. [§](https://api.rocket.rs/v0.5/rocket/attr.post.html#semantics) Semantics ------------------------------------------------------------------------- The attribute generates three items: 1. A route [`Handler`](https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html) . The generated handler validates and generates all arguments for the generated function according to the trait that their type must implement. The order in which arguments are processed is: 1. Request guards from left to right. If a request guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromRequest` Outcomes](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#outcomes) for further detail. 2. Path and query guards in an unspecified order. If a path or query guard fails, the request is forwarded. 3. Data guard, if any. If a data guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) for further detail. If all validation succeeds, the decorated function is called. The returned value is used to generate a [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) via the type’s [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) implementation. 2. A static structure used by [`routes!`](https://api.rocket.rs/v0.5/rocket/macro.routes.html) to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) . The static structure (and resulting [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) ) is populated with the name (the function’s name), path, query, rank, and format from the route attribute. The handler is set to the generated handler. 3. A macro used by [`uri!`](https://api.rocket.rs/v0.5/rocket/macro.uri.html) to type-check and generate an [`Origin`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html) . --- # put in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [put](https://api.rocket.rs/v0.5/rocket/attr.put.html#) -------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro put Copy item path ================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#275) [Search](https://api.rocket.rs/v0.5/rocket/attr.put?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[put] Expand description Attribute to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) and associated metadata. This and all other route attributes can only be applied to free functions: #[get("/")] fn index() -> &'static str { "Hello, world!" } There are 7 method-specific route attributes: * [`get`](https://api.rocket.rs/v0.5/rocket/attr.get.html) - `GET` specific route * [`put`](https://api.rocket.rs/v0.5/rocket/attr.put.html) - `PUT` specific route * [`post`](https://api.rocket.rs/v0.5/rocket/attr.post.html) - `POST` specific route * [`delete`](https://api.rocket.rs/v0.5/rocket/attr.delete.html) - `DELETE` specific route * [`head`](https://api.rocket.rs/v0.5/rocket/attr.head.html) - `HEAD` specific route * [`options`](https://api.rocket.rs/v0.5/rocket/attr.options.html) - `OPTIONS` specific route * [`patch`](https://api.rocket.rs/v0.5/rocket/attr.patch.html) - `PATCH` specific route Additionally, [`route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) allows the method and uri to be explicitly specified: #[route(GET, uri = "/")] fn index() -> &'static str { "Hello, world!" } [§](https://api.rocket.rs/v0.5/rocket/attr.put.html#grammar) Grammar -------------------------------------------------------------------- The grammar for all method-specific route attributes is defined as: route := '"' uri ('?' query)? '"' (',' parameter)* uri := ('/' segment)* query := segment ('&' segment)* segment := URI_SEG | SINGLE_PARAM | TRAILING_PARAM parameter := 'rank' '=' INTEGER | 'format' '=' '"' MEDIA_TYPE '"' | 'data' '=' '"' SINGLE_PARAM '"' SINGLE_PARAM := '<' IDENT '>' TRAILING_PARAM := '<' IDENT '..>' URI_SEG := valid, non-percent-encoded HTTP URI segment MEDIA_TYPE := valid HTTP media type or known shorthand INTEGER := unsigned integer, as defined by Rust IDENT := valid identifier, as defined by Rust The generic route attribute is defined as: generic-route := METHOD ',' 'uri' '=' route [§](https://api.rocket.rs/v0.5/rocket/attr.put.html#typing-requirements) Typing Requirements -------------------------------------------------------------------------------------------- Every identifier, except for `_`, that appears in a dynamic parameter (`SINGLE_PARAM` or `TRAILING_PARAM`) must appear as an argument to the function. For example, the following route requires the decorated function to have the arguments `foo`, `baz`, `msg`, `rest`, and `form`: #[get("//bar/?&closed&", data = "")] The type of each function argument corresponding to a dynamic parameter is required to implement one of Rocket’s guard traits. The exact trait that is required to be implemented depends on the kind of dynamic parameter (`SINGLE` or `TRAILING`) and where in the route attribute the parameter appears. The table below summarizes trait requirements: | position | kind | trait | | --- | --- | --- | | path | `` | [`FromParam`](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html) | | path | `` | [`FromSegments`](https://api.rocket.rs/v0.5/rocket/request/trait.FromSegments.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | query | `` | [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) | | data | `` | [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) | The type of each function argument that _does not_ have a corresponding dynamic parameter is required to implement the [`FromRequest`](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html) trait. A route argument declared a `_` must _not_ appear in the function argument list and has no typing requirements. The return type of the decorated function must implement the [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) trait. [§](https://api.rocket.rs/v0.5/rocket/attr.put.html#semantics) Semantics ------------------------------------------------------------------------ The attribute generates three items: 1. A route [`Handler`](https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html) . The generated handler validates and generates all arguments for the generated function according to the trait that their type must implement. The order in which arguments are processed is: 1. Request guards from left to right. If a request guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromRequest` Outcomes](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#outcomes) for further detail. 2. Path and query guards in an unspecified order. If a path or query guard fails, the request is forwarded. 3. Data guard, if any. If a data guard fails, the request is forwarded if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Forward` or failed if the [`Outcome`](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) is `Error`. See [`FromData`](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) for further detail. If all validation succeeds, the decorated function is called. The returned value is used to generate a [`Response`](https://api.rocket.rs/v0.5/rocket/struct.Response.html) via the type’s [`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) implementation. 2. A static structure used by [`routes!`](https://api.rocket.rs/v0.5/rocket/macro.routes.html) to generate a [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) . The static structure (and resulting [`Route`](https://api.rocket.rs/v0.5/rocket/attr.route.html) ) is populated with the name (the function’s name), path, query, rank, and format from the route attribute. The handler is set to the generated handler. 3. A macro used by [`uri!`](https://api.rocket.rs/v0.5/rocket/macro.uri.html) to type-check and generate an [`Origin`](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html) . --- # rocket::shield - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Module shield](https://api.rocket.rs/v0.5/rocket/shield/index.html#) ---------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module shield Copy item path ============================ [Source](https://api.rocket.rs/v0.5/src/rocket/shield/mod.rs.html#1-104) [Search](https://api.rocket.rs/v0.5/rocket/shield/?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary Expand description Security and privacy headers for all outgoing responses. The [`Shield`](https://api.rocket.rs/v0.5/rocket/shield/struct.Shield.html "struct rocket::shield::Shield") fairing provides a typed interface for injecting HTTP security and privacy headers into all outgoing responses. It takes some inspiration from [helmetjs](https://helmetjs.github.io/) , a similar piece of middleware for [express](https://expressjs.com/) . [§](https://api.rocket.rs/v0.5/rocket/shield/index.html#supported-headers) Supported Headers -------------------------------------------------------------------------------------------- | HTTP Header | Description | Policy | Default? | | --- | --- | --- | --- | | [X-XSS-Protection](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection) | Prevents some reflected XSS attacks. | [`XssFilter`](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html "enum rocket::shield::XssFilter") | ✗ | | [X-Content-Type-Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options) | Prevents client sniffing of MIME type. | [`NoSniff`](https://api.rocket.rs/v0.5/rocket/shield/enum.NoSniff.html "enum rocket::shield::NoSniff") | ✔ | | [X-Frame-Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options) | Prevents [clickjacking](https://en.wikipedia.org/wiki/Clickjacking)
. | [`Frame`](https://api.rocket.rs/v0.5/rocket/shield/enum.Frame.html "enum rocket::shield::Frame") | ✔ | | [Strict-Transport-Security](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security) | Enforces strict use of HTTPS. | [`Hsts`](https://api.rocket.rs/v0.5/rocket/shield/enum.Hsts.html "enum rocket::shield::Hsts") | ? | | [Expect-CT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect-CT) | Enables certificate transparency. | [`ExpectCt`](https://api.rocket.rs/v0.5/rocket/shield/enum.ExpectCt.html "enum rocket::shield::ExpectCt") | ✗ | | [Referrer-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy) | Enables referrer policy. | [`Referrer`](https://api.rocket.rs/v0.5/rocket/shield/enum.Referrer.html "enum rocket::shield::Referrer") | ✗ | | [X-DNS-Prefetch-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control) | Controls browser DNS prefetching. | [`Prefetch`](https://api.rocket.rs/v0.5/rocket/shield/enum.Prefetch.html "enum rocket::shield::Prefetch") | ✗ | | [Permissions-Policy](https://github.com/w3c/webappsec-permissions-policy/blob/a45df7b237e2a85e1909d7f226ca4eb4ce5095ba/permissions-policy-explainer.md) | Allows or block browser features. | [`Permission`](https://api.rocket.rs/v0.5/rocket/shield/struct.Permission.html "struct rocket::shield::Permission") | ✔ | ? If TLS is enabled in a non-debug profile, HSTS is automatically enabled with its default policy and a warning is logged at liftoff. [§](https://api.rocket.rs/v0.5/rocket/shield/index.html#usage) Usage -------------------------------------------------------------------- By default, [`Shield::default()`](https://api.rocket.rs/v0.5/rocket/shield/struct.Shield.html#method.default "associated function rocket::shield::Shield::default") is attached to all instances Rocket. To change the default, including removing all `Shield` headers, attach a configured instance of [`Shield`](https://api.rocket.rs/v0.5/rocket/shield/struct.Shield.html "struct rocket::shield::Shield") : use rocket::shield::Shield; #[launch] fn rocket() -> _ { // Remove all `Shield` headers. rocket::build().attach(Shield::new()) } Each header can be configured individually. To enable a particular header, call the chainable [`enable()`](https://api.rocket.rs/v0.5/rocket/shield/struct.Shield.html#method.enable "method rocket::shield::Shield::enable") method on an instance of `Shield`, passing in the configured policy type. Similarly, to disable a header, call the chainable [`disable()`](https://api.rocket.rs/v0.5/rocket/shield/struct.Shield.html#method.disable "method rocket::shield::Shield::disable") method on an instance of `Shield`: use time::Duration; use rocket::http::uri::Uri; use rocket::shield::{Shield, Referrer, Prefetch, ExpectCt, NoSniff}; let report_uri = uri!("https://report.rocket.rs"); let shield = Shield::default() .enable(Referrer::NoReferrer) .enable(Prefetch::Off) .enable(ExpectCt::ReportAndEnforce(Duration::days(30), report_uri)) .disable::(); [§](https://api.rocket.rs/v0.5/rocket/shield/index.html#faq) FAQ ---------------------------------------------------------------- * **Which policies should I choose?** See the links in the table above for individual header documentation. The [helmetjs](https://helmetjs.github.io/) docs are also a good resource, and [OWASP](https://www.owasp.org/index.php/OWASP_Secure_Headers_Project#tab=Headers) has a collection of references on these headers. * **Do I need any headers beyond what `Shield` enables by default?** Maybe! The other headers may protect against many important vulnerabilities. Please consult their documentation and other resources to determine if they are needed for your project. Structs[§](https://api.rocket.rs/v0.5/rocket/shield/index.html#structs) ------------------------------------------------------------------------ [Permission](https://api.rocket.rs/v0.5/rocket/shield/struct.Permission.html "struct rocket::shield::Permission") The [Permissions-Policy](https://github.com/w3c/webappsec-permissions-policy/blob/a45df7b237e2a85e1909d7f226ca4eb4ce5095ba/permissions-policy-explainer.md) header: allow or block the use of browser features. [Shield](https://api.rocket.rs/v0.5/rocket/shield/struct.Shield.html "struct rocket::shield::Shield") A [`Fairing`](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html "trait rocket::fairing::Fairing") that injects browser security and privacy headers into all outgoing responses. Enums[§](https://api.rocket.rs/v0.5/rocket/shield/index.html#enums) -------------------------------------------------------------------- [Allow](https://api.rocket.rs/v0.5/rocket/shield/enum.Allow.html "enum rocket::shield::Allow") Specifies the origin(s) allowed to access a browser [`Feature`](https://api.rocket.rs/v0.5/rocket/shield/enum.Feature.html "enum rocket::shield::Feature") via [`Permission`](https://api.rocket.rs/v0.5/rocket/shield/struct.Permission.html "struct rocket::shield::Permission") . [ExpectCt](https://api.rocket.rs/v0.5/rocket/shield/enum.ExpectCt.html "enum rocket::shield::ExpectCt") The [Expect-CT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect-CT) header: enables reporting and/or enforcement of [Certificate Transparency](http://www.certificate-transparency.org/what-is-ct) . [Feature](https://api.rocket.rs/v0.5/rocket/shield/enum.Feature.html "enum rocket::shield::Feature") A browser feature that can be enabled or blocked via [`Permission`](https://api.rocket.rs/v0.5/rocket/shield/struct.Permission.html "struct rocket::shield::Permission") . [Frame](https://api.rocket.rs/v0.5/rocket/shield/enum.Frame.html "enum rocket::shield::Frame") The [X-Frame-Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options) header: helps prevent [clickjacking](https://en.wikipedia.org/wiki/Clickjacking) attacks. [Hsts](https://api.rocket.rs/v0.5/rocket/shield/enum.Hsts.html "enum rocket::shield::Hsts") The HTTP [Strict-Transport-Security](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security) (HSTS) header: enforces strict HTTPS usage. [NoSniff](https://api.rocket.rs/v0.5/rocket/shield/enum.NoSniff.html "enum rocket::shield::NoSniff") The [X-Content-Type-Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options) header: turns off [mime sniffing](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#MIME_sniffing) which can prevent certain [attacks](https://blog.mozilla.org/security/2016/08/26/mitigating-mime-confusion-attacks-in-firefox/) . [Prefetch](https://api.rocket.rs/v0.5/rocket/shield/enum.Prefetch.html "enum rocket::shield::Prefetch") The [X-DNS-Prefetch-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control) header: controls browser DNS prefetching. [Referrer](https://api.rocket.rs/v0.5/rocket/shield/enum.Referrer.html "enum rocket::shield::Referrer") The [Referrer-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy) header: controls the value set by the browser for the [Referer](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer) header. [XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html "enum rocket::shield::XssFilter") The [X-XSS-Protection](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection) header: filters some forms of reflected [XSS](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting) attacks. Modern browsers do not support or enforce this header. Traits[§](https://api.rocket.rs/v0.5/rocket/shield/index.html#traits) ---------------------------------------------------------------------- [Policy](https://api.rocket.rs/v0.5/rocket/shield/trait.Policy.html "trait rocket::shield::Policy") Trait implemented by security and privacy policy headers. --- # Responder in rocket::response - Rust [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#) ------------------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[response](https://api.rocket.rs/v0.5/rocket/response/index.html) Trait Responder Copy item path ============================== [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#293-306) pub trait Responder<'r, 'o: 'r> { // Required method fn respond_to(self, request: &'r Request<'_>) -> Result<'o>; } Expand description Trait implemented by types that generate responses for clients. Any type that implements `Responder` can be used as the return type of a handler: // This works for any `T` that implements `Responder`. #[get("/")] fn index() -> T { /* ... */ } [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#deriving) Deriving --------------------------------------------------------------------------------- This trait can, and largely _should_, be automatically derived. The derive can handle all simple cases and most complex cases, too. When deriving `Responder`, the first field of the annotated structure (or of each variant if an `enum`) is used to generate a response while the remaining fields are used as response headers: use rocket::http::ContentType; use rocket::serde::{Serialize, json::Json}; #[derive(Responder)] enum Error { #[response(status = 400)] Unauthorized(Json), #[response(status = 404)] NotFound(Template, ContentType), } For full details on deriving `Responder`, see the [`Responder` derive](https://api.rocket.rs/v0.5/rocket/derive.Responder.html "derive rocket::Responder") . [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#provided-implementations) Provided Implementations ----------------------------------------------------------------------------------------------------------------- Rocket implements `Responder` for several standard library types. Their behavior is documented here. Note that the `Result` implementation is overloaded, allowing for two `Responder`s to be used at once, depending on the variant. * **&str** Sets the `Content-Type` to `text/plain`. The string is used as the body of the response, which is fixed size and not streamed. To stream a raw string, use `Stream::from(Cursor::new(string))`. * **String** Sets the `Content-Type` to `text/plain`. The string is used as the body of the response, which is fixed size and not streamed. To stream a string, use `Stream::from(Cursor::new(string))`. * **&\[u8\]** Sets the `Content-Type` to `application/octet-stream`. The slice is used as the body of the response, which is fixed size and not streamed. To stream a slice of bytes, use `Stream::from(Cursor::new(data))`. * **Vec** Sets the `Content-Type` to `application/octet-stream`. The vector’s data is used as the body of the response, which is fixed size and not streamed. To stream a vector of bytes, use `Stream::from(Cursor::new(vec))`. * **File** Responds with a streamed body containing the data in the `File`. No `Content-Type` is set. To automatically have a `Content-Type` set based on the file’s extension, use [`NamedFile`](https://api.rocket.rs/v0.5/rocket/fs/struct.NamedFile.html "struct rocket::fs::NamedFile") . * **()** Responds with an empty body. No `Content-Type` is set. * **Option** If the `Option` is `Some`, the wrapped responder is used to respond to the client. Otherwise, an `Err` with status **404 Not Found** is returned and a warning is printed to the console. * **Result** If the `Result` is `Ok`, the wrapped `Ok` responder is used to respond to the client. If the `Result` is `Err`, the wrapped `Err` responder is used to respond to the client. [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#return-value) Return Value ----------------------------------------------------------------------------------------- A `Responder` returns a `Result`. * An `Ok(Response)` indicates success. The `Response` will be written out to the client. * An `Err(Status)` indicates an error. The error catcher for `Status` will be invoked to generate a response. [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#implementation-tips) Implementation Tips ------------------------------------------------------------------------------------------------------- This section describes a few best practices to take into account when implementing `Responder`. 1. Avoid Manual Implementations The [`Responder` derive](https://api.rocket.rs/v0.5/rocket/derive.Responder.html "derive rocket::Responder") is a powerful mechanism that eliminates the need to implement `Responder` in almost all cases. We encourage you to explore using the derive _before_ attempting to implement `Responder` directly. It allows you to leverage existing `Responder` implementations through composition, decreasing the opportunity for mistakes or performance degradation. 2. Joining and Merging When chaining/wrapping other `Responder`s, start with [`Response::build_from()`](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.build_from "associated function rocket::Response::build_from") and/or use the [`merge()`](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.merge "method rocket::Response::merge") or [`join()`](https://api.rocket.rs/v0.5/rocket/struct.Response.html#method.join "method rocket::Response::join") methods on the `Response` or `ResponseBuilder` struct. Ensure that you document merging or joining behavior appropriately. 3. Inspecting Requests While tempting, a `Responder` that varies its functionality based on the incoming request sacrifices its functionality being understood based purely on its type. By implication, gleaning the functionality of a _handler_ from its type signature also becomes more difficult. You should avoid varying responses based on the `Request` value as much as possible. 4. Perform `async` I/O in Constructors The `Responder` trait is not an `async` trait. This is not an oversight. Instead of performing `async` operations in what would be the `respond_to` method, perform them in a constructor for the responder. As an example, see [`NamedFile::open()`](https://api.rocket.rs/v0.5/rocket/fs/struct.NamedFile.html#method.open "associated function rocket::fs::NamedFile::open") , which performs the requisite I/O for `NamedFile`’s responder. ### [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#lifetimes) Lifetimes `Responder` has two lifetimes: `Responder<'r, 'o: 'r>`. * `'r` bounds the reference to the `&'r Request`. * `'o` bounds the returned `Response<'o>` to values that live at least as long as the request. This includes borrows from the `Request` itself (where `'o` would be `'r` as in `impl<'r> Responder<'r, 'r>`) as well as `'static` data (where `'o` would be `'static` as in `impl<'r> Responder<'r, 'static>`). In practice, you are likely choosing between four signatures: // If the response contains no borrowed data. impl<'r> Responder<'r, 'static> for A { fn respond_to(self, _: &'r Request<'_>) -> response::Result<'static> { todo!() } } // If the response borrows from the request. impl<'r> Responder<'r, 'r> for B<'r> { fn respond_to(self, _: &'r Request<'_>) -> response::Result<'r> { todo!() } } // If the response is or wraps a borrow that may outlive the request. impl<'r, 'o: 'r> Responder<'r, 'o> for &'o C { fn respond_to(self, _: &'r Request<'_>) -> response::Result<'o> { todo!() } } // If the response wraps an existing responder. impl<'r, 'o: 'r, R: Responder<'r, 'o>> Responder<'r, 'o> for D { fn respond_to(self, _: &'r Request<'_>) -> response::Result<'o> { todo!() } } [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#example) Example ------------------------------------------------------------------------------- Say that you have a custom type, `Person`: struct Person { name: String, age: u16 } You’d like to use `Person` as a `Responder` so that you can return a `Person` directly from a handler: #[get("/person/")] fn person(id: usize) -> Option { Person::from_id(id) } You want the `Person` responder to set two header fields: `X-Person-Name` and `X-Person-Age` as well as supply a custom representation of the object (`Content-Type: application/x-person`) in the body of the response. The following `Responder` implementation accomplishes this: use std::io::Cursor; use rocket::request::Request; use rocket::response::{self, Response, Responder}; use rocket::http::ContentType; impl<'r> Responder<'r, 'static> for Person { fn respond_to(self, req: &'r Request<'_>) -> response::Result<'static> { let string = format!("{}:{}", self.name, self.age); Response::build_from(string.respond_to(req)?) .raw_header("X-Person-Name", self.name) .raw_header("X-Person-Age", self.age.to_string()) .header(ContentType::new("application", "x-person")) .ok() } } Note that the implementation could have instead been derived if structured in a slightly different manner: use rocket::http::Header; use rocket::response::Responder; #[derive(Responder)] #[response(content_type = "application/x-person")] struct Person { text: String, name: Header<'static>, age: Header<'static>, } impl Person { fn new(name: &str, age: usize) -> Person { Person { text: format!("{}:{}", name, age), name: Header::new("X-Person-Name", name.to_string()), age: Header::new("X-Person-Age", age.to_string()) } } } Required Methods[§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#required-methods) ------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#305) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#tymethod.respond_to) (self, request: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'o> Returns `Ok` if a `Response` could be generated successfully. Otherwise, returns an `Err` with a failing `Status`. The `request` parameter is the `Request` that this `Responder` is responding to. When using Rocket’s code generation, if an `Ok(Response)` is returned, the response will be written out to the client. If an `Err(Status)` is returned, the error catcher for the given status is retrieved and called to generate a final error response, which is then written out to the client. Implementations on Foreign Types[§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#foreign-impls) -------------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#462-466) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-()) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [()](https://doc.rust-lang.org/nightly/std/primitive.unit.html) Returns an empty, default `Response`. Always returns `Ok`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#463-465) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#method.respond_to) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#tymethod.respond_to) (self, \_: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'static> [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#341-348) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-Arc%3Cstr%3E) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [Arc](https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html "struct alloc::sync::Arc") <[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) \> Returns a response with Content-Type `text/plain` and a fixed-size body containing the string `self`. Always returns `Ok`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#342-347) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#method.respond_to-1) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#tymethod.respond_to) (self, \_: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'static> [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#385-392) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-Arc%3C%5Bu8%5D%3E) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [Arc](https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html "struct alloc::sync::Arc") <\[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \]> Returns a response with Content-Type `application/octet-stream` and a fixed-size body containing the data in `self`. Always returns `Ok`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#386-391) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#method.respond_to-2) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#tymethod.respond_to) (self, \_: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'static> [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#448-452) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-File) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [File](https://doc.rust-lang.org/nightly/std/fs/struct.File.html "struct std::fs::File") Returns a response with a sized body for the file. Always returns `Ok`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#449-451) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#method.respond_to-3) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#tymethod.respond_to) (self, req: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'static> [Source](https://api.rocket.rs/v0.5/src/rocket/response/debug.rs.html#88-93) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-Error) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [Error](https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html "struct std::io::error::Error") Prints a warning with the error and forwards to the `500` error catcher. [Source](https://api.rocket.rs/v0.5/src/rocket/response/debug.rs.html#89-92) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#method.respond_to-4) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#tymethod.respond_to) (self, \_: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'static> [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#455-459) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-File-1) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [File](https://docs.rs/tokio/1.48.0/tokio/fs/file/struct.File.html "struct tokio::fs::file::File") Returns a response with a sized body for the file. Always returns `Ok`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#456-458) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#method.respond_to-5) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#tymethod.respond_to) (self, \_: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'static> [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#310-317) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-%26str) ### impl<'r, 'o: 'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for &'o [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) Returns a response with Content-Type `text/plain` and a fixed-size body containing the string `self`. Always returns `Ok`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#311-316) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#method.respond_to-6) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#tymethod.respond_to) (self, \_: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'o> [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#363-370) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-%26%5Bu8%5D) ### impl<'r, 'o: 'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for &'o \[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \] Returns a response with Content-Type `application/octet-stream` and a fixed-size body containing the data in `self`. Always returns `Ok`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#364-369) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#method.respond_to-7) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#tymethod.respond_to) (self, \_: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'o> [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#509-518) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-Either%3CT,+E%3E) ### impl<'r, 'o: 'r, 't: 'o, 'e: 'o, T, E> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") where T: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 't>, E: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'e>, Responds with the wrapped `Responder` in `self`, whether it is `Left` or `Right`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#512-517) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#method.respond_to-8) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#tymethod.respond_to) (self, req: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'o> [Source](https://api.rocket.rs/v0.5/src/rocket/response/content.rs.html#80-87) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-(ContentType,+R)) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for ([ContentType](https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html "struct rocket::http::ContentType") , R) [Source](https://api.rocket.rs/v0.5/src/rocket/response/content.rs.html#81-86) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#method.respond_to-9) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#tymethod.respond_to) (self, req: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'o> [Source](https://api.rocket.rs/v0.5/src/rocket/response/status.rs.html#245-250) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-(Status,+R)) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for ([Status](https://api.rocket.rs/v0.5/rocket/http/struct.Status.html "struct rocket::http::Status") , R) [Source](https://api.rocket.rs/v0.5/src/rocket/response/status.rs.html#247-249) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#method.respond_to-10) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#tymethod.respond_to) (self, request: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'o> [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#469-478) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-Cow%3C'o,+R%3E) ### impl<'r, 'o: 'r, R: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") + [ToOwned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html "trait alloc::borrow::ToOwned") \> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow") <'o, R> where [&'o R](https://doc.rust-lang.org/nightly/std/primitive.reference.html) : [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> + 'o, ::[Owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned "type alloc::borrow::ToOwned::Owned") : [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> + 'r, Responds with the inner `Responder` in `Cow`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#472-477) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#method.respond_to-11) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#tymethod.respond_to) (self, req: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'o> Implementors[§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#implementors) ----------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/serde/json.rs.html#300-304) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-Value) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [Value](https://api.rocket.rs/v0.5/rocket/serde/json/enum.Value.html "enum rocket::serde::json::Value") Available on **crate feature `json`** only. Serializes the value into JSON. Returns a response with Content-Type JSON and a fixed-size body with the serialized value. [Source](https://api.rocket.rs/v0.5/src/rocket/fs/named_file.rs.html#149-160) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-NamedFile) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [NamedFile](https://api.rocket.rs/v0.5/rocket/fs/struct.NamedFile.html "struct rocket::fs::NamedFile") Streams the named file to the client. Sets or overrides the Content-Type in the response according to the file’s extension if the extension is recognized. See [`ContentType::from_extension()`](https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html#method.from_extension "associated function rocket::http::ContentType::from_extension") for more information. If you would like to stream a file with a different Content-Type than that implied by its extension, use a [`File`](https://docs.rs/tokio/1.48.0/tokio/fs/file/struct.File.html "struct tokio::fs::file::File") directly. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#534-550) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-Status) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [Status](https://api.rocket.rs/v0.5/rocket/http/struct.Status.html "struct rocket::http::Status") The response generated by `Status` depends on the status code itself. The table below summarizes the functionality: | Status Code Range | Response | | --- | --- | | \[400, 599\] | Forwards to catcher for given status. | | 100, \[200, 205\] | Empty with status of `self`. | | All others. | Invalid. Errors to `500` catcher. | In short, a client or server error status codes will forward to the corresponding error catcher, a successful status code less than `206` or `100` responds with any empty body and the given status code, and all other status code emit an error message and forward to the `500` (internal server error) catcher. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#352-359) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-Box%3Cstr%3E) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") <[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) \> Returns a response with Content-Type `text/plain` and a fixed-size body containing the string `self`. Always returns `Ok`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#396-403) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-Box%3C%5Bu8%5D%3E) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") <\[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \]> Returns a response with Content-Type `application/octet-stream` and a fixed-size body containing the data in `self`. Always returns `Ok`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#321-328) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-String) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") Returns a response with Content-Type `text/plain` and a fixed-size body containing the string `self`. Always returns `Ok`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#374-381) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-Vec%3Cu8%3E) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [Vec](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/vec/struct.Vec.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::vec::Vec") <[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) \> Returns a response with Content-Type `application/octet-stream` and a fixed-size body containing the data in `self`. Always returns `Ok`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/status.rs.html#203-207) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-NoContent) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [NoContent](https://api.rocket.rs/v0.5/rocket/response/status/struct.NoContent.html "struct rocket::response::status::NoContent") Sets the status code of the response to 204 No Content. [Source](https://api.rocket.rs/v0.5/src/rocket/response/redirect.rs.html#153-165) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-Redirect) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [Redirect](https://api.rocket.rs/v0.5/rocket/response/struct.Redirect.html "struct rocket::response::Redirect") Constructs a response with the appropriate status code and the given URL in the `Location` header field. The body of the response is empty. If the URI value used to create the `Responder` is an invalid URI, an error of `Status::InternalServerError` is returned. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#496-505) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-Result%3CT,+E%3E) ### impl<'r, 'o: 'r, 't: 'o, 'e: 'o, T, E> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") where T: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 't>, E: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'e>, Responds with the wrapped `Responder` in `self`, whether it is `Ok` or `Err`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#482-492) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-Option%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") If `self` is `Some`, responds with the wrapped `Responder`. Otherwise prints a warning message and returns an `Err` of `Status::NotFound`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/content.rs.html#69-78) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-RawCss%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [RawCss](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawCss.html "struct rocket::response::content::RawCss") Sets the Content-Type of the response then delegates the remainder of the response to the wrapped responder. [Source](https://api.rocket.rs/v0.5/src/rocket/response/content.rs.html#69-78) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-RawHtml%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [RawHtml](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawHtml.html "struct rocket::response::content::RawHtml") Sets the Content-Type of the response then delegates the remainder of the response to the wrapped responder. [Source](https://api.rocket.rs/v0.5/src/rocket/response/content.rs.html#69-78) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-RawJavaScript%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [RawJavaScript](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawJavaScript.html "struct rocket::response::content::RawJavaScript") Sets the Content-Type of the response then delegates the remainder of the response to the wrapped responder. [Source](https://api.rocket.rs/v0.5/src/rocket/response/content.rs.html#69-78) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-RawJson%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [RawJson](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawJson.html "struct rocket::response::content::RawJson") Sets the Content-Type of the response then delegates the remainder of the response to the wrapped responder. [Source](https://api.rocket.rs/v0.5/src/rocket/response/content.rs.html#69-78) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-RawMsgPack%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [RawMsgPack](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawMsgPack.html "struct rocket::response::content::RawMsgPack") Sets the Content-Type of the response then delegates the remainder of the response to the wrapped responder. [Source](https://api.rocket.rs/v0.5/src/rocket/response/content.rs.html#69-78) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-RawText%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [RawText](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawText.html "struct rocket::response::content::RawText") Sets the Content-Type of the response then delegates the remainder of the response to the wrapped responder. [Source](https://api.rocket.rs/v0.5/src/rocket/response/content.rs.html#69-78) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-RawXml%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [RawXml](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawXml.html "struct rocket::response::content::RawXml") Sets the Content-Type of the response then delegates the remainder of the response to the wrapped responder. [Source](https://api.rocket.rs/v0.5/src/rocket/response/status.rs.html#299) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-Accepted%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [Accepted](https://api.rocket.rs/v0.5/rocket/response/status/struct.Accepted.html "struct rocket::response::status::Accepted") [Source](https://api.rocket.rs/v0.5/src/rocket/response/status.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-BadRequest%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [BadRequest](https://api.rocket.rs/v0.5/rocket/response/status/struct.BadRequest.html "struct rocket::response::status::BadRequest") [Source](https://api.rocket.rs/v0.5/src/rocket/response/status.rs.html#304) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-Conflict%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [Conflict](https://api.rocket.rs/v0.5/rocket/response/status/struct.Conflict.html "struct rocket::response::status::Conflict") [Source](https://api.rocket.rs/v0.5/src/rocket/response/status.rs.html#165-180) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-Created%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [Created](https://api.rocket.rs/v0.5/rocket/response/status/struct.Created.html "struct rocket::response::status::Created") Sets the status code of the response to 201 Created. Sets the `Location` header to the parameter in the [`Created::new()`](https://api.rocket.rs/v0.5/rocket/response/status/struct.Created.html#method.new "associated function rocket::response::status::Created::new") constructor. The optional responder, set via [`Created::body()`](https://api.rocket.rs/v0.5/rocket/response/status/struct.Created.html#method.body "method rocket::response::status::Created::body") or [`Created::tagged_body()`](https://api.rocket.rs/v0.5/rocket/response/status/struct.Created.html#method.tagged_body "method rocket::response::status::Created::tagged_body") finalizes the response if it exists. The wrapped responder should write the body of the response so that it contains information about the created resource. If no responder is provided, the response body will be empty. In addition to setting the status code, `Location` header, and finalizing the response with the `Responder`, the `ETag` header is set conditionally if a hashable `Responder` is provided via [`Created::tagged_body()`](https://api.rocket.rs/v0.5/rocket/response/status/struct.Created.html#method.tagged_body "method rocket::response::status::Created::tagged_body") . The `ETag` header is set to a hash value of the responder. [Source](https://api.rocket.rs/v0.5/src/rocket/response/status.rs.html#236-243) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-Custom%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [Custom](https://api.rocket.rs/v0.5/rocket/response/status/struct.Custom.html "struct rocket::response::status::Custom") Sets the status code of the response and then delegates the remainder of the response to the wrapped responder. [Source](https://api.rocket.rs/v0.5/src/rocket/response/status.rs.html#302) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-Forbidden%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [Forbidden](https://api.rocket.rs/v0.5/rocket/response/status/struct.Forbidden.html "struct rocket::response::status::Forbidden") [Source](https://api.rocket.rs/v0.5/src/rocket/response/status.rs.html#303) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-NotFound%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [NotFound](https://api.rocket.rs/v0.5/rocket/response/status/struct.NotFound.html "struct rocket::response::status::NotFound") [Source](https://api.rocket.rs/v0.5/src/rocket/response/status.rs.html#301) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-Unauthorized%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [Unauthorized](https://api.rocket.rs/v0.5/rocket/response/status/struct.Unauthorized.html "struct rocket::response::status::Unauthorized") [Source](https://api.rocket.rs/v0.5/src/rocket/response/flash.rs.html#191-196) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-Flash%3CR%3E) ### impl<'r, 'o: 'r, R: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [Flash](https://api.rocket.rs/v0.5/rocket/response/struct.Flash.html "struct rocket::response::Flash") Sets the message cookie and then uses the wrapped responder to complete the response. In other words, simply sets a cookie and delegates the rest of the response handling to the wrapped responder. As a result, the `Outcome` of the response is the `Outcome` of the wrapped `Responder`. [Source](https://api.rocket.rs/v0.5/src/rocket/response/responder.rs.html#440-445) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-Box%3CT%3E) ### impl<'r, 'o: 'r, T: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> + [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") \> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") Returns the response generated by the inner `T`. Note that this explicitly does not support `Box`. [ⓘ](https://api.rocket.rs/v0.5/rocket/response/trait.Responder# "This example deliberately fails to compile") #[macro_use] extern crate rocket; use rocket::response::Responder; #[get("/")] fn f() -> Box> { Box::new(()) } However, this `impl` allows boxing sized responders: #[macro_use] extern crate rocket; #[derive(Responder)] enum Content { Redirect(Box), Text(String), } #[get("/")] fn f() -> Option> { None } #[get("/")] fn g() -> Content { Content::Text("hello".to_string()) } [Source](https://api.rocket.rs/v0.5/src/rocket/data/capped.rs.html#207-211) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'o%3E-for-Capped%3CT%3E) ### impl<'r, 'o: 'r, T: [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o>> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'o> for [Capped](https://api.rocket.rs/v0.5/rocket/data/struct.Capped.html "struct rocket::data::Capped") [Source](https://api.rocket.rs/v0.5/src/rocket/response/debug.rs.html#79-85) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-Debug%3CE%3E) ### impl<'r, E: [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") \> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [Debug](https://api.rocket.rs/v0.5/rocket/response/struct.Debug.html "struct rocket::response::Debug") [Source](https://api.rocket.rs/v0.5/src/rocket/response/stream/bytes.rs.html#64-73) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'r%3E-for-ByteStream%3CS%3E) ### impl<'r, S> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'r> for [ByteStream](https://api.rocket.rs/v0.5/rocket/response/stream/struct.ByteStream.html "struct rocket::response::stream::ByteStream") where S: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'r + [Stream](https://docs.rs/futures-core/0.3.31/futures_core/stream/trait.Stream.html "trait futures_core::stream::Stream") , S::[Item](https://docs.rs/futures-core/0.3.31/futures_core/stream/trait.Stream.html#associatedtype.Item "type futures_core::stream::Stream::Item") : [AsRef](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.AsRef.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::AsRef") <\[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \]> + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") + 'r, [Source](https://api.rocket.rs/v0.5/src/rocket/response/stream/reader.rs.html#142-150) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'r%3E-for-ReaderStream%3CS%3E) ### impl<'r, S> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'r> for [ReaderStream](https://api.rocket.rs/v0.5/rocket/response/stream/struct.ReaderStream.html "struct rocket::response::stream::ReaderStream") where S: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'r + [Stream](https://docs.rs/futures-core/0.3.31/futures_core/stream/trait.Stream.html "trait futures_core::stream::Stream") , S::[Item](https://docs.rs/futures-core/0.3.31/futures_core/stream/trait.Stream.html#associatedtype.Item "type futures_core::stream::Stream::Item") : [AsyncRead](https://docs.rs/tokio/1.48.0/tokio/io/async_read/trait.AsyncRead.html "trait tokio::io::async_read::AsyncRead") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , [Source](https://api.rocket.rs/v0.5/src/rocket/response/stream/text.rs.html#65-83) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'r%3E-for-TextStream%3CS%3E) ### impl<'r, S> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'r> for [TextStream](https://api.rocket.rs/v0.5/rocket/response/stream/struct.TextStream.html "struct rocket::response::stream::TextStream") where S: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'r + [Stream](https://docs.rs/futures-core/0.3.31/futures_core/stream/trait.Stream.html "trait futures_core::stream::Stream") , S::[Item](https://docs.rs/futures-core/0.3.31/futures_core/stream/trait.Stream.html#associatedtype.Item "type futures_core::stream::Stream::Item") : [AsRef](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.AsRef.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::AsRef") <[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) \> + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") + 'r, [Source](https://api.rocket.rs/v0.5/src/rocket/response/stream/sse.rs.html#577-586) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'r%3E-for-EventStream%3CS%3E) ### impl<'r, S: [Stream](https://docs.rs/futures-core/0.3.31/futures_core/stream/trait.Stream.html "trait futures_core::stream::Stream") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'r> for [EventStream](https://api.rocket.rs/v0.5/rocket/response/stream/struct.EventStream.html "struct rocket::response::stream::EventStream") [Source](https://api.rocket.rs/v0.5/src/rocket/serde/json.rs.html#218-228) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-Json%3CT%3E) ### impl<'r, T: [Serialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html "trait rocket::serde::Serialize") \> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [Json](https://api.rocket.rs/v0.5/rocket/serde/json/struct.Json.html "struct rocket::serde::json::Json") Available on **crate feature `json`** only. Serializes the wrapped value into JSON. Returns a response with Content-Type JSON and a fixed-size body with the serialized value. If serialization fails, an `Err` of `Status::InternalServerError` is returned. [Source](https://api.rocket.rs/v0.5/src/rocket/serde/msgpack.rs.html#189-199) [§](https://api.rocket.rs/v0.5/rocket/response/trait.Responder#impl-Responder%3C'r,+'static%3E-for-MsgPack%3CT%3E) ### impl<'r, T: [Serialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html "trait rocket::serde::Serialize") \> [Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") <'r, 'static> for [MsgPack](https://api.rocket.rs/v0.5/rocket/serde/msgpack/struct.MsgPack.html "struct rocket::serde::msgpack::MsgPack") Available on **crate feature `msgpack`** only. Serializes the wrapped value into MessagePack. Returns a response with Content-Type `MsgPack` and a fixed-size body with the serialization. If serialization fails, an `Err` of `Status::InternalServerError` is returned. --- # List of all items in this crate [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [All](https://api.rocket.rs/v0.5/rocket/all.html#) --------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") List of all items ================= [Search](https://api.rocket.rs/v0.5/rocket/all?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary ### Structs * [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html) * [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html) * [Data](https://api.rocket.rs/v0.5/rocket/struct.Data.html) * [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html) * [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html) * [Response](https://api.rocket.rs/v0.5/rocket/struct.Response.html) * [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html) * [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html) * [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html) * [State](https://api.rocket.rs/v0.5/rocket/struct.State.html) * [catcher::Catcher](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher.html) * [config::Config](https://api.rocket.rs/v0.5/rocket/config/struct.Config.html) * [config::Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html) * [config::MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html) * [config::SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html) * [config::Shutdown](https://api.rocket.rs/v0.5/rocket/config/struct.Shutdown.html) * [config::TlsConfig](https://api.rocket.rs/v0.5/rocket/config/struct.TlsConfig.html) * [data::ByteUnit](https://api.rocket.rs/v0.5/rocket/data/struct.ByteUnit.html) * [data::Capped](https://api.rocket.rs/v0.5/rocket/data/struct.Capped.html) * [data::Data](https://api.rocket.rs/v0.5/rocket/data/struct.Data.html) * [data::DataStream](https://api.rocket.rs/v0.5/rocket/data/struct.DataStream.html) * [data::IoStream](https://api.rocket.rs/v0.5/rocket/data/struct.IoStream.html) * [data::Limits](https://api.rocket.rs/v0.5/rocket/data/struct.Limits.html) * [data::N](https://api.rocket.rs/v0.5/rocket/data/struct.N.html) * [error::Error](https://api.rocket.rs/v0.5/rocket/error/struct.Error.html) * [fairing::AdHoc](https://api.rocket.rs/v0.5/rocket/fairing/struct.AdHoc.html) * [fairing::Info](https://api.rocket.rs/v0.5/rocket/fairing/struct.Info.html) * [fairing::Kind](https://api.rocket.rs/v0.5/rocket/fairing/struct.Kind.html) * [form::Context](https://api.rocket.rs/v0.5/rocket/form/struct.Context.html) * [form::Contextual](https://api.rocket.rs/v0.5/rocket/form/struct.Contextual.html) * [form::DataField](https://api.rocket.rs/v0.5/rocket/form/struct.DataField.html) * [form::Error](https://api.rocket.rs/v0.5/rocket/form/struct.Error.html) * [form::Errors](https://api.rocket.rs/v0.5/rocket/form/struct.Errors.html) * [form::Form](https://api.rocket.rs/v0.5/rocket/form/struct.Form.html) * [form::Lenient](https://api.rocket.rs/v0.5/rocket/form/struct.Lenient.html) * [form::Options](https://api.rocket.rs/v0.5/rocket/form/struct.Options.html) * [form::Strict](https://api.rocket.rs/v0.5/rocket/form/struct.Strict.html) * [form::ValueField](https://api.rocket.rs/v0.5/rocket/form/struct.ValueField.html) * [form::error::Error](https://api.rocket.rs/v0.5/rocket/form/error/struct.Error.html) * [form::error::Errors](https://api.rocket.rs/v0.5/rocket/form/error/struct.Errors.html) * [form::name::Key](https://api.rocket.rs/v0.5/rocket/form/name/struct.Key.html) * [form::name::Name](https://api.rocket.rs/v0.5/rocket/form/name/struct.Name.html) * [form::name::NameBuf](https://api.rocket.rs/v0.5/rocket/form/name/struct.NameBuf.html) * [form::name::NameView](https://api.rocket.rs/v0.5/rocket/form/name/struct.NameView.html) * [fs::FileName](https://api.rocket.rs/v0.5/rocket/fs/struct.FileName.html) * [fs::FileServer](https://api.rocket.rs/v0.5/rocket/fs/struct.FileServer.html) * [fs::NamedFile](https://api.rocket.rs/v0.5/rocket/fs/struct.NamedFile.html) * [fs::Options](https://api.rocket.rs/v0.5/rocket/fs/struct.Options.html) * [http::Accept](https://api.rocket.rs/v0.5/rocket/http/struct.Accept.html) * [http::ContentType](https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html) * [http::Cookie](https://api.rocket.rs/v0.5/rocket/http/struct.Cookie.html) * [http::CookieJar](https://api.rocket.rs/v0.5/rocket/http/struct.CookieJar.html) * [http::Header](https://api.rocket.rs/v0.5/rocket/http/struct.Header.html) * [http::HeaderMap](https://api.rocket.rs/v0.5/rocket/http/struct.HeaderMap.html) * [http::Iter](https://api.rocket.rs/v0.5/rocket/http/struct.Iter.html) * [http::MediaType](https://api.rocket.rs/v0.5/rocket/http/struct.MediaType.html) * [http::QMediaType](https://api.rocket.rs/v0.5/rocket/http/struct.QMediaType.html) * [http::RawStr](https://api.rocket.rs/v0.5/rocket/http/struct.RawStr.html) * [http::RawStrBuf](https://api.rocket.rs/v0.5/rocket/http/struct.RawStrBuf.html) * [http::Status](https://api.rocket.rs/v0.5/rocket/http/struct.Status.html) * [http::uncased::Uncased](https://api.rocket.rs/v0.5/rocket/http/uncased/struct.Uncased.html) * [http::uncased::UncasedStr](https://api.rocket.rs/v0.5/rocket/http/uncased/struct.UncasedStr.html) * [http::uri::Absolute](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Absolute.html) * [http::uri::Asterisk](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Asterisk.html) * [http::uri::Authority](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Authority.html) * [http::uri::Error](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Error.html) * [http::uri::Host](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Host.html) * [http::uri::Origin](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html) * [http::uri::Path](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Path.html) * [http::uri::Query](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Query.html) * [http::uri::Reference](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Reference.html) * [http::uri::Segments](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Segments.html) * [http::uri::error::Error](https://api.rocket.rs/v0.5/rocket/http/uri/error/struct.Error.html) * [http::uri::error::TryFromUriError](https://api.rocket.rs/v0.5/rocket/http/uri/error/struct.TryFromUriError.html) * [http::uri::fmt::Formatter](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/struct.Formatter.html) * [local::asynchronous::Client](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.Client.html) * [local::asynchronous::LocalRequest](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.LocalRequest.html) * [local::asynchronous::LocalResponse](https://api.rocket.rs/v0.5/rocket/local/asynchronous/struct.LocalResponse.html) * [local::blocking::Client](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.Client.html) * [local::blocking::LocalRequest](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalRequest.html) * [local::blocking::LocalResponse](https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalResponse.html) * [mtls::Certificate](https://api.rocket.rs/v0.5/rocket/mtls/struct.Certificate.html) * [mtls::Name](https://api.rocket.rs/v0.5/rocket/mtls/struct.Name.html) * [mtls::bigint::BigInt](https://api.rocket.rs/v0.5/rocket/mtls/bigint/struct.BigInt.html) * [mtls::bigint::BigUint](https://api.rocket.rs/v0.5/rocket/mtls/bigint/struct.BigUint.html) * [mtls::bigint::ParseBigIntError](https://api.rocket.rs/v0.5/rocket/mtls/bigint/struct.ParseBigIntError.html) * [mtls::bigint::TryFromBigIntError](https://api.rocket.rs/v0.5/rocket/mtls/bigint/struct.TryFromBigIntError.html) * [mtls::bigint::U32Digits](https://api.rocket.rs/v0.5/rocket/mtls/bigint/struct.U32Digits.html) * [mtls::bigint::U64Digits](https://api.rocket.rs/v0.5/rocket/mtls/bigint/struct.U64Digits.html) * [mtls::oid::LoadedEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry.html) * [mtls::oid::Oid](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.Oid.html) * [mtls::oid::OidEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.OidEntry.html) * [mtls::oid::OidRegistry](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.OidRegistry.html) * [mtls::oid::asn1\_rs::ASN1DateTime](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.ASN1DateTime.html) * [mtls::oid::asn1\_rs::Any](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.Any.html) * [mtls::oid::asn1\_rs::BerClassFromIntError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.BerClassFromIntError.html) * [mtls::oid::asn1\_rs::BitString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.BitString.html) * [mtls::oid::asn1\_rs::BmpString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.BmpString.html) * [mtls::oid::asn1\_rs::Boolean](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.Boolean.html) * [mtls::oid::asn1\_rs::EmbeddedPdv](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.EmbeddedPdv.html) * [mtls::oid::asn1\_rs::EndOfContent](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.EndOfContent.html) * [mtls::oid::asn1\_rs::Enumerated](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.Enumerated.html) * [mtls::oid::asn1\_rs::GeneralString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.GeneralString.html) * [mtls::oid::asn1\_rs::GeneralizedTime](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.GeneralizedTime.html) * [mtls::oid::asn1\_rs::GraphicString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.GraphicString.html) * [mtls::oid::asn1\_rs::Header](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.Header.html) * [mtls::oid::asn1\_rs::Ia5String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.Ia5String.html) * [mtls::oid::asn1\_rs::Integer](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.Integer.html) * [mtls::oid::asn1\_rs::Null](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.Null.html) * [mtls::oid::asn1\_rs::NumericString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.NumericString.html) * [mtls::oid::asn1\_rs::ObjectDescriptor](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.ObjectDescriptor.html) * [mtls::oid::asn1\_rs::OctetString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.OctetString.html) * [mtls::oid::asn1\_rs::Oid](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.Oid.html) * [mtls::oid::asn1\_rs::OptTaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.OptTaggedParser.html) * [mtls::oid::asn1\_rs::PrintableString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.PrintableString.html) * [mtls::oid::asn1\_rs::Sequence](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.Sequence.html) * [mtls::oid::asn1\_rs::SequenceIterator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.SequenceIterator.html) * [mtls::oid::asn1\_rs::SequenceOf](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.SequenceOf.html) * [mtls::oid::asn1\_rs::Set](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.Set.html) * [mtls::oid::asn1\_rs::SetOf](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.SetOf.html) * [mtls::oid::asn1\_rs::Tag](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.Tag.html) * [mtls::oid::asn1\_rs::TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html) * [mtls::oid::asn1\_rs::TaggedParserBuilder](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParserBuilder.html) * [mtls::oid::asn1\_rs::TaggedValue](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedValue.html) * [mtls::oid::asn1\_rs::TeletexString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TeletexString.html) * [mtls::oid::asn1\_rs::UniversalString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.UniversalString.html) * [mtls::oid::asn1\_rs::UtcTime](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.UtcTime.html) * [mtls::oid::asn1\_rs::Utf8String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.Utf8String.html) * [mtls::oid::asn1\_rs::VideotexString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.VideotexString.html) * [mtls::oid::asn1\_rs::VisibleString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.VisibleString.html) * [mtls::oid::asn1\_rs::nom::And](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/struct.And.html) * [mtls::oid::asn1\_rs::nom::AndThen](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/struct.AndThen.html) * [mtls::oid::asn1\_rs::nom::FlatMap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/struct.FlatMap.html) * [mtls::oid::asn1\_rs::nom::Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/struct.Into.html) * [mtls::oid::asn1\_rs::nom::Map](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/struct.Map.html) * [mtls::oid::asn1\_rs::nom::Or](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/struct.Or.html) * [mtls::oid::asn1\_rs::nom::combinator::ParserIterator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/struct.ParserIterator.html) * [mtls::oid::asn1\_rs::nom::error::Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/error/struct.Error.html) * [mtls::oid::asn1\_rs::nom::error::VerboseError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/error/struct.VerboseError.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::AllocError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/struct.AllocError.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::Global](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/struct.Global.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::Layout](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/struct.Layout.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::LayoutError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/struct.LayoutError.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::System](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/struct.System.html) * [mtls::oid::asn1\_rs::nom::lib::std::boxed::Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html) * [mtls::oid::asn1\_rs::nom::lib::std::boxed::ThinBox](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.ThinBox.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::Reverse](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/struct.Reverse.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::BTreeMap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.BTreeMap.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::BTreeSet](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.BTreeSet.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::BinaryHeap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.BinaryHeap.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::HashMap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.HashMap.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::HashSet](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.HashSet.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::LinkedList](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.LinkedList.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::TryReserveError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.TryReserveError.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::VecDeque](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.VecDeque.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::binary\_heap::BinaryHeap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/binary_heap/struct.BinaryHeap.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::binary\_heap::Drain](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/binary_heap/struct.Drain.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::binary\_heap::DrainSorted](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/binary_heap/struct.DrainSorted.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::binary\_heap::IntoIter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/binary_heap/struct.IntoIter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::binary\_heap::IntoIterSorted](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/binary_heap/struct.IntoIterSorted.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::binary\_heap::Iter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/binary_heap/struct.Iter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::binary\_heap::PeekMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/binary_heap/struct.PeekMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::BTreeMap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.BTreeMap.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::Cursor](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.Cursor.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::CursorMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.CursorMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::CursorMutKey](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.CursorMutKey.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::ExtractIf](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.ExtractIf.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::IntoIter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.IntoIter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::IntoKeys](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.IntoKeys.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::IntoValues](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.IntoValues.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::Iter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.Iter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::IterMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.IterMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::Keys](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.Keys.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::OccupiedEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.OccupiedEntry.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::OccupiedError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.OccupiedError.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::Range](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.Range.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::RangeMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.RangeMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::UnorderedKeyError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.UnorderedKeyError.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::VacantEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.VacantEntry.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::Values](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.Values.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::ValuesMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/struct.ValuesMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::BTreeSet](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.BTreeSet.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::Cursor](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.Cursor.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::CursorMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.CursorMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::CursorMutKey](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.CursorMutKey.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::Difference](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.Difference.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::ExtractIf](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.ExtractIf.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::Intersection](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.Intersection.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::IntoIter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.IntoIter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::Iter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.Iter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::OccupiedEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.OccupiedEntry.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::Range](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.Range.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::SymmetricDifference](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.SymmetricDifference.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::Union](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.Union.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::UnorderedKeyError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.UnorderedKeyError.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::VacantEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/struct.VacantEntry.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::DefaultHasher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.DefaultHasher.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::Drain](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.Drain.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::ExtractIf](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.ExtractIf.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::HashMap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.HashMap.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::IntoIter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.IntoIter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::IntoKeys](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.IntoKeys.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::IntoValues](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.IntoValues.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::Iter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.Iter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::IterMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.IterMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::Keys](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.Keys.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::OccupiedEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.OccupiedEntry.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::OccupiedError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.OccupiedError.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::RandomState](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.RandomState.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::VacantEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.VacantEntry.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::Values](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.Values.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::ValuesMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/struct.ValuesMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_set::Difference](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_set/struct.Difference.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_set::Drain](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_set/struct.Drain.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_set::ExtractIf](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_set/struct.ExtractIf.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_set::HashSet](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_set/struct.HashSet.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_set::Intersection](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_set/struct.Intersection.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_set::IntoIter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_set/struct.IntoIter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_set::Iter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_set/struct.Iter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_set::OccupiedEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_set/struct.OccupiedEntry.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_set::SymmetricDifference](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_set/struct.SymmetricDifference.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_set::Union](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_set/struct.Union.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_set::VacantEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_set/struct.VacantEntry.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::linked\_list::Cursor](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/linked_list/struct.Cursor.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::linked\_list::CursorMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/linked_list/struct.CursorMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::linked\_list::ExtractIf](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/linked_list/struct.ExtractIf.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::linked\_list::IntoIter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/linked_list/struct.IntoIter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::linked\_list::Iter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/linked_list/struct.Iter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::linked\_list::IterMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/linked_list/struct.IterMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::linked\_list::LinkedList](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/linked_list/struct.LinkedList.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::vec\_deque::Drain](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/vec_deque/struct.Drain.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::vec\_deque::ExtractIf](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/vec_deque/struct.ExtractIf.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::vec\_deque::IntoIter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/vec_deque/struct.IntoIter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::vec\_deque::Iter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/vec_deque/struct.Iter.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::vec\_deque::IterMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/vec_deque/struct.IterMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::vec\_deque::VecDeque](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/vec_deque/struct.VecDeque.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::Arguments](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Arguments.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::DebugList](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.DebugList.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::DebugMap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.DebugMap.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::DebugSet](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.DebugSet.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::DebugStruct](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.DebugStruct.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::DebugTuple](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.DebugTuple.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Error.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::FormattingOptions](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.FormattingOptions.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::FromFn](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.FromFn.html) * [mtls::oid::asn1\_rs::nom::lib::std::hash::BuildHasherDefault](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/struct.BuildHasherDefault.html) * [mtls::oid::asn1\_rs::nom::lib::std::hash::DefaultHasher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/struct.DefaultHasher.html) * [mtls::oid::asn1\_rs::nom::lib::std::hash::RandomState](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/struct.RandomState.html) * [mtls::oid::asn1\_rs::nom::lib::std::hash::SipHasher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/struct.SipHasher.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::ArrayChunks](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.ArrayChunks.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::ByRefSized](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.ByRefSized.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Chain](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Chain.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Cloned](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Cloned.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Copied](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Copied.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Cycle](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Cycle.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Empty](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Empty.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Enumerate](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Enumerate.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Filter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Filter.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::FilterMap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.FilterMap.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::FlatMap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.FlatMap.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Flatten](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Flatten.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::FromCoroutine](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.FromCoroutine.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::FromFn](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.FromFn.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Fuse](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Fuse.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Inspect](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Inspect.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Intersperse](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Intersperse.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::IntersperseWith](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.IntersperseWith.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Map](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Map.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::MapWhile](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.MapWhile.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::MapWindows](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.MapWindows.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Once](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Once.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::OnceWith](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.OnceWith.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Peekable](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Peekable.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Repeat](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Repeat.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::RepeatN](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.RepeatN.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::RepeatWith](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.RepeatWith.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Rev](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Rev.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Scan](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Scan.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Skip](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Skip.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::SkipWhile](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.SkipWhile.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::StepBy](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.StepBy.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Successors](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Successors.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Take](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Take.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::TakeWhile](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.TakeWhile.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Zip](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/struct.Zip.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::Assume](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/struct.Assume.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::Discriminant](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/struct.Discriminant.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::DropGuard](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/struct.DropGuard.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::ManuallyDrop](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/struct.ManuallyDrop.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::MaybeDangling](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/struct.MaybeDangling.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Range](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.Range.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::RangeFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.RangeFrom.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::RangeFull](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.RangeFull.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::RangeInclusive](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.RangeInclusive.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::RangeTo](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.RangeTo.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::RangeToInclusive](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.RangeToInclusive.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Yeet](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.Yeet.html) * [mtls::oid::asn1\_rs::nom::lib::std::option::IntoIter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/struct.IntoIter.html) * [mtls::oid::asn1\_rs::nom::lib::std::option::Iter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/struct.Iter.html) * [mtls::oid::asn1\_rs::nom::lib::std::option::IterMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/struct.IterMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::option::OptionFlatten](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/struct.OptionFlatten.html) * [mtls::oid::asn1\_rs::nom::lib::std::result::IntoIter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/struct.IntoIter.html) * [mtls::oid::asn1\_rs::nom::lib::std::result::Iter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/struct.Iter.html) * [mtls::oid::asn1\_rs::nom::lib::std::result::IterMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/struct.IterMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::ArrayWindows](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.ArrayWindows.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::ChunkBy](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.ChunkBy.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::ChunkByMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.ChunkByMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::Chunks](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.Chunks.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::ChunksExact](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.ChunksExact.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::ChunksExactMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.ChunksExactMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::ChunksMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.ChunksMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::EscapeAscii](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.EscapeAscii.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::Iter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.Iter.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::IterMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.IterMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::RChunks](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.RChunks.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::RChunksExact](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.RChunksExact.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::RChunksExactMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.RChunksExactMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::RChunksMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.RChunksMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::RSplit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.RSplit.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::RSplitMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.RSplitMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::RSplitN](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.RSplitN.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::RSplitNMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.RSplitNMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::Split](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.Split.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::SplitInclusive](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.SplitInclusive.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::SplitInclusiveMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.SplitInclusiveMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::SplitMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.SplitMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::SplitN](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.SplitN.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::SplitNMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.SplitNMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::Windows](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/struct.Windows.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::Bytes](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.Bytes.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::CharIndices](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.CharIndices.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::Chars](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.Chars.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::EncodeUtf16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.EncodeUtf16.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::EscapeDebug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.EscapeDebug.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::EscapeDefault](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.EscapeDefault.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::EscapeUnicode](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.EscapeUnicode.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::Lines](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.Lines.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::LinesAny](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.LinesAny.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::MatchIndices](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.MatchIndices.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::Matches](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.Matches.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::ParseBoolError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.ParseBoolError.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::RMatchIndices](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.RMatchIndices.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::RMatches](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.RMatches.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::RSplit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.RSplit.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::RSplitN](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.RSplitN.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::RSplitTerminator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.RSplitTerminator.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::Split](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.Split.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::SplitAsciiWhitespace](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.SplitAsciiWhitespace.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::SplitInclusive](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.SplitInclusive.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::SplitN](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.SplitN.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::SplitTerminator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.SplitTerminator.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::SplitWhitespace](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.SplitWhitespace.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::Utf8Chunk](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.Utf8Chunk.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::Utf8Chunks](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.Utf8Chunks.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::Utf8Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/struct.Utf8Error.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::pattern::CharArrayRefSearcher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/pattern/struct.CharArrayRefSearcher.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::pattern::CharArraySearcher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/pattern/struct.CharArraySearcher.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::pattern::CharPredicateSearcher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/pattern/struct.CharPredicateSearcher.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::pattern::CharSearcher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/pattern/struct.CharSearcher.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::pattern::CharSliceSearcher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/pattern/struct.CharSliceSearcher.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::pattern::StrSearcher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/pattern/struct.StrSearcher.html) * [mtls::oid::asn1\_rs::nom::lib::std::string::Drain](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.Drain.html) * [mtls::oid::asn1\_rs::nom::lib::std::string::FromUtf16Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.FromUtf16Error.html) * [mtls::oid::asn1\_rs::nom::lib::std::string::FromUtf8Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.FromUtf8Error.html) * [mtls::oid::asn1\_rs::nom::lib::std::string::IntoChars](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.IntoChars.html) * [mtls::oid::asn1\_rs::nom::lib::std::string::String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html) * [mtls::oid::asn1\_rs::nom::lib::std::vec::Drain](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/vec/struct.Drain.html) * [mtls::oid::asn1\_rs::nom::lib::std::vec::ExtractIf](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/vec/struct.ExtractIf.html) * [mtls::oid::asn1\_rs::nom::lib::std::vec::IntoIter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/vec/struct.IntoIter.html) * [mtls::oid::asn1\_rs::nom::lib::std::vec::PeekMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/vec/struct.PeekMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::vec::Splice](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/vec/struct.Splice.html) * [mtls::oid::asn1\_rs::nom::lib::std::vec::Vec](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/vec/struct.Vec.html) * [mtls::x509::ASN1Time](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.ASN1Time.html) * [mtls::x509::AccessDescription](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.AccessDescription.html) * [mtls::x509::AlgorithmIdentifier](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.AlgorithmIdentifier.html) * [mtls::x509::AttributeTypeAndValue](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.AttributeTypeAndValue.html) * [mtls::x509::AuthorityInfoAccess](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.AuthorityInfoAccess.html) * [mtls::x509::AuthorityKeyIdentifier](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.AuthorityKeyIdentifier.html) * [mtls::x509::BasicConstraints](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.BasicConstraints.html) * [mtls::x509::BasicExtension](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.BasicExtension.html) * [mtls::x509::CRLDistributionPoint](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.CRLDistributionPoint.html) * [mtls::x509::CertificateRevocationList](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.CertificateRevocationList.html) * [mtls::x509::CtExtensions](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.CtExtensions.html) * [mtls::x509::CtLogID](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.CtLogID.html) * [mtls::x509::CtVersion](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.CtVersion.html) * [mtls::x509::DigitallySigned](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.DigitallySigned.html) * [mtls::x509::ExtendedKeyUsage](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.ExtendedKeyUsage.html) * [mtls::x509::ExtensionRequest](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.ExtensionRequest.html) * [mtls::x509::GeneralSubtree](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.GeneralSubtree.html) * [mtls::x509::InhibitAnyPolicy](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.InhibitAnyPolicy.html) * [mtls::x509::IssuerAlternativeName](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.IssuerAlternativeName.html) * [mtls::x509::KeyIdentifier](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.KeyIdentifier.html) * [mtls::x509::KeyUsage](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.KeyUsage.html) * [mtls::x509::NSCertType](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.NSCertType.html) * [mtls::x509::NameConstraints](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.NameConstraints.html) * [mtls::x509::NidError](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.NidError.html) * [mtls::x509::PolicyConstraints](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.PolicyConstraints.html) * [mtls::x509::PolicyInformation](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.PolicyInformation.html) * [mtls::x509::PolicyMapping](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.PolicyMapping.html) * [mtls::x509::PolicyMappings](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.PolicyMappings.html) * [mtls::x509::PolicyQualifierInfo](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.PolicyQualifierInfo.html) * [mtls::x509::ReasonCode](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.ReasonCode.html) * [mtls::x509::ReasonFlags](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.ReasonFlags.html) * [mtls::x509::RelativeDistinguishedName](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.RelativeDistinguishedName.html) * [mtls::x509::RevokedCertificate](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.RevokedCertificate.html) * [mtls::x509::SignedCertificateTimestamp](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.SignedCertificateTimestamp.html) * [mtls::x509::SubjectAlternativeName](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.SubjectAlternativeName.html) * [mtls::x509::SubjectPublicKeyInfo](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.SubjectPublicKeyInfo.html) * [mtls::x509::TbsCertList](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.TbsCertList.html) * [mtls::x509::TbsCertificate](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.TbsCertificate.html) * [mtls::x509::TbsCertificateParser](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.TbsCertificateParser.html) * [mtls::x509::UniqueIdentifier](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.UniqueIdentifier.html) * [mtls::x509::UnparsedObject](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.UnparsedObject.html) * [mtls::x509::Validity](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.Validity.html) * [mtls::x509::X509Certificate](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.X509Certificate.html) * [mtls::x509::X509CertificateParser](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.X509CertificateParser.html) * [mtls::x509::X509CriAttribute](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.X509CriAttribute.html) * [mtls::x509::X509Extension](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.X509Extension.html) * [mtls::x509::X509ExtensionParser](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.X509ExtensionParser.html) * [mtls::x509::X509Name](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.X509Name.html) * [mtls::x509::X509Version](https://api.rocket.rs/v0.5/rocket/mtls/x509/struct.X509Version.html) * [mtls::x509::ber::BerObject](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/struct.BerObject.html) * [mtls::x509::ber::BerObjectIntoIterator](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/struct.BerObjectIntoIterator.html) * [mtls::x509::ber::BerObjectRefIterator](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/struct.BerObjectRefIterator.html) * [mtls::x509::ber::BitStringObject](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/struct.BitStringObject.html) * [mtls::x509::ber::Header](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/struct.Header.html) * [mtls::x509::ber::PrettyBer](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/struct.PrettyBer.html) * [mtls::x509::ber::Tag](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/struct.Tag.html) * [mtls::x509::ber::compat::Tag](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/compat/struct.Tag.html) * [mtls::x509::der::Header](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/struct.Header.html) * [mtls::x509::der::Tag](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/struct.Tag.html) * [request::Request](https://api.rocket.rs/v0.5/rocket/request/struct.Request.html) * [response::Body](https://api.rocket.rs/v0.5/rocket/response/struct.Body.html) * [response::Builder](https://api.rocket.rs/v0.5/rocket/response/struct.Builder.html) * [response::Debug](https://api.rocket.rs/v0.5/rocket/response/struct.Debug.html) * [response::Flash](https://api.rocket.rs/v0.5/rocket/response/struct.Flash.html) * [response::Redirect](https://api.rocket.rs/v0.5/rocket/response/struct.Redirect.html) * [response::Response](https://api.rocket.rs/v0.5/rocket/response/struct.Response.html) * [response::content::RawCss](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawCss.html) * [response::content::RawHtml](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawHtml.html) * [response::content::RawJavaScript](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawJavaScript.html) * [response::content::RawJson](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawJson.html) * [response::content::RawMsgPack](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawMsgPack.html) * [response::content::RawText](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawText.html) * [response::content::RawXml](https://api.rocket.rs/v0.5/rocket/response/content/struct.RawXml.html) * [response::status::Accepted](https://api.rocket.rs/v0.5/rocket/response/status/struct.Accepted.html) * [response::status::BadRequest](https://api.rocket.rs/v0.5/rocket/response/status/struct.BadRequest.html) * [response::status::Conflict](https://api.rocket.rs/v0.5/rocket/response/status/struct.Conflict.html) * [response::status::Created](https://api.rocket.rs/v0.5/rocket/response/status/struct.Created.html) * [response::status::Custom](https://api.rocket.rs/v0.5/rocket/response/status/struct.Custom.html) * [response::status::Forbidden](https://api.rocket.rs/v0.5/rocket/response/status/struct.Forbidden.html) * [response::status::NoContent](https://api.rocket.rs/v0.5/rocket/response/status/struct.NoContent.html) * [response::status::NotFound](https://api.rocket.rs/v0.5/rocket/response/status/struct.NotFound.html) * [response::status::Unauthorized](https://api.rocket.rs/v0.5/rocket/response/status/struct.Unauthorized.html) * [response::stream::ByteStream](https://api.rocket.rs/v0.5/rocket/response/stream/struct.ByteStream.html) * [response::stream::Event](https://api.rocket.rs/v0.5/rocket/response/stream/struct.Event.html) * [response::stream::EventStream](https://api.rocket.rs/v0.5/rocket/response/stream/struct.EventStream.html) * [response::stream::One](https://api.rocket.rs/v0.5/rocket/response/stream/struct.One.html) * [response::stream::ReaderStream](https://api.rocket.rs/v0.5/rocket/response/stream/struct.ReaderStream.html) * [response::stream::TextStream](https://api.rocket.rs/v0.5/rocket/response/stream/struct.TextStream.html) * [route::Route](https://api.rocket.rs/v0.5/rocket/route/struct.Route.html) * [route::RouteUri](https://api.rocket.rs/v0.5/rocket/route/struct.RouteUri.html) * [serde::json::Json](https://api.rocket.rs/v0.5/rocket/serde/json/struct.Json.html) * [serde::msgpack::MsgPack](https://api.rocket.rs/v0.5/rocket/serde/msgpack/struct.MsgPack.html) * [serde::uuid::Builder](https://api.rocket.rs/v0.5/rocket/serde/uuid/struct.Builder.html) * [serde::uuid::Error](https://api.rocket.rs/v0.5/rocket/serde/uuid/struct.Error.html) * [serde::uuid::Uuid](https://api.rocket.rs/v0.5/rocket/serde/uuid/struct.Uuid.html) * [serde::uuid::fmt::Braced](https://api.rocket.rs/v0.5/rocket/serde/uuid/fmt/struct.Braced.html) * [serde::uuid::fmt::Hyphenated](https://api.rocket.rs/v0.5/rocket/serde/uuid/fmt/struct.Hyphenated.html) * [serde::uuid::fmt::Simple](https://api.rocket.rs/v0.5/rocket/serde/uuid/fmt/struct.Simple.html) * [serde::uuid::fmt::Urn](https://api.rocket.rs/v0.5/rocket/serde/uuid/fmt/struct.Urn.html) * [shield::Permission](https://api.rocket.rs/v0.5/rocket/shield/struct.Permission.html) * [shield::Shield](https://api.rocket.rs/v0.5/rocket/shield/struct.Shield.html) ### Enums * [Build](https://api.rocket.rs/v0.5/rocket/enum.Build.html) * [Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html) * [Orbit](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html) * [config::CipherSuite](https://api.rocket.rs/v0.5/rocket/config/enum.CipherSuite.html) * [config::LogLevel](https://api.rocket.rs/v0.5/rocket/config/enum.LogLevel.html) * [config::Sig](https://api.rocket.rs/v0.5/rocket/config/enum.Sig.html) * [error::ErrorKind](https://api.rocket.rs/v0.5/rocket/error/enum.ErrorKind.html) * [form::error::Entity](https://api.rocket.rs/v0.5/rocket/form/error/enum.Entity.html) * [form::error::ErrorKind](https://api.rocket.rs/v0.5/rocket/form/error/enum.ErrorKind.html) * [fs::TempFile](https://api.rocket.rs/v0.5/rocket/fs/enum.TempFile.html) * [http::Method](https://api.rocket.rs/v0.5/rocket/http/enum.Method.html) * [http::SameSite](https://api.rocket.rs/v0.5/rocket/http/enum.SameSite.html) * [http::StatusClass](https://api.rocket.rs/v0.5/rocket/http/enum.StatusClass.html) * [http::uri::Uri](https://api.rocket.rs/v0.5/rocket/http/uri/enum.Uri.html) * [http::uri::error::PathError](https://api.rocket.rs/v0.5/rocket/http/uri/error/enum.PathError.html) * [http::uri::fmt::Path](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/enum.Path.html) * [http::uri::fmt::Query](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/enum.Query.html) * [mtls::Error](https://api.rocket.rs/v0.5/rocket/mtls/enum.Error.html) * [mtls::bigint::Sign](https://api.rocket.rs/v0.5/rocket/mtls/bigint/enum.Sign.html) * [mtls::oid::asn1\_rs::ASN1TimeZone](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.ASN1TimeZone.html) * [mtls::oid::asn1\_rs::Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html) * [mtls::oid::asn1\_rs::DerConstraint](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.DerConstraint.html) * [mtls::oid::asn1\_rs::Err](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Err.html) * [mtls::oid::asn1\_rs::Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Error.html) * [mtls::oid::asn1\_rs::Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html) * [mtls::oid::asn1\_rs::Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html) * [mtls::oid::asn1\_rs::Length](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Length.html) * [mtls::oid::asn1\_rs::Needed](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Needed.html) * [mtls::oid::asn1\_rs::OidParseError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.OidParseError.html) * [mtls::oid::asn1\_rs::PdvIdentification](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.PdvIdentification.html) * [mtls::oid::asn1\_rs::Real](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Real.html) * [mtls::oid::asn1\_rs::SerializeError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.SerializeError.html) * [mtls::oid::asn1\_rs::nom::CompareResult](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/enum.CompareResult.html) * [mtls::oid::asn1\_rs::nom::Err](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/enum.Err.html) * [mtls::oid::asn1\_rs::nom::Needed](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/enum.Needed.html) * [mtls::oid::asn1\_rs::nom::error::ErrorKind](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/error/enum.ErrorKind.html) * [mtls::oid::asn1\_rs::nom::error::VerboseErrorKind](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/error/enum.VerboseErrorKind.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::Ordering](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/enum.Ordering.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::Bound](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/enum.Bound.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::TryReserveErrorKind](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/enum.TryReserveErrorKind.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_map::Entry](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_map/enum.Entry.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::btree\_set::Entry](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/btree_set/enum.Entry.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_map::Entry](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_map/enum.Entry.html) * [mtls::oid::asn1\_rs::nom::lib::std::collections::hash\_set::Entry](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/hash_set/enum.Entry.html) * [mtls::oid::asn1\_rs::nom::lib::std::convert::Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::Alignment](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/enum.Alignment.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::DebugAsHex](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/enum.DebugAsHex.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::Sign](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/enum.Sign.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Bound](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/enum.Bound.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::ControlFlow](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/enum.ControlFlow.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::CoroutineState](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/enum.CoroutineState.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::OneSidedRangeBound](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/enum.OneSidedRangeBound.html) * [mtls::oid::asn1\_rs::nom::lib::std::option::Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html) * [mtls::oid::asn1\_rs::nom::lib::std::result::Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::GetDisjointMutError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/enum.GetDisjointMutError.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::pattern::SearchStep](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/pattern/enum.SearchStep.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::pattern::Utf8Pattern](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/pattern/enum.Utf8Pattern.html) * [mtls::oid::asn1\_rs::nom::number::Endianness](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/enum.Endianness.html) * [mtls::x509::DistributionPointName](https://api.rocket.rs/v0.5/rocket/mtls/x509/enum.DistributionPointName.html) * [mtls::x509::GeneralName](https://api.rocket.rs/v0.5/rocket/mtls/x509/enum.GeneralName.html) * [mtls::x509::PEMError](https://api.rocket.rs/v0.5/rocket/mtls/x509/enum.PEMError.html) * [mtls::x509::ParsedCriAttribute](https://api.rocket.rs/v0.5/rocket/mtls/x509/enum.ParsedCriAttribute.html) * [mtls::x509::ParsedExtension](https://api.rocket.rs/v0.5/rocket/mtls/x509/enum.ParsedExtension.html) * [mtls::x509::X509Error](https://api.rocket.rs/v0.5/rocket/mtls/x509/enum.X509Error.html) * [mtls::x509::ber::BerObjectContent](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/enum.BerObjectContent.html) * [mtls::x509::ber::Class](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/enum.Class.html) * [mtls::x509::ber::Length](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/enum.Length.html) * [mtls::x509::ber::PrettyPrinterFlag](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/enum.PrettyPrinterFlag.html) * [mtls::x509::der::Class](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/enum.Class.html) * [outcome::Outcome](https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html) * [serde::json::Error](https://api.rocket.rs/v0.5/rocket/serde/json/enum.Error.html) * [serde::json::Value](https://api.rocket.rs/v0.5/rocket/serde/json/enum.Value.html) * [serde::msgpack::Error](https://api.rocket.rs/v0.5/rocket/serde/msgpack/enum.Error.html) * [serde::uuid::Variant](https://api.rocket.rs/v0.5/rocket/serde/uuid/enum.Variant.html) * [serde::uuid::Version](https://api.rocket.rs/v0.5/rocket/serde/uuid/enum.Version.html) * [shield::Allow](https://api.rocket.rs/v0.5/rocket/shield/enum.Allow.html) * [shield::ExpectCt](https://api.rocket.rs/v0.5/rocket/shield/enum.ExpectCt.html) * [shield::Feature](https://api.rocket.rs/v0.5/rocket/shield/enum.Feature.html) * [shield::Frame](https://api.rocket.rs/v0.5/rocket/shield/enum.Frame.html) * [shield::Hsts](https://api.rocket.rs/v0.5/rocket/shield/enum.Hsts.html) * [shield::NoSniff](https://api.rocket.rs/v0.5/rocket/shield/enum.NoSniff.html) * [shield::Prefetch](https://api.rocket.rs/v0.5/rocket/shield/enum.Prefetch.html) * [shield::Referrer](https://api.rocket.rs/v0.5/rocket/shield/enum.Referrer.html) * [shield::XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html) ### Unions * [mtls::oid::asn1\_rs::nom::lib::std::mem::MaybeUninit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/union.MaybeUninit.html) ### Traits * [Phase](https://api.rocket.rs/v0.5/rocket/trait.Phase.html) * [Sentinel](https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html) * [catcher::Cloneable](https://api.rocket.rs/v0.5/rocket/catcher/trait.Cloneable.html) * [catcher::Handler](https://api.rocket.rs/v0.5/rocket/catcher/trait.Handler.html) * [data::FromData](https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html) * [data::IoHandler](https://api.rocket.rs/v0.5/rocket/data/trait.IoHandler.html) * [data::ToByteUnit](https://api.rocket.rs/v0.5/rocket/data/trait.ToByteUnit.html) * [fairing::Fairing](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html) * [form::FromForm](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) * [form::FromFormField](https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html) * [form::validate::Contains](https://api.rocket.rs/v0.5/rocket/form/validate/trait.Contains.html) * [form::validate::Len](https://api.rocket.rs/v0.5/rocket/form/validate/trait.Len.html) * [http::ext::IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html) * [http::ext::IntoOwned](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoOwned.html) * [http::uncased::AsUncased](https://api.rocket.rs/v0.5/rocket/http/uncased/trait.AsUncased.html) * [http::uri::fmt::FromUriParam](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.FromUriParam.html) * [http::uri::fmt::Ignorable](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.Ignorable.html) * [http::uri::fmt::Part](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.Part.html) * [http::uri::fmt::UriDisplay](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.UriDisplay.html) * [mtls::bigint::ToBigInt](https://api.rocket.rs/v0.5/rocket/mtls/bigint/trait.ToBigInt.html) * [mtls::bigint::ToBigUint](https://api.rocket.rs/v0.5/rocket/mtls/bigint/trait.ToBigUint.html) * [mtls::oid::asn1\_rs::AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html) * [mtls::oid::asn1\_rs::AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html) * [mtls::oid::asn1\_rs::BerChoice](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.BerChoice.html) * [mtls::oid::asn1\_rs::CheckDerConstraints](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.CheckDerConstraints.html) * [mtls::oid::asn1\_rs::Choice](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.Choice.html) * [mtls::oid::asn1\_rs::DerChoice](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.DerChoice.html) * [mtls::oid::asn1\_rs::DynTagged](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.DynTagged.html) * [mtls::oid::asn1\_rs::FromBer](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.FromBer.html) * [mtls::oid::asn1\_rs::FromDer](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.FromDer.html) * [mtls::oid::asn1\_rs::TagKind](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.TagKind.html) * [mtls::oid::asn1\_rs::Tagged](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.Tagged.html) * [mtls::oid::asn1\_rs::TestValidCharset](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.TestValidCharset.html) * [mtls::oid::asn1\_rs::ToDer](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.ToDer.html) * [mtls::oid::asn1\_rs::ToStatic](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.ToStatic.html) * [mtls::oid::asn1\_rs::nom::AsBytes](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.AsBytes.html) * [mtls::oid::asn1\_rs::nom::AsChar](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.AsChar.html) * [mtls::oid::asn1\_rs::nom::Compare](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.Compare.html) * [mtls::oid::asn1\_rs::nom::ErrorConvert](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.ErrorConvert.html) * [mtls::oid::asn1\_rs::nom::ExtendInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.ExtendInto.html) * [mtls::oid::asn1\_rs::nom::FindSubstring](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.FindSubstring.html) * [mtls::oid::asn1\_rs::nom::FindToken](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.FindToken.html) * [mtls::oid::asn1\_rs::nom::Finish](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.Finish.html) * [mtls::oid::asn1\_rs::nom::HexDisplay](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.HexDisplay.html) * [mtls::oid::asn1\_rs::nom::InputIter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.InputIter.html) * [mtls::oid::asn1\_rs::nom::InputLength](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.InputLength.html) * [mtls::oid::asn1\_rs::nom::InputTake](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.InputTake.html) * [mtls::oid::asn1\_rs::nom::InputTakeAtPosition](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.InputTakeAtPosition.html) * [mtls::oid::asn1\_rs::nom::Offset](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.Offset.html) * [mtls::oid::asn1\_rs::nom::ParseTo](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.ParseTo.html) * [mtls::oid::asn1\_rs::nom::Parser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.Parser.html) * [mtls::oid::asn1\_rs::nom::Slice](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.Slice.html) * [mtls::oid::asn1\_rs::nom::ToUsize](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.ToUsize.html) * [mtls::oid::asn1\_rs::nom::UnspecializedInput](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/trait.UnspecializedInput.html) * [mtls::oid::asn1\_rs::nom::branch::Alt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/branch/trait.Alt.html) * [mtls::oid::asn1\_rs::nom::branch::Permutation](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/branch/trait.Permutation.html) * [mtls::oid::asn1\_rs::nom::error::ContextError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/error/trait.ContextError.html) * [mtls::oid::asn1\_rs::nom::error::FromExternalError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/error/trait.FromExternalError.html) * [mtls::oid::asn1\_rs::nom::error::ParseError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/error/trait.ParseError.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::Allocator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/trait.Allocator.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::GlobalAlloc](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/trait.GlobalAlloc.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::Eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Eq.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::Ord](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::PartialEq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::PartialOrd](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialOrd.html) * [mtls::oid::asn1\_rs::nom::lib::std::convert::AsMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.AsMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::convert::AsRef](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.AsRef.html) * [mtls::oid::asn1\_rs::nom::lib::std::convert::FloatToInt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.FloatToInt.html) * [mtls::oid::asn1\_rs::nom::lib::std::convert::From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html) * [mtls::oid::asn1\_rs::nom::lib::std::convert::Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html) * [mtls::oid::asn1\_rs::nom::lib::std::convert::TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html) * [mtls::oid::asn1\_rs::nom::lib::std::convert::TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::Binary](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Binary.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::LowerExp](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.LowerExp.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::LowerHex](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.LowerHex.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::Octal](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Octal.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::Pointer](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Pointer.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::UpperExp](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.UpperExp.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::UpperHex](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.UpperHex.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::Write](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Write.html) * [mtls::oid::asn1\_rs::nom::lib::std::hash::BuildHasher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.BuildHasher.html) * [mtls::oid::asn1\_rs::nom::lib::std::hash::Hash](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hash.html) * [mtls::oid::asn1\_rs::nom::lib::std::hash::Hasher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hasher.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::DoubleEndedIterator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.DoubleEndedIterator.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::ExactSizeIterator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.ExactSizeIterator.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Extend](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.Extend.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::FromIterator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.FromIterator.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::FusedIterator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.FusedIterator.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::IntoIterator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.IntoIterator.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Iterator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.Iterator.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Product](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.Product.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Step](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.Step.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::Sum](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.Sum.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::TrustedLen](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.TrustedLen.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::TrustedStep](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/trait.TrustedStep.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::TransmuteFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/trait.TransmuteFrom.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Add](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Add.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::AddAssign](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.AddAssign.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::AsyncFn](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.AsyncFn.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::AsyncFnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.AsyncFnMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::AsyncFnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.AsyncFnOnce.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::BitAnd](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.BitAnd.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::BitAndAssign](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.BitAndAssign.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::BitOr](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.BitOr.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::BitOrAssign](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.BitOrAssign.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::BitXor](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.BitXor.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::BitXorAssign](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.BitXorAssign.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::CoerceShared](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.CoerceShared.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::CoerceUnsized](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.CoerceUnsized.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Coroutine](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Coroutine.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Deref](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Deref.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::DerefMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.DerefMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::DerefPure](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.DerefPure.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::DispatchFromDyn](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.DispatchFromDyn.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Div](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Div.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::DivAssign](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.DivAssign.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Drop](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Drop.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Fn](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Fn.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::FromResidual](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FromResidual.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Index](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Index.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::IndexMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.IndexMut.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::IntoBounds](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.IntoBounds.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Mul](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Mul.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::MulAssign](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.MulAssign.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Neg](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Neg.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Not](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Not.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::OneSidedRange](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.OneSidedRange.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::RangeBounds](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.RangeBounds.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Reborrow](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Reborrow.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Receiver](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Receiver.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Rem](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Rem.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::RemAssign](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.RemAssign.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Residual](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Residual.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Shl](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Shl.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::ShlAssign](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.ShlAssign.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Shr](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Shr.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::ShrAssign](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.ShrAssign.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Sub](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Sub.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::SubAssign](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.SubAssign.html) * [mtls::oid::asn1\_rs::nom::lib::std::ops::Try](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Try.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::Concat](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/trait.Concat.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::Join](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/trait.Join.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::SliceIndex](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/trait.SliceIndex.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::FromStr](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/trait.FromStr.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::pattern::DoubleEndedSearcher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/pattern/trait.DoubleEndedSearcher.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::pattern::Pattern](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/pattern/trait.Pattern.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::pattern::ReverseSearcher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/pattern/trait.ReverseSearcher.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::pattern::Searcher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/pattern/trait.Searcher.html) * [mtls::oid::asn1\_rs::nom::lib::std::string::ToString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html) * [mtls::oid::asn1\_rs::nom::sequence::Tuple](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/sequence/trait.Tuple.html) * [mtls::x509::FromDer](https://api.rocket.rs/v0.5/rocket/mtls/x509/trait.FromDer.html) * [mtls::x509::ber::Visit](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/trait.Visit.html) * [mtls::x509::ber::VisitMut](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/trait.VisitMut.html) * [outcome::IntoOutcome](https://api.rocket.rs/v0.5/rocket/outcome/trait.IntoOutcome.html) * [request::FromParam](https://api.rocket.rs/v0.5/rocket/request/trait.FromParam.html) * [request::FromRequest](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html) * [request::FromSegments](https://api.rocket.rs/v0.5/rocket/request/trait.FromSegments.html) * [response::Responder](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html) * [route::Cloneable](https://api.rocket.rs/v0.5/rocket/route/trait.Cloneable.html) * [route::Handler](https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html) * [serde::Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html) * [serde::DeserializeOwned](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned.html) * [serde::Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html) * [serde::Serialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html) * [serde::Serializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html) * [shield::Policy](https://api.rocket.rs/v0.5/rocket/shield/trait.Policy.html) ### Macros * [catchers](https://api.rocket.rs/v0.5/rocket/macro.catchers.html) * [form::validate::msg](https://api.rocket.rs/v0.5/rocket/form/validate/macro.msg.html) * [fs::relative](https://api.rocket.rs/v0.5/rocket/fs/macro.relative.html) * [http::impl\_from\_uri\_param\_identity](https://api.rocket.rs/v0.5/rocket/http/macro.impl_from_uri_param_identity.html) * [mtls::oid::asn1\_rs::int](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/macro.int.html) * [mtls::oid::asn1\_rs::nom::error\_node\_position](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/macro.error_node_position.html) * [mtls::oid::asn1\_rs::nom::error\_position](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/macro.error_position.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::iter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/macro.iter.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::offset\_of](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/macro.offset_of.html) * [mtls::oid::asn1\_rs::nom::lib::std::vec](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/macro.vec.html) * [mtls::oid::asn1\_rs::oid](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/macro.oid.html) * [outcome::try\_outcome](https://api.rocket.rs/v0.5/rocket/outcome/macro.try_outcome.html) * [request::local\_cache](https://api.rocket.rs/v0.5/rocket/request/macro.local_cache.html) * [request::local\_cache\_once](https://api.rocket.rs/v0.5/rocket/request/macro.local_cache_once.html) * [response::stream::ByteStream](https://api.rocket.rs/v0.5/rocket/response/stream/macro.ByteStream.html) * [response::stream::EventStream](https://api.rocket.rs/v0.5/rocket/response/stream/macro.EventStream.html) * [response::stream::ReaderStream](https://api.rocket.rs/v0.5/rocket/response/stream/macro.ReaderStream.html) * [response::stream::TextStream](https://api.rocket.rs/v0.5/rocket/response/stream/macro.TextStream.html) * [response::stream::stream](https://api.rocket.rs/v0.5/rocket/response/stream/macro.stream.html) * [routes](https://api.rocket.rs/v0.5/rocket/macro.routes.html) * [serde::json::json](https://api.rocket.rs/v0.5/rocket/serde/json/macro.json.html) * [serde::uuid::uuid](https://api.rocket.rs/v0.5/rocket/serde/uuid/macro.uuid.html) * [uri](https://api.rocket.rs/v0.5/rocket/macro.uri.html) ### Attribute Macros * [async\_test](https://api.rocket.rs/v0.5/rocket/attr.async_test.html) * [async\_trait](https://api.rocket.rs/v0.5/rocket/attr.async_trait.html) * [catch](https://api.rocket.rs/v0.5/rocket/attr.catch.html) * [delete](https://api.rocket.rs/v0.5/rocket/attr.delete.html) * [get](https://api.rocket.rs/v0.5/rocket/attr.get.html) * [head](https://api.rocket.rs/v0.5/rocket/attr.head.html) * [launch](https://api.rocket.rs/v0.5/rocket/attr.launch.html) * [main](https://api.rocket.rs/v0.5/rocket/attr.main.html) * [options](https://api.rocket.rs/v0.5/rocket/attr.options.html) * [patch](https://api.rocket.rs/v0.5/rocket/attr.patch.html) * [post](https://api.rocket.rs/v0.5/rocket/attr.post.html) * [put](https://api.rocket.rs/v0.5/rocket/attr.put.html) * [route](https://api.rocket.rs/v0.5/rocket/attr.route.html) ### Derive Macros * [FromForm](https://api.rocket.rs/v0.5/rocket/derive.FromForm.html) * [FromFormField](https://api.rocket.rs/v0.5/rocket/derive.FromFormField.html) * [Responder](https://api.rocket.rs/v0.5/rocket/derive.Responder.html) * [UriDisplayPath](https://api.rocket.rs/v0.5/rocket/derive.UriDisplayPath.html) * [UriDisplayQuery](https://api.rocket.rs/v0.5/rocket/derive.UriDisplayQuery.html) * [mtls::oid::asn1\_rs::BerSequence](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/derive.BerSequence.html) * [mtls::oid::asn1\_rs::DerSequence](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/derive.DerSequence.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::Eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/derive.Eq.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::Ord](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/derive.Ord.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::PartialEq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/derive.PartialEq.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::PartialOrd](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/derive.PartialOrd.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/derive.Debug.html) * [mtls::oid::asn1\_rs::nom::lib::std::hash::Hash](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/derive.Hash.html) ### Functions * [build](https://api.rocket.rs/v0.5/rocket/fn.build.html) * [custom](https://api.rocket.rs/v0.5/rocket/fn.custom.html) * [execute](https://api.rocket.rs/v0.5/rocket/fn.execute.html) * [form::validate::contains](https://api.rocket.rs/v0.5/rocket/form/validate/fn.contains.html) * [form::validate::dbg\_contains](https://api.rocket.rs/v0.5/rocket/form/validate/fn.dbg_contains.html) * [form::validate::dbg\_eq](https://api.rocket.rs/v0.5/rocket/form/validate/fn.dbg_eq.html) * [form::validate::dbg\_omits](https://api.rocket.rs/v0.5/rocket/form/validate/fn.dbg_omits.html) * [form::validate::eq](https://api.rocket.rs/v0.5/rocket/form/validate/fn.eq.html) * [form::validate::ext](https://api.rocket.rs/v0.5/rocket/form/validate/fn.ext.html) * [form::validate::len](https://api.rocket.rs/v0.5/rocket/form/validate/fn.len.html) * [form::validate::neq](https://api.rocket.rs/v0.5/rocket/form/validate/fn.neq.html) * [form::validate::omits](https://api.rocket.rs/v0.5/rocket/form/validate/fn.omits.html) * [form::validate::one\_of](https://api.rocket.rs/v0.5/rocket/form/validate/fn.one_of.html) * [form::validate::range](https://api.rocket.rs/v0.5/rocket/form/validate/fn.range.html) * [form::validate::try\_with](https://api.rocket.rs/v0.5/rocket/form/validate/fn.try_with.html) * [form::validate::with](https://api.rocket.rs/v0.5/rocket/form/validate/fn.with.html) * [http::uncased::eq](https://api.rocket.rs/v0.5/rocket/http/uncased/fn.eq.html) * [mtls::oid::asn1\_rs::nom::bits](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/fn.bits.html) * [mtls::oid::asn1\_rs::nom::bits::bits](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bits/fn.bits.html) * [mtls::oid::asn1\_rs::nom::bits::bytes](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bits/fn.bytes.html) * [mtls::oid::asn1\_rs::nom::bits::complete::bool](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bits/complete/fn.bool.html) * [mtls::oid::asn1\_rs::nom::bits::complete::tag](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bits/complete/fn.tag.html) * [mtls::oid::asn1\_rs::nom::bits::complete::take](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bits/complete/fn.take.html) * [mtls::oid::asn1\_rs::nom::bits::streaming::bool](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bits/streaming/fn.bool.html) * [mtls::oid::asn1\_rs::nom::bits::streaming::tag](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bits/streaming/fn.tag.html) * [mtls::oid::asn1\_rs::nom::bits::streaming::take](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bits/streaming/fn.take.html) * [mtls::oid::asn1\_rs::nom::branch::alt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/branch/fn.alt.html) * [mtls::oid::asn1\_rs::nom::branch::permutation](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/branch/fn.permutation.html) * [mtls::oid::asn1\_rs::nom::bytes](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/fn.bytes.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::escaped](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.escaped.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::escaped\_transform](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.escaped_transform.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::is\_a](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.is_a.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::is\_not](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.is_not.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::tag](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.tag.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::tag\_no\_case](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.tag_no_case.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::take](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.take.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::take\_till](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.take_till.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::take\_till1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.take_till1.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::take\_until](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.take_until.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::take\_until1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.take_until1.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::take\_while](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.take_while.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::take\_while1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.take_while1.html) * [mtls::oid::asn1\_rs::nom::bytes::complete::take\_while\_m\_n](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/complete/fn.take_while_m_n.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::escaped](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.escaped.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::escaped\_transform](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.escaped_transform.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::is\_a](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.is_a.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::is\_not](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.is_not.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::tag](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.tag.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::tag\_no\_case](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.tag_no_case.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::take](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.take.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::take\_till](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.take_till.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::take\_till1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.take_till1.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::take\_until](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.take_until.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::take\_until1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.take_until1.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::take\_while](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.take_while.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::take\_while1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.take_while1.html) * [mtls::oid::asn1\_rs::nom::bytes::streaming::take\_while\_m\_n](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/bytes/streaming/fn.take_while_m_n.html) * [mtls::oid::asn1\_rs::nom::character::complete::alpha0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.alpha0.html) * [mtls::oid::asn1\_rs::nom::character::complete::alpha1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.alpha1.html) * [mtls::oid::asn1\_rs::nom::character::complete::alphanumeric0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.alphanumeric0.html) * [mtls::oid::asn1\_rs::nom::character::complete::alphanumeric1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.alphanumeric1.html) * [mtls::oid::asn1\_rs::nom::character::complete::anychar](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.anychar.html) * [mtls::oid::asn1\_rs::nom::character::complete::char](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.char.html) * [mtls::oid::asn1\_rs::nom::character::complete::crlf](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.crlf.html) * [mtls::oid::asn1\_rs::nom::character::complete::digit0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.digit0.html) * [mtls::oid::asn1\_rs::nom::character::complete::digit1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.digit1.html) * [mtls::oid::asn1\_rs::nom::character::complete::hex\_digit0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.hex_digit0.html) * [mtls::oid::asn1\_rs::nom::character::complete::hex\_digit1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.hex_digit1.html) * [mtls::oid::asn1\_rs::nom::character::complete::i128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.i128.html) * [mtls::oid::asn1\_rs::nom::character::complete::i16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.i16.html) * [mtls::oid::asn1\_rs::nom::character::complete::i32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.i32.html) * [mtls::oid::asn1\_rs::nom::character::complete::i64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.i64.html) * [mtls::oid::asn1\_rs::nom::character::complete::i8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.i8.html) * [mtls::oid::asn1\_rs::nom::character::complete::line\_ending](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.line_ending.html) * [mtls::oid::asn1\_rs::nom::character::complete::multispace0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.multispace0.html) * [mtls::oid::asn1\_rs::nom::character::complete::multispace1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.multispace1.html) * [mtls::oid::asn1\_rs::nom::character::complete::newline](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.newline.html) * [mtls::oid::asn1\_rs::nom::character::complete::none\_of](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.none_of.html) * [mtls::oid::asn1\_rs::nom::character::complete::not\_line\_ending](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.not_line_ending.html) * [mtls::oid::asn1\_rs::nom::character::complete::oct\_digit0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.oct_digit0.html) * [mtls::oid::asn1\_rs::nom::character::complete::oct\_digit1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.oct_digit1.html) * [mtls::oid::asn1\_rs::nom::character::complete::one\_of](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.one_of.html) * [mtls::oid::asn1\_rs::nom::character::complete::satisfy](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.satisfy.html) * [mtls::oid::asn1\_rs::nom::character::complete::space0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.space0.html) * [mtls::oid::asn1\_rs::nom::character::complete::space1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.space1.html) * [mtls::oid::asn1\_rs::nom::character::complete::tab](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.tab.html) * [mtls::oid::asn1\_rs::nom::character::complete::u128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.u128.html) * [mtls::oid::asn1\_rs::nom::character::complete::u16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.u16.html) * [mtls::oid::asn1\_rs::nom::character::complete::u32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.u32.html) * [mtls::oid::asn1\_rs::nom::character::complete::u64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.u64.html) * [mtls::oid::asn1\_rs::nom::character::complete::u8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/complete/fn.u8.html) * [mtls::oid::asn1\_rs::nom::character::is\_alphabetic](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/fn.is_alphabetic.html) * [mtls::oid::asn1\_rs::nom::character::is\_alphanumeric](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/fn.is_alphanumeric.html) * [mtls::oid::asn1\_rs::nom::character::is\_digit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/fn.is_digit.html) * [mtls::oid::asn1\_rs::nom::character::is\_hex\_digit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/fn.is_hex_digit.html) * [mtls::oid::asn1\_rs::nom::character::is\_newline](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/fn.is_newline.html) * [mtls::oid::asn1\_rs::nom::character::is\_oct\_digit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/fn.is_oct_digit.html) * [mtls::oid::asn1\_rs::nom::character::is\_space](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/fn.is_space.html) * [mtls::oid::asn1\_rs::nom::character::streaming::alpha0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.alpha0.html) * [mtls::oid::asn1\_rs::nom::character::streaming::alpha1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.alpha1.html) * [mtls::oid::asn1\_rs::nom::character::streaming::alphanumeric0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.alphanumeric0.html) * [mtls::oid::asn1\_rs::nom::character::streaming::alphanumeric1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.alphanumeric1.html) * [mtls::oid::asn1\_rs::nom::character::streaming::anychar](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.anychar.html) * [mtls::oid::asn1\_rs::nom::character::streaming::char](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.char.html) * [mtls::oid::asn1\_rs::nom::character::streaming::crlf](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.crlf.html) * [mtls::oid::asn1\_rs::nom::character::streaming::digit0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.digit0.html) * [mtls::oid::asn1\_rs::nom::character::streaming::digit1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.digit1.html) * [mtls::oid::asn1\_rs::nom::character::streaming::hex\_digit0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.hex_digit0.html) * [mtls::oid::asn1\_rs::nom::character::streaming::hex\_digit1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.hex_digit1.html) * [mtls::oid::asn1\_rs::nom::character::streaming::i128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.i128.html) * [mtls::oid::asn1\_rs::nom::character::streaming::i16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.i16.html) * [mtls::oid::asn1\_rs::nom::character::streaming::i32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.i32.html) * [mtls::oid::asn1\_rs::nom::character::streaming::i64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.i64.html) * [mtls::oid::asn1\_rs::nom::character::streaming::i8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.i8.html) * [mtls::oid::asn1\_rs::nom::character::streaming::line\_ending](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.line_ending.html) * [mtls::oid::asn1\_rs::nom::character::streaming::multispace0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.multispace0.html) * [mtls::oid::asn1\_rs::nom::character::streaming::multispace1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.multispace1.html) * [mtls::oid::asn1\_rs::nom::character::streaming::newline](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.newline.html) * [mtls::oid::asn1\_rs::nom::character::streaming::none\_of](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.none_of.html) * [mtls::oid::asn1\_rs::nom::character::streaming::not\_line\_ending](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.not_line_ending.html) * [mtls::oid::asn1\_rs::nom::character::streaming::oct\_digit0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.oct_digit0.html) * [mtls::oid::asn1\_rs::nom::character::streaming::oct\_digit1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.oct_digit1.html) * [mtls::oid::asn1\_rs::nom::character::streaming::one\_of](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.one_of.html) * [mtls::oid::asn1\_rs::nom::character::streaming::satisfy](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.satisfy.html) * [mtls::oid::asn1\_rs::nom::character::streaming::space0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.space0.html) * [mtls::oid::asn1\_rs::nom::character::streaming::space1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.space1.html) * [mtls::oid::asn1\_rs::nom::character::streaming::tab](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.tab.html) * [mtls::oid::asn1\_rs::nom::character::streaming::u128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.u128.html) * [mtls::oid::asn1\_rs::nom::character::streaming::u16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.u16.html) * [mtls::oid::asn1\_rs::nom::character::streaming::u32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.u32.html) * [mtls::oid::asn1\_rs::nom::character::streaming::u64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.u64.html) * [mtls::oid::asn1\_rs::nom::character::streaming::u8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/character/streaming/fn.u8.html) * [mtls::oid::asn1\_rs::nom::combinator::all\_consuming](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.all_consuming.html) * [mtls::oid::asn1\_rs::nom::combinator::complete](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.complete.html) * [mtls::oid::asn1\_rs::nom::combinator::cond](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.cond.html) * [mtls::oid::asn1\_rs::nom::combinator::consumed](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.consumed.html) * [mtls::oid::asn1\_rs::nom::combinator::cut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.cut.html) * [mtls::oid::asn1\_rs::nom::combinator::eof](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.eof.html) * [mtls::oid::asn1\_rs::nom::combinator::fail](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.fail.html) * [mtls::oid::asn1\_rs::nom::combinator::flat\_map](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.flat_map.html) * [mtls::oid::asn1\_rs::nom::combinator::into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.into.html) * [mtls::oid::asn1\_rs::nom::combinator::iterator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.iterator.html) * [mtls::oid::asn1\_rs::nom::combinator::map](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.map.html) * [mtls::oid::asn1\_rs::nom::combinator::map\_opt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.map_opt.html) * [mtls::oid::asn1\_rs::nom::combinator::map\_parser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.map_parser.html) * [mtls::oid::asn1\_rs::nom::combinator::map\_res](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.map_res.html) * [mtls::oid::asn1\_rs::nom::combinator::not](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.not.html) * [mtls::oid::asn1\_rs::nom::combinator::opt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.opt.html) * [mtls::oid::asn1\_rs::nom::combinator::peek](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.peek.html) * [mtls::oid::asn1\_rs::nom::combinator::recognize](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.recognize.html) * [mtls::oid::asn1\_rs::nom::combinator::rest](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.rest.html) * [mtls::oid::asn1\_rs::nom::combinator::rest\_len](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.rest_len.html) * [mtls::oid::asn1\_rs::nom::combinator::success](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.success.html) * [mtls::oid::asn1\_rs::nom::combinator::value](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.value.html) * [mtls::oid::asn1\_rs::nom::combinator::verify](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/combinator/fn.verify.html) * [mtls::oid::asn1\_rs::nom::error::append\_error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/error/fn.append_error.html) * [mtls::oid::asn1\_rs::nom::error::context](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/error/fn.context.html) * [mtls::oid::asn1\_rs::nom::error::convert\_error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/error/fn.convert_error.html) * [mtls::oid::asn1\_rs::nom::error::dbg\_dmp](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/error/fn.dbg_dmp.html) * [mtls::oid::asn1\_rs::nom::error::error\_to\_u32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/error/fn.error_to_u32.html) * [mtls::oid::asn1\_rs::nom::error::make\_error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/error/fn.make_error.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::alloc](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/fn.alloc.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::alloc\_zeroed](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/fn.alloc_zeroed.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::dealloc](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/fn.dealloc.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::handle\_alloc\_error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/fn.handle_alloc_error.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::realloc](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/fn.realloc.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::set\_alloc\_error\_hook](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/fn.set_alloc_error_hook.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::take\_alloc\_error\_hook](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/fn.take_alloc_error_hook.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::max](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/fn.max.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::max\_by](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/fn.max_by.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::max\_by\_key](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/fn.max_by_key.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::min](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/fn.min.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::min\_by](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/fn.min_by.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::min\_by\_key](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/fn.min_by_key.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::minmax](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/fn.minmax.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::minmax\_by](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/fn.minmax_by.html) * [mtls::oid::asn1\_rs::nom::lib::std::cmp::minmax\_by\_key](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/fn.minmax_by_key.html) * [mtls::oid::asn1\_rs::nom::lib::std::convert::identity](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/fn.identity.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::format](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/fn.format.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::from\_fn](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/fn.from_fn.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::write](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/fn.write.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::chain](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/fn.chain.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::empty](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/fn.empty.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::from\_coroutine](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/fn.from_coroutine.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::from\_fn](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/fn.from_fn.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::once](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/fn.once.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::once\_with](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/fn.once_with.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::repeat](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/fn.repeat.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::repeat\_n](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/fn.repeat_n.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::repeat\_with](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/fn.repeat_with.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::successors](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/fn.successors.html) * [mtls::oid::asn1\_rs::nom::lib::std::iter::zip](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/iter/fn.zip.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::align\_of](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.align_of.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::align\_of\_val](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.align_of_val.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::align\_of\_val\_raw](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.align_of_val_raw.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::conjure\_zst](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.conjure_zst.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::copy](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.copy.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::discriminant](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.discriminant.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::drop](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.drop.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::forget](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.forget.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::forget\_unsized](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.forget_unsized.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::min\_align\_of](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.min_align_of.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::min\_align\_of\_val](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.min_align_of_val.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::needs\_drop](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.needs_drop.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::replace](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.replace.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::size\_of](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.size_of.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::size\_of\_val](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.size_of_val.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::size\_of\_val\_raw](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.size_of_val_raw.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::swap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.swap.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::take](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.take.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::transmute](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.transmute.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::transmute\_copy](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.transmute_copy.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::uninitialized](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.uninitialized.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::variant\_count](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.variant_count.html) * [mtls::oid::asn1\_rs::nom::lib::std::mem::zeroed](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/mem/fn.zeroed.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::from\_mut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/fn.from_mut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::from\_mut\_ptr\_range](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/fn.from_mut_ptr_range.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::from\_ptr\_range](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/fn.from_ptr_range.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::from\_raw\_parts](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/fn.from_raw_parts.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::from\_raw\_parts\_mut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/fn.from_raw_parts_mut.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::from\_ref](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/fn.from_ref.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::range](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/fn.range.html) * [mtls::oid::asn1\_rs::nom::lib::std::slice::try\_range](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/slice/fn.try_range.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::from\_boxed\_utf8\_unchecked](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/fn.from_boxed_utf8_unchecked.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::from\_raw\_parts](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/fn.from_raw_parts.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::from\_raw\_parts\_mut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/fn.from_raw_parts_mut.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::from\_utf8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/fn.from_utf8.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::from\_utf8\_mut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/fn.from_utf8_mut.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::from\_utf8\_unchecked](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/fn.from_utf8_unchecked.html) * [mtls::oid::asn1\_rs::nom::lib::std::str::from\_utf8\_unchecked\_mut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/str/fn.from_utf8_unchecked_mut.html) * [mtls::oid::asn1\_rs::nom::multi::count](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.count.html) * [mtls::oid::asn1\_rs::nom::multi::fill](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.fill.html) * [mtls::oid::asn1\_rs::nom::multi::fold\_many0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.fold_many0.html) * [mtls::oid::asn1\_rs::nom::multi::fold\_many1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.fold_many1.html) * [mtls::oid::asn1\_rs::nom::multi::fold\_many\_m\_n](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.fold_many_m_n.html) * [mtls::oid::asn1\_rs::nom::multi::length\_count](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.length_count.html) * [mtls::oid::asn1\_rs::nom::multi::length\_data](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.length_data.html) * [mtls::oid::asn1\_rs::nom::multi::length\_value](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.length_value.html) * [mtls::oid::asn1\_rs::nom::multi::many0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.many0.html) * [mtls::oid::asn1\_rs::nom::multi::many0\_count](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.many0_count.html) * [mtls::oid::asn1\_rs::nom::multi::many1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.many1.html) * [mtls::oid::asn1\_rs::nom::multi::many1\_count](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.many1_count.html) * [mtls::oid::asn1\_rs::nom::multi::many\_m\_n](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.many_m_n.html) * [mtls::oid::asn1\_rs::nom::multi::many\_till](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.many_till.html) * [mtls::oid::asn1\_rs::nom::multi::separated\_list0](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.separated_list0.html) * [mtls::oid::asn1\_rs::nom::multi::separated\_list1](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/multi/fn.separated_list1.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_f32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_f32.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_f64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_f64.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_i128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_i128.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_i16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_i16.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_i24](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_i24.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_i32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_i32.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_i64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_i64.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_i8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_i8.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_u128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_u128.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_u16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_u16.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_u24](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_u24.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_u32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_u32.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_u64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_u64.html) * [mtls::oid::asn1\_rs::nom::number::complete::be\_u8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.be_u8.html) * [mtls::oid::asn1\_rs::nom::number::complete::double](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.double.html) * [mtls::oid::asn1\_rs::nom::number::complete::f32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.f32.html) * [mtls::oid::asn1\_rs::nom::number::complete::f64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.f64.html) * [mtls::oid::asn1\_rs::nom::number::complete::float](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.float.html) * [mtls::oid::asn1\_rs::nom::number::complete::hex\_u32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.hex_u32.html) * [mtls::oid::asn1\_rs::nom::number::complete::i128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.i128.html) * [mtls::oid::asn1\_rs::nom::number::complete::i16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.i16.html) * [mtls::oid::asn1\_rs::nom::number::complete::i24](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.i24.html) * [mtls::oid::asn1\_rs::nom::number::complete::i32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.i32.html) * [mtls::oid::asn1\_rs::nom::number::complete::i64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.i64.html) * [mtls::oid::asn1\_rs::nom::number::complete::i8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.i8.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_f32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_f32.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_f64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_f64.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_i128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_i128.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_i16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_i16.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_i24](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_i24.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_i32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_i32.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_i64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_i64.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_i8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_i8.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_u128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_u128.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_u16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_u16.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_u24](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_u24.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_u32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_u32.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_u64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_u64.html) * [mtls::oid::asn1\_rs::nom::number::complete::le\_u8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.le_u8.html) * [mtls::oid::asn1\_rs::nom::number::complete::recognize\_float](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.recognize_float.html) * [mtls::oid::asn1\_rs::nom::number::complete::recognize\_float\_parts](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.recognize_float_parts.html) * [mtls::oid::asn1\_rs::nom::number::complete::u128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.u128.html) * [mtls::oid::asn1\_rs::nom::number::complete::u16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.u16.html) * [mtls::oid::asn1\_rs::nom::number::complete::u24](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.u24.html) * [mtls::oid::asn1\_rs::nom::number::complete::u32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.u32.html) * [mtls::oid::asn1\_rs::nom::number::complete::u64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.u64.html) * [mtls::oid::asn1\_rs::nom::number::complete::u8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/complete/fn.u8.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_f32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_f32.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_f64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_f64.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_i128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_i128.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_i16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_i16.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_i24](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_i24.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_i32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_i32.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_i64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_i64.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_i8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_i8.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_u128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_u128.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_u16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_u16.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_u24](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_u24.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_u32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_u32.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_u64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_u64.html) * [mtls::oid::asn1\_rs::nom::number::streaming::be\_u8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.be_u8.html) * [mtls::oid::asn1\_rs::nom::number::streaming::double](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.double.html) * [mtls::oid::asn1\_rs::nom::number::streaming::f32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.f32.html) * [mtls::oid::asn1\_rs::nom::number::streaming::f64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.f64.html) * [mtls::oid::asn1\_rs::nom::number::streaming::float](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.float.html) * [mtls::oid::asn1\_rs::nom::number::streaming::hex\_u32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.hex_u32.html) * [mtls::oid::asn1\_rs::nom::number::streaming::i128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.i128.html) * [mtls::oid::asn1\_rs::nom::number::streaming::i16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.i16.html) * [mtls::oid::asn1\_rs::nom::number::streaming::i24](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.i24.html) * [mtls::oid::asn1\_rs::nom::number::streaming::i32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.i32.html) * [mtls::oid::asn1\_rs::nom::number::streaming::i64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.i64.html) * [mtls::oid::asn1\_rs::nom::number::streaming::i8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.i8.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_f32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_f32.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_f64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_f64.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_i128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_i128.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_i16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_i16.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_i24](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_i24.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_i32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_i32.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_i64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_i64.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_i8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_i8.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_u128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_u128.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_u16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_u16.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_u24](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_u24.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_u32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_u32.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_u64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_u64.html) * [mtls::oid::asn1\_rs::nom::number::streaming::le\_u8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.le_u8.html) * [mtls::oid::asn1\_rs::nom::number::streaming::recognize\_float](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.recognize_float.html) * [mtls::oid::asn1\_rs::nom::number::streaming::recognize\_float\_parts](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.recognize_float_parts.html) * [mtls::oid::asn1\_rs::nom::number::streaming::u128](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.u128.html) * [mtls::oid::asn1\_rs::nom::number::streaming::u16](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.u16.html) * [mtls::oid::asn1\_rs::nom::number::streaming::u24](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.u24.html) * [mtls::oid::asn1\_rs::nom::number::streaming::u32](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.u32.html) * [mtls::oid::asn1\_rs::nom::number::streaming::u64](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.u64.html) * [mtls::oid::asn1\_rs::nom::number::streaming::u8](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/number/streaming/fn.u8.html) * [mtls::oid::asn1\_rs::nom::sequence::delimited](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/sequence/fn.delimited.html) * [mtls::oid::asn1\_rs::nom::sequence::pair](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/sequence/fn.pair.html) * [mtls::oid::asn1\_rs::nom::sequence::preceded](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/sequence/fn.preceded.html) * [mtls::oid::asn1\_rs::nom::sequence::separated\_pair](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/sequence/fn.separated_pair.html) * [mtls::oid::asn1\_rs::nom::sequence::terminated](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/sequence/fn.terminated.html) * [mtls::oid::asn1\_rs::nom::sequence::tuple](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/sequence/fn.tuple.html) * [mtls::oid::asn1\_rs::parse\_der\_tagged\_explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/fn.parse_der_tagged_explicit.html) * [mtls::oid::asn1\_rs::parse\_der\_tagged\_explicit\_g](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/fn.parse_der_tagged_explicit_g.html) * [mtls::oid::asn1\_rs::parse\_der\_tagged\_implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/fn.parse_der_tagged_implicit.html) * [mtls::oid::asn1\_rs::parse\_der\_tagged\_implicit\_g](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/fn.parse_der_tagged_implicit_g.html) * [mtls::oid::format\_oid](https://api.rocket.rs/v0.5/rocket/mtls/oid/fn.format_oid.html) * [mtls::oid::generate\_file](https://api.rocket.rs/v0.5/rocket/mtls/oid/fn.generate_file.html) * [mtls::oid::load\_file](https://api.rocket.rs/v0.5/rocket/mtls/oid/fn.load_file.html) * [mtls::oid::oid2abbrev](https://api.rocket.rs/v0.5/rocket/mtls/oid/fn.oid2abbrev.html) * [mtls::oid::oid2description](https://api.rocket.rs/v0.5/rocket/mtls/oid/fn.oid2description.html) * [mtls::oid::oid2sn](https://api.rocket.rs/v0.5/rocket/mtls/oid/fn.oid2sn.html) * [mtls::oid::oid\_registry](https://api.rocket.rs/v0.5/rocket/mtls/oid/fn.oid_registry.html) * [mtls::x509::ber::ber\_read\_element\_content\_as](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.ber_read_element_content_as.html) * [mtls::x509::ber::ber\_read\_element\_header](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.ber_read_element_header.html) * [mtls::x509::ber::parse\_ber](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber.html) * [mtls::x509::ber::parse\_ber\_any](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_any.html) * [mtls::x509::ber::parse\_ber\_any\_r](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_any_r.html) * [mtls::x509::ber::parse\_ber\_any\_with\_tag\_r](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_any_with_tag_r.html) * [mtls::x509::ber::parse\_ber\_bitstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_bitstring.html) * [mtls::x509::ber::parse\_ber\_bmpstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_bmpstring.html) * [mtls::x509::ber::parse\_ber\_bool](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_bool.html) * [mtls::x509::ber::parse\_ber\_container](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_container.html) * [mtls::x509::ber::parse\_ber\_content](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_content.html) * [mtls::x509::ber::parse\_ber\_content2](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_content2.html) * [mtls::x509::ber::parse\_ber\_endofcontent](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_endofcontent.html) * [mtls::x509::ber::parse\_ber\_enum](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_enum.html) * [mtls::x509::ber::parse\_ber\_explicit\_optional](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_explicit_optional.html) * [mtls::x509::ber::parse\_ber\_generalizedtime](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_generalizedtime.html) * [mtls::x509::ber::parse\_ber\_generalstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_generalstring.html) * [mtls::x509::ber::parse\_ber\_graphicstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_graphicstring.html) * [mtls::x509::ber::parse\_ber\_i32](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_i32.html) * [mtls::x509::ber::parse\_ber\_i64](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_i64.html) * [mtls::x509::ber::parse\_ber\_ia5string](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_ia5string.html) * [mtls::x509::ber::parse\_ber\_implicit](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_implicit.html) * [mtls::x509::ber::parse\_ber\_integer](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_integer.html) * [mtls::x509::ber::parse\_ber\_null](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_null.html) * [mtls::x509::ber::parse\_ber\_numericstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_numericstring.html) * [mtls::x509::ber::parse\_ber\_objectdescriptor](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_objectdescriptor.html) * [mtls::x509::ber::parse\_ber\_octetstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_octetstring.html) * [mtls::x509::ber::parse\_ber\_oid](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_oid.html) * [mtls::x509::ber::parse\_ber\_optional](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_optional.html) * [mtls::x509::ber::parse\_ber\_printablestring](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_printablestring.html) * [mtls::x509::ber::parse\_ber\_recursive](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_recursive.html) * [mtls::x509::ber::parse\_ber\_relative\_oid](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_relative_oid.html) * [mtls::x509::ber::parse\_ber\_sequence](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_sequence.html) * [mtls::x509::ber::parse\_ber\_sequence\_defined](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_sequence_defined.html) * [mtls::x509::ber::parse\_ber\_sequence\_defined\_g](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_sequence_defined_g.html) * [mtls::x509::ber::parse\_ber\_sequence\_of](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_sequence_of.html) * [mtls::x509::ber::parse\_ber\_sequence\_of\_v](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_sequence_of_v.html) * [mtls::x509::ber::parse\_ber\_set](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_set.html) * [mtls::x509::ber::parse\_ber\_set\_defined](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_set_defined.html) * [mtls::x509::ber::parse\_ber\_set\_defined\_g](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_set_defined_g.html) * [mtls::x509::ber::parse\_ber\_set\_of](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_set_of.html) * [mtls::x509::ber::parse\_ber\_set\_of\_v](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_set_of_v.html) * [mtls::x509::ber::parse\_ber\_slice](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_slice.html) * [mtls::x509::ber::parse\_ber\_t61string](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_t61string.html) * [mtls::x509::ber::parse\_ber\_tagged\_explicit](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_tagged_explicit.html) * [mtls::x509::ber::parse\_ber\_tagged\_explicit\_g](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_tagged_explicit_g.html) * [mtls::x509::ber::parse\_ber\_tagged\_implicit](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_tagged_implicit.html) * [mtls::x509::ber::parse\_ber\_tagged\_implicit\_g](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_tagged_implicit_g.html) * [mtls::x509::ber::parse\_ber\_u32](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_u32.html) * [mtls::x509::ber::parse\_ber\_u64](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_u64.html) * [mtls::x509::ber::parse\_ber\_universalstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_universalstring.html) * [mtls::x509::ber::parse\_ber\_utctime](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_utctime.html) * [mtls::x509::ber::parse\_ber\_utf8string](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_utf8string.html) * [mtls::x509::ber::parse\_ber\_videotexstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_videotexstring.html) * [mtls::x509::ber::parse\_ber\_visiblestring](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_visiblestring.html) * [mtls::x509::ber::parse\_ber\_with\_tag](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/fn.parse_ber_with_tag.html) * [mtls::x509::der::der\_read\_element\_content](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.der_read_element_content.html) * [mtls::x509::der::der\_read\_element\_content\_as](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.der_read_element_content_as.html) * [mtls::x509::der::der\_read\_element\_header](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.der_read_element_header.html) * [mtls::x509::der::parse\_der](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der.html) * [mtls::x509::der::parse\_der\_bitstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_bitstring.html) * [mtls::x509::der::parse\_der\_bmpstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_bmpstring.html) * [mtls::x509::der::parse\_der\_bool](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_bool.html) * [mtls::x509::der::parse\_der\_container](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_container.html) * [mtls::x509::der::parse\_der\_content](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_content.html) * [mtls::x509::der::parse\_der\_content2](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_content2.html) * [mtls::x509::der::parse\_der\_endofcontent](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_endofcontent.html) * [mtls::x509::der::parse\_der\_enum](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_enum.html) * [mtls::x509::der::parse\_der\_explicit\_optional](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_explicit_optional.html) * [mtls::x509::der::parse\_der\_generalizedtime](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_generalizedtime.html) * [mtls::x509::der::parse\_der\_generalstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_generalstring.html) * [mtls::x509::der::parse\_der\_graphicstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_graphicstring.html) * [mtls::x509::der::parse\_der\_i32](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_i32.html) * [mtls::x509::der::parse\_der\_i64](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_i64.html) * [mtls::x509::der::parse\_der\_ia5string](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_ia5string.html) * [mtls::x509::der::parse\_der\_implicit](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_implicit.html) * [mtls::x509::der::parse\_der\_integer](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_integer.html) * [mtls::x509::der::parse\_der\_null](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_null.html) * [mtls::x509::der::parse\_der\_numericstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_numericstring.html) * [mtls::x509::der::parse\_der\_objectdescriptor](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_objectdescriptor.html) * [mtls::x509::der::parse\_der\_octetstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_octetstring.html) * [mtls::x509::der::parse\_der\_oid](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_oid.html) * [mtls::x509::der::parse\_der\_printablestring](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_printablestring.html) * [mtls::x509::der::parse\_der\_recursive](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_recursive.html) * [mtls::x509::der::parse\_der\_relative\_oid](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_relative_oid.html) * [mtls::x509::der::parse\_der\_sequence](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_sequence.html) * [mtls::x509::der::parse\_der\_sequence\_defined](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_sequence_defined.html) * [mtls::x509::der::parse\_der\_sequence\_defined\_g](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_sequence_defined_g.html) * [mtls::x509::der::parse\_der\_sequence\_of](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_sequence_of.html) * [mtls::x509::der::parse\_der\_sequence\_of\_v](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_sequence_of_v.html) * [mtls::x509::der::parse\_der\_set](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_set.html) * [mtls::x509::der::parse\_der\_set\_defined](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_set_defined.html) * [mtls::x509::der::parse\_der\_set\_defined\_g](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_set_defined_g.html) * [mtls::x509::der::parse\_der\_set\_of](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_set_of.html) * [mtls::x509::der::parse\_der\_set\_of\_v](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_set_of_v.html) * [mtls::x509::der::parse\_der\_slice](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_slice.html) * [mtls::x509::der::parse\_der\_t61string](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_t61string.html) * [mtls::x509::der::parse\_der\_tagged\_explicit](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_tagged_explicit.html) * [mtls::x509::der::parse\_der\_tagged\_explicit\_g](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_tagged_explicit_g.html) * [mtls::x509::der::parse\_der\_tagged\_implicit](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_tagged_implicit.html) * [mtls::x509::der::parse\_der\_tagged\_implicit\_g](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_tagged_implicit_g.html) * [mtls::x509::der::parse\_der\_u32](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_u32.html) * [mtls::x509::der::parse\_der\_u64](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_u64.html) * [mtls::x509::der::parse\_der\_universalstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_universalstring.html) * [mtls::x509::der::parse\_der\_utctime](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_utctime.html) * [mtls::x509::der::parse\_der\_utf8string](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_utf8string.html) * [mtls::x509::der::parse\_der\_videotexstring](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_videotexstring.html) * [mtls::x509::der::parse\_der\_with\_tag](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.parse_der_with_tag.html) * [mtls::x509::der::visiblestring](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/fn.visiblestring.html) * [mtls::x509::parse\_ct\_signed\_certificate\_timestamp](https://api.rocket.rs/v0.5/rocket/mtls/x509/fn.parse_ct_signed_certificate_timestamp.html) * [mtls::x509::parse\_ct\_signed\_certificate\_timestamp\_list](https://api.rocket.rs/v0.5/rocket/mtls/x509/fn.parse_ct_signed_certificate_timestamp_list.html) * [serde::json::from\_slice](https://api.rocket.rs/v0.5/rocket/serde/json/fn.from_slice.html) * [serde::json::from\_str](https://api.rocket.rs/v0.5/rocket/serde/json/fn.from_str.html) * [serde::json::from\_value](https://api.rocket.rs/v0.5/rocket/serde/json/fn.from_value.html) * [serde::json::to\_pretty\_string](https://api.rocket.rs/v0.5/rocket/serde/json/fn.to_pretty_string.html) * [serde::json::to\_string](https://api.rocket.rs/v0.5/rocket/serde/json/fn.to_string.html) * [serde::json::to\_value](https://api.rocket.rs/v0.5/rocket/serde/json/fn.to_value.html) * [serde::msgpack::from\_slice](https://api.rocket.rs/v0.5/rocket/serde/msgpack/fn.from_slice.html) * [serde::msgpack::to\_compact\_vec](https://api.rocket.rs/v0.5/rocket/serde/msgpack/fn.to_compact_vec.html) * [serde::msgpack::to\_vec](https://api.rocket.rs/v0.5/rocket/serde/msgpack/fn.to_vec.html) ### Type Aliases * [catcher::BoxFuture](https://api.rocket.rs/v0.5/rocket/catcher/type.BoxFuture.html) * [catcher::Result](https://api.rocket.rs/v0.5/rocket/catcher/type.Result.html) * [data::Outcome](https://api.rocket.rs/v0.5/rocket/data/type.Outcome.html) * [fairing::Result](https://api.rocket.rs/v0.5/rocket/fairing/type.Result.html) * [form::Result](https://api.rocket.rs/v0.5/rocket/form/type.Result.html) * [mtls::Result](https://api.rocket.rs/v0.5/rocket/mtls/type.Result.html) * [mtls::oid::LoadedMap](https://api.rocket.rs/v0.5/rocket/mtls/oid/type.LoadedMap.html) * [mtls::oid::asn1\_rs::IResult](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/type.IResult.html) * [mtls::oid::asn1\_rs::OptTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/type.OptTaggedExplicit.html) * [mtls::oid::asn1\_rs::OptTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/type.OptTaggedImplicit.html) * [mtls::oid::asn1\_rs::ParseResult](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/type.ParseResult.html) * [mtls::oid::asn1\_rs::Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/type.Result.html) * [mtls::oid::asn1\_rs::SerializeResult](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/type.SerializeResult.html) * [mtls::oid::asn1\_rs::SetIterator](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/type.SetIterator.html) * [mtls::oid::asn1\_rs::TaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/type.TaggedExplicit.html) * [mtls::oid::asn1\_rs::TaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/type.TaggedImplicit.html) * [mtls::oid::asn1\_rs::nom::IResult](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/type.IResult.html) * [mtls::oid::asn1\_rs::nom::lib::std::alloc::LayoutErr](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/alloc/type.LayoutErr.html) * [mtls::oid::asn1\_rs::nom::lib::std::fmt::Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html) * [mtls::oid::asn1\_rs::nom::lib::std::string::ParseError](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/type.ParseError.html) * [mtls::x509::CRLDistributionPoints](https://api.rocket.rs/v0.5/rocket/mtls/x509/type.CRLDistributionPoints.html) * [mtls::x509::CertificatePolicies](https://api.rocket.rs/v0.5/rocket/mtls/x509/type.CertificatePolicies.html) * [mtls::x509::X509Result](https://api.rocket.rs/v0.5/rocket/mtls/x509/type.X509Result.html) * [mtls::x509::ber::compat::BerClass](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/compat/type.BerClass.html) * [mtls::x509::ber::compat::BerObjectHeader](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/compat/type.BerObjectHeader.html) * [mtls::x509::ber::compat::BerSize](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/compat/type.BerSize.html) * [mtls::x509::ber::compat::BerTag](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/compat/type.BerTag.html) * [mtls::x509::der::DerClass](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/type.DerClass.html) * [mtls::x509::der::DerObject](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/type.DerObject.html) * [mtls::x509::der::DerObjectContent](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/type.DerObjectContent.html) * [mtls::x509::der::DerObjectHeader](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/type.DerObjectHeader.html) * [mtls::x509::der::DerTag](https://api.rocket.rs/v0.5/rocket/mtls/x509/der/type.DerTag.html) * [request::FlashMessage](https://api.rocket.rs/v0.5/rocket/request/type.FlashMessage.html) * [request::Outcome](https://api.rocket.rs/v0.5/rocket/request/type.Outcome.html) * [response::Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html) * [route::BoxFuture](https://api.rocket.rs/v0.5/rocket/route/type.BoxFuture.html) * [route::Outcome](https://api.rocket.rs/v0.5/rocket/route/type.Outcome.html) * [serde::uuid::Bytes](https://api.rocket.rs/v0.5/rocket/serde/uuid/type.Bytes.html) ### Constants * [http::hyper::header::ACCEPT](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ACCEPT.html) * [http::hyper::header::ACCEPT\_CHARSET](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ACCEPT_CHARSET.html) * [http::hyper::header::ACCEPT\_ENCODING](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ACCEPT_ENCODING.html) * [http::hyper::header::ACCEPT\_LANGUAGE](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ACCEPT_LANGUAGE.html) * [http::hyper::header::ACCEPT\_RANGES](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ACCEPT_RANGES.html) * [http::hyper::header::ACCESS\_CONTROL\_ALLOW\_CREDENTIALS](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ACCESS_CONTROL_ALLOW_CREDENTIALS.html) * [http::hyper::header::ACCESS\_CONTROL\_ALLOW\_HEADERS](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ACCESS_CONTROL_ALLOW_HEADERS.html) * [http::hyper::header::ACCESS\_CONTROL\_ALLOW\_METHODS](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ACCESS_CONTROL_ALLOW_METHODS.html) * [http::hyper::header::ACCESS\_CONTROL\_ALLOW\_ORIGIN](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ACCESS_CONTROL_ALLOW_ORIGIN.html) * [http::hyper::header::ACCESS\_CONTROL\_EXPOSE\_HEADERS](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ACCESS_CONTROL_EXPOSE_HEADERS.html) * [http::hyper::header::ACCESS\_CONTROL\_MAX\_AGE](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ACCESS_CONTROL_MAX_AGE.html) * [http::hyper::header::ACCESS\_CONTROL\_REQUEST\_HEADERS](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ACCESS_CONTROL_REQUEST_HEADERS.html) * [http::hyper::header::ACCESS\_CONTROL\_REQUEST\_METHOD](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ACCESS_CONTROL_REQUEST_METHOD.html) * [http::hyper::header::ALLOW](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ALLOW.html) * [http::hyper::header::AUTHORIZATION](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.AUTHORIZATION.html) * [http::hyper::header::CACHE\_CONTROL](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.CACHE_CONTROL.html) * [http::hyper::header::CONNECTION](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.CONNECTION.html) * [http::hyper::header::CONTENT\_DISPOSITION](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.CONTENT_DISPOSITION.html) * [http::hyper::header::CONTENT\_ENCODING](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.CONTENT_ENCODING.html) * [http::hyper::header::CONTENT\_LANGUAGE](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.CONTENT_LANGUAGE.html) * [http::hyper::header::CONTENT\_LENGTH](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.CONTENT_LENGTH.html) * [http::hyper::header::CONTENT\_LOCATION](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.CONTENT_LOCATION.html) * [http::hyper::header::CONTENT\_RANGE](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.CONTENT_RANGE.html) * [http::hyper::header::CONTENT\_SECURITY\_POLICY](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.CONTENT_SECURITY_POLICY.html) * [http::hyper::header::CONTENT\_SECURITY\_POLICY\_REPORT\_ONLY](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.CONTENT_SECURITY_POLICY_REPORT_ONLY.html) * [http::hyper::header::CONTENT\_TYPE](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.CONTENT_TYPE.html) * [http::hyper::header::DATE](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.DATE.html) * [http::hyper::header::ETAG](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ETAG.html) * [http::hyper::header::EXPECT](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.EXPECT.html) * [http::hyper::header::EXPIRES](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.EXPIRES.html) * [http::hyper::header::FORWARDED](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.FORWARDED.html) * [http::hyper::header::FROM](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.FROM.html) * [http::hyper::header::HOST](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.HOST.html) * [http::hyper::header::IF\_MATCH](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.IF_MATCH.html) * [http::hyper::header::IF\_MODIFIED\_SINCE](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.IF_MODIFIED_SINCE.html) * [http::hyper::header::IF\_NONE\_MATCH](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.IF_NONE_MATCH.html) * [http::hyper::header::IF\_RANGE](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.IF_RANGE.html) * [http::hyper::header::IF\_UNMODIFIED\_SINCE](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.IF_UNMODIFIED_SINCE.html) * [http::hyper::header::LAST\_MODIFIED](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.LAST_MODIFIED.html) * [http::hyper::header::LINK](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.LINK.html) * [http::hyper::header::LOCATION](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.LOCATION.html) * [http::hyper::header::ORIGIN](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.ORIGIN.html) * [http::hyper::header::PRAGMA](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.PRAGMA.html) * [http::hyper::header::RANGE](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.RANGE.html) * [http::hyper::header::REFERER](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.REFERER.html) * [http::hyper::header::REFERRER\_POLICY](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.REFERRER_POLICY.html) * [http::hyper::header::REFRESH](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.REFRESH.html) * [http::hyper::header::STRICT\_TRANSPORT\_SECURITY](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.STRICT_TRANSPORT_SECURITY.html) * [http::hyper::header::TE](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.TE.html) * [http::hyper::header::TRANSFER\_ENCODING](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.TRANSFER_ENCODING.html) * [http::hyper::header::UPGRADE](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.UPGRADE.html) * [http::hyper::header::USER\_AGENT](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.USER_AGENT.html) * [http::hyper::header::VARY](https://api.rocket.rs/v0.5/rocket/http/hyper/header/constant.VARY.html) * [mtls::oid::MS\_CTL](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.MS_CTL.html) * [mtls::oid::MS\_JURISDICTION\_COUNTRY](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.MS_JURISDICTION_COUNTRY.html) * [mtls::oid::MS\_JURISDICTION\_LOCALITY](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.MS_JURISDICTION_LOCALITY.html) * [mtls::oid::MS\_JURISDICTION\_STATE\_OR\_PROVINCE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.MS_JURISDICTION_STATE_OR_PROVINCE.html) * [mtls::oid::OID\_CT\_LIST\_SCT](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_CT_LIST_SCT.html) * [mtls::oid::OID\_DOMAIN\_COMPONENT](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_DOMAIN_COMPONENT.html) * [mtls::oid::OID\_EC\_P256](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_EC_P256.html) * [mtls::oid::OID\_GOST\_R3410\_2001](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_GOST_R3410_2001.html) * [mtls::oid::OID\_HASH\_SHA1](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_HASH_SHA1.html) * [mtls::oid::OID\_KDF\_SHA1\_SINGLE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_KDF_SHA1_SINGLE.html) * [mtls::oid::OID\_KEY\_TYPE\_DSA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_KEY_TYPE_DSA.html) * [mtls::oid::OID\_KEY\_TYPE\_EC\_PUBLIC\_KEY](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_KEY_TYPE_EC_PUBLIC_KEY.html) * [mtls::oid::OID\_KEY\_TYPE\_GOST\_R3410\_2012\_256](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_KEY_TYPE_GOST_R3410_2012_256.html) * [mtls::oid::OID\_KEY\_TYPE\_GOST\_R3410\_2012\_512](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_KEY_TYPE_GOST_R3410_2012_512.html) * [mtls::oid::OID\_MD5\_WITH\_RSA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_MD5_WITH_RSA.html) * [mtls::oid::OID\_NIST\_EC\_P384](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_NIST_EC_P384.html) * [mtls::oid::OID\_NIST\_EC\_P521](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_NIST_EC_P521.html) * [mtls::oid::OID\_NIST\_ENC\_AES256\_CBC](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_NIST_ENC_AES256_CBC.html) * [mtls::oid::OID\_NIST\_HASH\_SHA256](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_NIST_HASH_SHA256.html) * [mtls::oid::OID\_NIST\_HASH\_SHA384](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_NIST_HASH_SHA384.html) * [mtls::oid::OID\_NIST\_HASH\_SHA512](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_NIST_HASH_SHA512.html) * [mtls::oid::OID\_PKCS12](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS12.html) * [mtls::oid::OID\_PKCS12\_PBEIDS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS12_PBEIDS.html) * [mtls::oid::OID\_PKCS12\_PBE\_SHA1\_128RC2\_CBC](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS12_PBE_SHA1_128RC2_CBC.html) * [mtls::oid::OID\_PKCS12\_PBE\_SHA1\_128RC4](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS12_PBE_SHA1_128RC4.html) * [mtls::oid::OID\_PKCS12\_PBE\_SHA1\_2K\_3DES\_CBC](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS12_PBE_SHA1_2K_3DES_CBC.html) * [mtls::oid::OID\_PKCS12\_PBE\_SHA1\_3K\_3DES\_CBC](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS12_PBE_SHA1_3K_3DES_CBC.html) * [mtls::oid::OID\_PKCS12\_PBE\_SHA1\_40RC2\_CBC](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS12_PBE_SHA1_40RC2_CBC.html) * [mtls::oid::OID\_PKCS12\_PBE\_SHA1\_40RC4](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS12_PBE_SHA1_40RC4.html) * [mtls::oid::OID\_PKCS1\_MD2WITHRSAENC](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS1_MD2WITHRSAENC.html) * [mtls::oid::OID\_PKCS1\_MD4WITHRSAENC](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS1_MD4WITHRSAENC.html) * [mtls::oid::OID\_PKCS1\_MD5WITHRSAENC](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS1_MD5WITHRSAENC.html) * [mtls::oid::OID\_PKCS1\_RSAENCRYPTION](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS1_RSAENCRYPTION.html) * [mtls::oid::OID\_PKCS1\_RSASSAPSS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS1_RSASSAPSS.html) * [mtls::oid::OID\_PKCS1\_SHA1WITHRSA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS1_SHA1WITHRSA.html) * [mtls::oid::OID\_PKCS1\_SHA224WITHRSA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS1_SHA224WITHRSA.html) * [mtls::oid::OID\_PKCS1\_SHA256WITHRSA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS1_SHA256WITHRSA.html) * [mtls::oid::OID\_PKCS1\_SHA384WITHRSA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS1_SHA384WITHRSA.html) * [mtls::oid::OID\_PKCS1\_SHA512WITHRSA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS1_SHA512WITHRSA.html) * [mtls::oid::OID\_PKCS7\_ID\_DATA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS7_ID_DATA.html) * [mtls::oid::OID\_PKCS7\_ID\_DIGESTED\_DATA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS7_ID_DIGESTED_DATA.html) * [mtls::oid::OID\_PKCS7\_ID\_ENCRYPTED\_DATA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS7_ID_ENCRYPTED_DATA.html) * [mtls::oid::OID\_PKCS7\_ID\_ENVELOPED\_DATA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS7_ID_ENVELOPED_DATA.html) * [mtls::oid::OID\_PKCS7\_ID\_SIGNED\_DATA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS7_ID_SIGNED_DATA.html) * [mtls::oid::OID\_PKCS7\_ID\_SIGNED\_ENVELOPED\_DATA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS7_ID_SIGNED_ENVELOPED_DATA.html) * [mtls::oid::OID\_PKCS9\_CONTENT\_TYPE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS9_CONTENT_TYPE.html) * [mtls::oid::OID\_PKCS9\_EMAIL\_ADDRESS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS9_EMAIL_ADDRESS.html) * [mtls::oid::OID\_PKCS9\_EXTENSION\_REQUEST](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS9_EXTENSION_REQUEST.html) * [mtls::oid::OID\_PKCS9\_FRIENDLY\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS9_FRIENDLY_NAME.html) * [mtls::oid::OID\_PKCS9\_ID\_MESSAGE\_DIGEST](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS9_ID_MESSAGE_DIGEST.html) * [mtls::oid::OID\_PKCS9\_SIGNING\_TIME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS9_SIGNING_TIME.html) * [mtls::oid::OID\_PKCS9\_SMIME\_CAPABILITIES](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS9_SMIME_CAPABILITIES.html) * [mtls::oid::OID\_PKCS9\_UNSTRUCTURED\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKCS9_UNSTRUCTURED_NAME.html) * [mtls::oid::OID\_PKIX\_ACCESS\_DESCRIPTOR\_CA\_ISSUERS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKIX_ACCESS_DESCRIPTOR_CA_ISSUERS.html) * [mtls::oid::OID\_PKIX\_ACCESS\_DESCRIPTOR\_CA\_REPOSITORY](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKIX_ACCESS_DESCRIPTOR_CA_REPOSITORY.html) * [mtls::oid::OID\_PKIX\_ACCESS\_DESCRIPTOR\_CMC](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKIX_ACCESS_DESCRIPTOR_CMC.html) * [mtls::oid::OID\_PKIX\_ACCESS\_DESCRIPTOR\_DVCS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKIX_ACCESS_DESCRIPTOR_DVCS.html) * [mtls::oid::OID\_PKIX\_ACCESS\_DESCRIPTOR\_HTTP\_CERTS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKIX_ACCESS_DESCRIPTOR_HTTP_CERTS.html) * [mtls::oid::OID\_PKIX\_ACCESS\_DESCRIPTOR\_HTTP\_CRLS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKIX_ACCESS_DESCRIPTOR_HTTP_CRLS.html) * [mtls::oid::OID\_PKIX\_ACCESS\_DESCRIPTOR\_OCSP](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKIX_ACCESS_DESCRIPTOR_OCSP.html) * [mtls::oid::OID\_PKIX\_ACCESS\_DESCRIPTOR\_RPKI\_MANIFEST](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKIX_ACCESS_DESCRIPTOR_RPKI_MANIFEST.html) * [mtls::oid::OID\_PKIX\_ACCESS\_DESCRIPTOR\_RPKI\_NOTIFY](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKIX_ACCESS_DESCRIPTOR_RPKI_NOTIFY.html) * [mtls::oid::OID\_PKIX\_ACCESS\_DESCRIPTOR\_SIGNED\_OBJECT](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKIX_ACCESS_DESCRIPTOR_SIGNED_OBJECT.html) * [mtls::oid::OID\_PKIX\_ACCESS\_DESCRIPTOR\_STIRTNLIST](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKIX_ACCESS_DESCRIPTOR_STIRTNLIST.html) * [mtls::oid::OID\_PKIX\_ACCESS\_DESCRIPTOR\_TIMESTAMPING](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKIX_ACCESS_DESCRIPTOR_TIMESTAMPING.html) * [mtls::oid::OID\_PKIX\_AUTHORITY\_INFO\_ACCESS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_PKIX_AUTHORITY_INFO_ACCESS.html) * [mtls::oid::OID\_SHA1\_WITH\_RSA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_SHA1_WITH_RSA.html) * [mtls::oid::OID\_SIG\_DSA\_WITH\_SHA1](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_SIG_DSA_WITH_SHA1.html) * [mtls::oid::OID\_SIG\_ECDSA\_WITH\_SHA224](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_SIG_ECDSA_WITH_SHA224.html) * [mtls::oid::OID\_SIG\_ECDSA\_WITH\_SHA256](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_SIG_ECDSA_WITH_SHA256.html) * [mtls::oid::OID\_SIG\_ECDSA\_WITH\_SHA384](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_SIG_ECDSA_WITH_SHA384.html) * [mtls::oid::OID\_SIG\_ECDSA\_WITH\_SHA512](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_SIG_ECDSA_WITH_SHA512.html) * [mtls::oid::OID\_SIG\_ED25519](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_SIG_ED25519.html) * [mtls::oid::OID\_SIG\_ED448](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_SIG_ED448.html) * [mtls::oid::OID\_SIG\_GOST\_R3410\_2012\_256](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_SIG_GOST_R3410_2012_256.html) * [mtls::oid::OID\_SIG\_GOST\_R3410\_2012\_512](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_SIG_GOST_R3410_2012_512.html) * [mtls::oid::OID\_SIG\_GOST\_R3411\_94\_WITH\_R3410\_2001](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_SIG_GOST_R3411_94_WITH_R3410_2001.html) * [mtls::oid::OID\_SIG\_RSA\_RIPE\_MD160](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_SIG_RSA_RIPE_MD160.html) * [mtls::oid::OID\_X500](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X500.html) * [mtls::oid::OID\_X509](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509.html) * [mtls::oid::OID\_X509\_ALIASED\_ENTRY\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_ALIASED_ENTRY_NAME.html) * [mtls::oid::OID\_X509\_BUSINESS\_CATEGORY](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_BUSINESS_CATEGORY.html) * [mtls::oid::OID\_X509\_COMMON\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_COMMON_NAME.html) * [mtls::oid::OID\_X509\_COUNTRY\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_COUNTRY_NAME.html) * [mtls::oid::OID\_X509\_DESCRIPTION](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_DESCRIPTION.html) * [mtls::oid::OID\_X509\_DN\_QUALIFIER](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_DN_QUALIFIER.html) * [mtls::oid::OID\_X509\_EXT\_AUTHORITY\_KEY\_IDENTIFIER](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_AUTHORITY_KEY_IDENTIFIER.html) * [mtls::oid::OID\_X509\_EXT\_BASE\_URL](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_BASE_URL.html) * [mtls::oid::OID\_X509\_EXT\_BASIC\_CONSTRAINTS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_BASIC_CONSTRAINTS.html) * [mtls::oid::OID\_X509\_EXT\_CA\_CERT\_URL](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_CA_CERT_URL.html) * [mtls::oid::OID\_X509\_EXT\_CA\_CRL\_URL](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_CA_CRL_URL.html) * [mtls::oid::OID\_X509\_EXT\_CA\_POLICY\_URL](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_CA_POLICY_URL.html) * [mtls::oid::OID\_X509\_EXT\_CA\_REVOCATION\_URL](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_CA_REVOCATION_URL.html) * [mtls::oid::OID\_X509\_EXT\_CERTIFICATE\_POLICIES](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_CERTIFICATE_POLICIES.html) * [mtls::oid::OID\_X509\_EXT\_CERT\_COMMENT](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_CERT_COMMENT.html) * [mtls::oid::OID\_X509\_EXT\_CERT\_TYPE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_CERT_TYPE.html) * [mtls::oid::OID\_X509\_EXT\_CRL\_DISTRIBUTION\_POINTS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_CRL_DISTRIBUTION_POINTS.html) * [mtls::oid::OID\_X509\_EXT\_CRL\_NUMBER](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_CRL_NUMBER.html) * [mtls::oid::OID\_X509\_EXT\_DELTA\_CRL\_INDICATOR](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_DELTA_CRL_INDICATOR.html) * [mtls::oid::OID\_X509\_EXT\_ENTITY\_LOGO](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_ENTITY_LOGO.html) * [mtls::oid::OID\_X509\_EXT\_EXTENDED\_KEY\_USAGE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_EXTENDED_KEY_USAGE.html) * [mtls::oid::OID\_X509\_EXT\_FRESHEST\_CRL](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_FRESHEST_CRL.html) * [mtls::oid::OID\_X509\_EXT\_HOLD\_INSTRUCTION\_CODE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_HOLD_INSTRUCTION_CODE.html) * [mtls::oid::OID\_X509\_EXT\_HOMEPAGE\_URL](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_HOMEPAGE_URL.html) * [mtls::oid::OID\_X509\_EXT\_INHIBITANT\_ANY\_POLICY](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_INHIBITANT_ANY_POLICY.html) * [mtls::oid::OID\_X509\_EXT\_INVALIDITY\_DATE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_INVALIDITY_DATE.html) * [mtls::oid::OID\_X509\_EXT\_ISSUER](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_ISSUER.html) * [mtls::oid::OID\_X509\_EXT\_ISSUER\_ALT\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_ISSUER_ALT_NAME.html) * [mtls::oid::OID\_X509\_EXT\_ISSUER\_DISTRIBUTION\_POINT](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_ISSUER_DISTRIBUTION_POINT.html) * [mtls::oid::OID\_X509\_EXT\_KEY\_USAGE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_KEY_USAGE.html) * [mtls::oid::OID\_X509\_EXT\_NAME\_CONSTRAINTS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_NAME_CONSTRAINTS.html) * [mtls::oid::OID\_X509\_EXT\_POLICY\_CONSTRAINTS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_POLICY_CONSTRAINTS.html) * [mtls::oid::OID\_X509\_EXT\_POLICY\_MAPPINGS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_POLICY_MAPPINGS.html) * [mtls::oid::OID\_X509\_EXT\_PRIVATE\_KEY\_USAGE\_PERIOD](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_PRIVATE_KEY_USAGE_PERIOD.html) * [mtls::oid::OID\_X509\_EXT\_REASON\_CODE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_REASON_CODE.html) * [mtls::oid::OID\_X509\_EXT\_RENEWAL\_URL](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_RENEWAL_URL.html) * [mtls::oid::OID\_X509\_EXT\_REVOCATION\_URL](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_REVOCATION_URL.html) * [mtls::oid::OID\_X509\_EXT\_SSL\_SERVER\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_SSL_SERVER_NAME.html) * [mtls::oid::OID\_X509\_EXT\_SUBJECT\_ALT\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_SUBJECT_ALT_NAME.html) * [mtls::oid::OID\_X509\_EXT\_SUBJECT\_KEY\_IDENTIFIER](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_SUBJECT_KEY_IDENTIFIER.html) * [mtls::oid::OID\_X509\_EXT\_USER\_PICTURE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_EXT_USER_PICTURE.html) * [mtls::oid::OID\_X509\_GENERATION\_QUALIFIER](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_GENERATION_QUALIFIER.html) * [mtls::oid::OID\_X509\_GIVEN\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_GIVEN_NAME.html) * [mtls::oid::OID\_X509\_INITIALS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_INITIALS.html) * [mtls::oid::OID\_X509\_KNOWLEDGE\_INFORMATION](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_KNOWLEDGE_INFORMATION.html) * [mtls::oid::OID\_X509\_LOCALITY\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_LOCALITY_NAME.html) * [mtls::oid::OID\_X509\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_NAME.html) * [mtls::oid::OID\_X509\_OBJECT\_CLASS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_OBJECT_CLASS.html) * [mtls::oid::OID\_X509\_OBSOLETE\_AUTHORITY\_KEY\_IDENTIFIER](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_OBSOLETE_AUTHORITY_KEY_IDENTIFIER.html) * [mtls::oid::OID\_X509\_OBSOLETE\_CERTIFICATE\_POLICIES](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_OBSOLETE_CERTIFICATE_POLICIES.html) * [mtls::oid::OID\_X509\_OBSOLETE\_ISSUER\_ALT\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_OBSOLETE_ISSUER_ALT_NAME.html) * [mtls::oid::OID\_X509\_OBSOLETE\_KEY\_ATTRIBUTES](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_OBSOLETE_KEY_ATTRIBUTES.html) * [mtls::oid::OID\_X509\_OBSOLETE\_KEY\_USAGE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_OBSOLETE_KEY_USAGE.html) * [mtls::oid::OID\_X509\_OBSOLETE\_POLICY\_MAPPING](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_OBSOLETE_POLICY_MAPPING.html) * [mtls::oid::OID\_X509\_OBSOLETE\_SUBJECT\_ALT\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_OBSOLETE_SUBJECT_ALT_NAME.html) * [mtls::oid::OID\_X509\_OBSOLETE\_SUBTREES\_CONSTRAINT](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_OBSOLETE_SUBTREES_CONSTRAINT.html) * [mtls::oid::OID\_X509\_ORGANIZATIONAL\_UNIT](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_ORGANIZATIONAL_UNIT.html) * [mtls::oid::OID\_X509\_ORGANIZATION\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_ORGANIZATION_NAME.html) * [mtls::oid::OID\_X509\_POSTAL\_ADDRESS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_POSTAL_ADDRESS.html) * [mtls::oid::OID\_X509\_POSTAL\_CODE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_POSTAL_CODE.html) * [mtls::oid::OID\_X509\_SEARCH\_GUIDE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_SEARCH_GUIDE.html) * [mtls::oid::OID\_X509\_SERIALNUMBER](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_SERIALNUMBER.html) * [mtls::oid::OID\_X509\_STATE\_OR\_PROVINCE\_NAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_STATE_OR_PROVINCE_NAME.html) * [mtls::oid::OID\_X509\_STREET\_ADDRESS](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_STREET_ADDRESS.html) * [mtls::oid::OID\_X509\_SURNAME](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_SURNAME.html) * [mtls::oid::OID\_X509\_TITLE](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_TITLE.html) * [mtls::oid::OID\_X509\_UNIQUE\_IDENTIFIER](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.OID_X509_UNIQUE_IDENTIFIER.html) * [mtls::oid::SPC\_INDIRECT\_DATA\_OBJID](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.SPC_INDIRECT_DATA_OBJID.html) * [mtls::oid::SPC\_INDIVIDUAL\_SP\_KEY\_PURPOSE\_OBJID](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.SPC_INDIVIDUAL_SP_KEY_PURPOSE_OBJID.html) * [mtls::oid::SPC\_PE\_IMAGE\_DATA](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.SPC_PE_IMAGE_DATA.html) * [mtls::oid::SPC\_SP\_OPUS\_INFO\_OBJID](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.SPC_SP_OPUS_INFO_OBJID.html) * [mtls::oid::SPC\_STATEMENT\_TYPE\_OBJID](https://api.rocket.rs/v0.5/rocket/mtls/oid/constant.SPC_STATEMENT_TYPE_OBJID.html) * [mtls::x509::ber::MAX\_OBJECT\_SIZE](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/constant.MAX_OBJECT_SIZE.html) * [mtls::x509::ber::MAX\_RECURSION](https://api.rocket.rs/v0.5/rocket/mtls/x509/ber/constant.MAX_RECURSION.html) --- # Index of crates [Crates](https://api.rocket.rs/v0.5/#) --------------------------------------- List of all crates ================== * [rocket](https://api.rocket.rs/v0.5/rocket/index.html) * [rocket\_db\_pools](https://api.rocket.rs/v0.5/rocket_db_pools/index.html) * [rocket\_dyn\_templates](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html) * [rocket\_sync\_db\_pools](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html) * [rocket\_ws](https://api.rocket.rs/v0.5/rocket_ws/index.html) --- # Database in rocket_db_pools - Rust [Database](https://api.rocket.rs/v0.5/rocket_db_pools/derive.Database#) ------------------------------------------------------------------------ [rocket\_db\_pools](https://api.rocket.rs/v0.5/rocket_db_pools/index.html) Derive Macro Database Copy item path ==================================== #[derive(Database)] { // Attributes available to this derive: #[database] } Expand description Automatic derive for the [`Database`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html) trait. use rocket_db_pools::Database; #[derive(Database)] #[database("database_name")] struct Db(PoolType); The derive generates an implementation of [`Database`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html) as follows: * [`Database::NAME`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html#associatedconstant.NAME) is set to the value in the `#[database("name")]` attribute. This names the database, providing an anchor to configure the database via `Rocket.toml` or any other configuration source. Specifically, the configuration in `databases.name` is used to configure the driver. * [`Database::Pool`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html#associatedtype.Pool) is set to the wrapped type: `PoolType` above. The type must implement [`Pool`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html) . To meet the required [`Database`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html) supertrait bounds, this derive also generates implementations for: * `From` * `Deref` * `DerefMut` * `FromRequest<'_> for &Db` * `Sentinel for &Db` The `Deref` impls enable accessing the database pool directly from references `&Db` or `&mut Db`. To force a dereference to the underlying type, use `&db.0` or `&**db` or their `&mut` variants. --- # List of all items in this crate [All](https://api.rocket.rs/v0.5/rocket_sync_db_pools/all#) ------------------------------------------------------------ List of all items ================= ### Structs * [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html) * [example::ExampleDb](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html) ### Enums * [Error](https://api.rocket.rs/v0.5/rocket_sync_db_pools/enum.Error.html) ### Traits * [Poolable](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html) ### Attribute Macros * [database](https://api.rocket.rs/v0.5/rocket_sync_db_pools/attr.database.html) ### Type Aliases * [PoolResult](https://api.rocket.rs/v0.5/rocket_sync_db_pools/type.PoolResult.html) --- # Redirection Redirecting to [../../../rocket/request/trait.FromRequest.html](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html) ... --- # context in rocket_dyn_templates - Rust [context](https://api.rocket.rs/v0.5/rocket_dyn_templates/macro.context#) -------------------------------------------------------------------------- [rocket\_dyn\_templates](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html) Macro context Copy item path ============================ [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#357-392) macro_rules! context { ($($key:ident $(: $value:expr)?),*$(,)?) => { ... }; } Expand description A macro to easily create a template rendering context. Invocations of this macro expand to a value of an anonymous type which implements \[`serde::Serialize`\]. Fields can be literal expressions or variables captured from a surrounding scope, as long as all fields implement `Serialize`. [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/macro.context#examples) Examples ------------------------------------------------------------------------------------ The following code: #[get("/")] fn render_index(foo: u64) -> Template { Template::render("index", context! { // Note that shorthand field syntax is supported. // This is equivalent to `foo: foo,` foo, bar: "Hello world", }) } is equivalent to the following, but without the need to manually define an `IndexContext` struct: #[derive(Serialize)] struct IndexContext<'a> { foo: u64, bar: &'a str, } #[get("/")] fn render_index(foo: u64) -> Template { Template::render("index", IndexContext { foo, bar: "Hello world", }) } ### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/macro.context#nesting) Nesting Nested objects can be created by nesting calls to `context!`: let ctx = context! { planet: "Earth", info: context! { mass: 5.97e24, radius: "6371 km", moons: 1, }, }; --- # Pool in rocket_db_pools - Rust [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#) --------------------------------------------------------------- [rocket\_db\_pools](https://api.rocket.rs/v0.5/rocket_db_pools/index.html) Trait Pool Copy item path ========================= [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#117-153) pub trait Pool: Sized + Send + Sync + 'static { type Connection; type Error: Error; // Required methods fn init<'life0, 'async_trait>( figment: &'life0 Figment, ) -> Pin> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get<'life0, 'async_trait>( &'life0 self, ) -> Pin> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; } Expand description Generic [`Database`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html "trait rocket_db_pools::Database") driver connection pool trait. This trait provides a generic interface to various database pooling implementations in the Rust ecosystem. It can be implemented by anyone, but this crate provides implementations for common drivers. **Implementations of this trait outside of this crate should be rare. You _do not_ need to implement this trait or understand its specifics to use this crate.** ### [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#async-trait) Async Trait [`Pool`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") is an _async_ trait. Implementations of `Pool` must be decorated with an attribute of `#[async_trait]`: use rocket::figment::Figment; use rocket_db_pools::Pool; #[rocket::async_trait] impl Pool for MyPool { type Connection = Connection; type Error = Error; async fn init(figment: &Figment) -> Result { todo!("initialize and return an instance of the pool"); } async fn get(&self) -> Result { todo!("fetch one connection from the pool"); } async fn close(&self) { todo!("gracefully shutdown connection pool"); } } ### [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#implementing) Implementing Implementations of `Pool` typically trace the following outline: 1. The `Error` associated type is set to [`Error`](https://api.rocket.rs/v0.5/rocket_db_pools/enum.Error.html "enum rocket_db_pools::Error") . 2. A [`Config`](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Config.html "struct rocket_db_pools::Config") is [extracted](https://api.rocket.rs/v0.5/rocket_db_pools/figment/struct.Figment.html#method.extract "method rocket_db_pools::figment::Figment::extract") from the `figment` passed to init. 3. The pool is initialized and returned in `init()`, wrapping initialization errors in [`Error::Init`](https://api.rocket.rs/v0.5/rocket_db_pools/enum.Error.html#variant.Init "variant rocket_db_pools::Error::Init") . 4. A connection is retrieved in `get()`, wrapping errors in [`Error::Get`](https://api.rocket.rs/v0.5/rocket_db_pools/enum.Error.html#variant.Get "variant rocket_db_pools::Error::Get") . Concretely, this looks like: use rocket::figment::Figment; use rocket_db_pools::{Pool, Config, Error}; #[rocket::async_trait] impl Pool for MyPool { type Connection = Connection; type Error = Error; async fn init(figment: &Figment) -> Result { // Extract the config from `figment`. let config: Config = figment.extract()?; // Read config values, initialize `MyPool`. Map errors of type // `InitError` to `Error` with `Error::Init`. let pool = MyPool::new(config).map_err(Error::Init)?; // Return the fully initialized pool. Ok(pool) } async fn get(&self) -> Result { // Get one connection from the pool, here via an `acquire()` method. // Map errors of type `GetError` to `Error<_, GetError>`. self.acquire().map_err(Error::Get) } async fn close(&self) { self.shutdown().await; } } Required Associated Types[§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#required-associated-types) -------------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#119) #### type [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Connection) The connection type managed by this pool, returned by [`Self::get()`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html#tymethod.get) . [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#122) #### type [Error](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Error) : [Error](https://doc.rust-lang.org/nightly/core/error/trait.Error.html "trait core::error::Error") The error type returned by [`Self::init()`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html#tymethod.init) and [`Self::get()`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html#tymethod.get) . Required Methods[§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#required-methods) -------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#136) #### fn [init](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.init) <'life0, 'async\_trait>( figment: &'life0 [Figment](https://api.rocket.rs/v0.5/rocket_db_pools/figment/struct.Figment.html "struct rocket_db_pools::figment::Figment") , ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, Constructs a pool from a [Value](https://api.rocket.rs/v0.5/rocket_db_pools/figment/value/enum.Value.html "enum rocket_db_pools::figment::value::Value") . It is up to each implementor of `Pool` to define its accepted configuration value(s) via the `Config` associated type. Most integrations provided in `rocket_db_pools` use [`Config`](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Config.html "struct rocket_db_pools::Config") , which accepts a (required) `url` and an (optional) `pool_size`. ###### [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#errors) Errors This method returns an error if the configuration is not compatible, or if creating a pool failed due to an unavailable database server, insufficient resources, or another database-specific error. [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#145) #### fn [get](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.get) <'life0, 'async\_trait>( &'life0 self, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, Asynchronously retrieves a connection from the factory or pool. ###### [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#errors-1) Errors This method returns an error if a connection could not be retrieved, such as a preconfigured timeout elapsing or when the database server is unavailable. [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#152) #### fn [close](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.close) <'life0, 'async\_trait>( &'life0 self, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, Shutdown the connection pool, disallowing any new connections from being retrieved and waking up any tasks with active connections. The returned future may either resolve when all connections are known to have closed or at any point prior. Details are implementation specific. Dyn Compatibility[§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#dyn-compatibility) ---------------------------------------------------------------------------------------------- This trait is **not** [dyn compatible](https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility) . _In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe._ Implementations on Foreign Types[§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#foreign-impls) --------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#337-360) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#impl-Pool-for-Client) ### impl [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") for [Client](https://docs.rs/mongodb/2.8.2/mongodb/client/struct.Client.html "struct mongodb::client::Client") [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#338) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Error) = [Error](https://api.rocket.rs/v0.5/rocket_db_pools/enum.Error.html "enum rocket_db_pools::Error") <[Error](https://docs.rs/mongodb/2.8.2/mongodb/error/struct.Error.html "struct mongodb::error::Error") , [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") \> [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#340) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Connection-1) #### type [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Connection) = [Client](https://docs.rs/mongodb/2.8.2/mongodb/client/struct.Client.html "struct mongodb::client::Client") [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#342-351) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#method.init) #### fn [init](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.init) <'life0, 'async\_trait>( figment: &'life0 [Figment](https://api.rocket.rs/v0.5/rocket_db_pools/figment/struct.Figment.html "struct rocket_db_pools::figment::Figment") , ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#353-355) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#method.get) #### fn [get](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.get) <'life0, 'async\_trait>( &'life0 self, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#357-359) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#method.close) #### fn [close](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.close) <'life0, 'async\_trait>( &'life0 self, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#293-328) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#impl-Pool-for-Pool%3CD%3E) ### impl [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") for [Pool](https://docs.rs/sqlx-core/0.7.2/sqlx_core/pool/struct.Pool.html "struct sqlx_core::pool::Pool") [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#294) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Error-2) #### type [Error](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Error) = [Error](https://api.rocket.rs/v0.5/rocket_db_pools/enum.Error.html "enum rocket_db_pools::Error") <[Error](https://docs.rs/sqlx-core/0.7.2/sqlx_core/error/enum.Error.html "enum sqlx_core::error::Error") \> [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#296) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Connection-2) #### type [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Connection) = [PoolConnection](https://docs.rs/sqlx-core/0.7.2/sqlx_core/pool/connection/struct.PoolConnection.html "struct sqlx_core::pool::connection::PoolConnection") [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#298-319) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#method.init-1) #### fn [init](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.init) <'life0, 'async\_trait>( figment: &'life0 [Figment](https://api.rocket.rs/v0.5/rocket_db_pools/figment/struct.Figment.html "struct rocket_db_pools::figment::Figment") , ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#321-323) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#method.get-1) #### fn [get](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.get) <'life0, 'async\_trait>( &'life0 self, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#325-327) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#method.close-1) #### fn [close](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.close) <'life0, 'async\_trait>( &'life0 self, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#179-207) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#impl-Pool-for-Pool%3CM,+C%3E) ### impl [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") for [Pool](https://docs.rs/deadpool/0.12.3/deadpool/managed/pool/struct.Pool.html "struct deadpool::managed::pool::Pool") where M::[Type](https://docs.rs/deadpool/0.12.3/deadpool/managed/manager/trait.Manager.html#associatedtype.Type "type deadpool::managed::manager::Manager::Type") : [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , C: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") + 'static + [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") <[Object](https://docs.rs/deadpool/0.12.3/deadpool/managed/object/struct.Object.html "struct deadpool::managed::object::Object") >, M::[Error](https://docs.rs/deadpool/0.12.3/deadpool/managed/manager/trait.Manager.html#associatedtype.Error "type deadpool::managed::manager::Manager::Error") : [Error](https://doc.rust-lang.org/nightly/core/error/trait.Error.html "trait core::error::Error") , [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#182) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Error-3) #### type [Error](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Error) = [Error](https://api.rocket.rs/v0.5/rocket_db_pools/enum.Error.html "enum rocket_db_pools::Error") <[PoolError](https://docs.rs/deadpool/0.12.3/deadpool/managed/errors/enum.PoolError.html "enum deadpool::managed::errors::PoolError") <::[Error](https://docs.rs/deadpool/0.12.3/deadpool/managed/manager/trait.Manager.html#associatedtype.Error "type deadpool::managed::manager::Manager::Error") \>> [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#184) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Connection-3) #### type [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Connection) = C [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#186-198) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#method.init-2) #### fn [init](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.init) <'life0, 'async\_trait>( figment: &'life0 [Figment](https://api.rocket.rs/v0.5/rocket_db_pools/figment/struct.Figment.html "struct rocket_db_pools::figment::Figment") , ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#200-202) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#method.get-2) #### fn [get](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.get) <'life0, 'async\_trait>( &'life0 self, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#204-206) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#method.close-2) #### fn [close](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.close) <'life0, 'async\_trait>( &'life0 self, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#237-265) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#impl-Pool-for-Pool%3CM,+C%3E-1) ### impl [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") for [Pool](https://docs.rs/deadpool/0.12.3/deadpool/managed/struct.Pool.html "struct deadpool::managed::Pool") where M::[Type](https://docs.rs/deadpool/0.12.3/deadpool/managed/trait.Manager.html#associatedtype.Type "type deadpool::managed::Manager::Type") : [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , C: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") + 'static + [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") <[Object](https://docs.rs/deadpool/0.12.3/deadpool/managed/struct.Object.html "struct deadpool::managed::Object") >, M::[Error](https://docs.rs/deadpool/0.12.3/deadpool/managed/trait.Manager.html#associatedtype.Error "type deadpool::managed::Manager::Error") : [Error](https://doc.rust-lang.org/nightly/core/error/trait.Error.html "trait core::error::Error") , [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#240) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Error-4) #### type [Error](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Error) = [Error](https://api.rocket.rs/v0.5/rocket_db_pools/enum.Error.html "enum rocket_db_pools::Error") <[BuildError](https://docs.rs/deadpool/0.12.3/deadpool/managed/builder/enum.BuildError.html "enum deadpool::managed::builder::BuildError") <::[Error](https://docs.rs/deadpool/0.12.3/deadpool/managed/trait.Manager.html#associatedtype.Error "type deadpool::managed::Manager::Error") \>, [PoolError](https://docs.rs/deadpool/0.12.3/deadpool/managed/errors/enum.PoolError.html "enum deadpool::managed::errors::PoolError") <::[Error](https://docs.rs/deadpool/0.12.3/deadpool/managed/trait.Manager.html#associatedtype.Error "type deadpool::managed::Manager::Error") \>> [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#242) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Connection-4) #### type [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#associatedtype.Connection) = C [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#244-256) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#method.init-3) #### fn [init](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.init) <'life0, 'async\_trait>( figment: &'life0 [Figment](https://api.rocket.rs/v0.5/rocket_db_pools/figment/struct.Figment.html "struct rocket_db_pools::figment::Figment") , ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#258-260) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#method.get-3) #### fn [get](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.get) <'life0, 'async\_trait>( &'life0 self, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/pool.rs.html#262-264) [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#method.close-3) #### fn [close](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#tymethod.close) <'life0, 'async\_trait>( &'life0 self, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'life0: 'async\_trait, Implementors[§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool#implementors) ------------------------------------------------------------------------------------ --- # Poolable in rocket_sync_db_pools - Rust [Poolable](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#) ---------------------------------------------------------------------------- [rocket\_sync\_db\_pools](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html) Trait Poolable Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#100-111) pub trait Poolable: Send + Sized + 'static { type Manager: ManageConnection; type Error: Debug; // Required method fn pool(db_name: &str, rocket: &Rocket) -> PoolResult; } Expand description Trait implemented by `r2d2`\-based database adapters. [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#provided-implementations) Provided Implementations --------------------------------------------------------------------------------------------------------------------- Implementations of `Poolable` are provided for the following types: * `diesel::MysqlConnection` * `diesel::PgConnection` * `diesel::SqliteConnection` * `postgres::Connection` * `rusqlite::Connection` [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#implementation-guide) Implementation Guide ------------------------------------------------------------------------------------------------------------- As an r2d2-compatible database (or other resource) adapter provider, implementing `Poolable` in your own library will enable Rocket users to consume your adapter with its built-in connection pooling support. ### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#example) Example Consider a library `foo` with the following types: * `foo::ConnectionManager`, which implements [`r2d2::ManageConnection`](https://docs.rs/r2d2/0.8/r2d2/trait.ManageConnection.html "trait r2d2::ManageConnection") * `foo::Connection`, the `Connection` associated type of `foo::ConnectionManager` * `foo::Error`, errors resulting from manager instantiation In order for Rocket to generate the required code to automatically provision a r2d2 connection pool into application state, the `Poolable` trait needs to be implemented for the connection type. The following example implements `Poolable` for `foo::Connection`: use std::time::Duration; use rocket::{Rocket, Build}; use rocket_sync_db_pools::{r2d2, Error, Config, Poolable, PoolResult}; impl Poolable for foo::Connection { type Manager = foo::ConnectionManager; type Error = foo::Error; fn pool(db_name: &str, rocket: &Rocket) -> PoolResult { let config = Config::from(db_name, rocket)?; let manager = foo::ConnectionManager::new(&config.url).map_err(Error::Custom)?; Ok(r2d2::Pool::builder() .max_size(config.pool_size) .connection_timeout(Duration::from_secs(config.timeout as u64)) .build(manager)?) } } In this example, `ConnectionManager::new()` method returns a `foo::Error` on failure. The [`Error`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/enum.Error.html "enum rocket_sync_db_pools::Error") enum consolidates this type, the `r2d2::Error` type that can result from `r2d2::Pool::builder()`, and the [`figment::Error`](https://docs.rs/figment/0.10.19/figment/error/struct.Error.html "struct figment::error::Error") type from `database::Config::from()`. In the event that a connection manager isn’t fallible (as is the case with Diesel’s r2d2 connection manager, for instance), the associated error type for the `Poolable` implementation should be `std::convert::Infallible`. For more concrete example, consult Rocket’s existing implementations of [`Poolable`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") . Required Associated Types[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#required-associated-types) ----------------------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#102) #### type [Manager](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Manager) : [ManageConnection](https://docs.rs/r2d2/0.8/r2d2/trait.ManageConnection.html "trait r2d2::ManageConnection") The associated connection manager for the given connection type. [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#106) #### type [Error](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Error) : [Debug](https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html "trait core::fmt::Debug") The associated error type in the event that constructing the connection manager and/or the connection pool fails. Required Methods[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#required-methods) ----------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#110) #### fn [pool](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#tymethod.pool) (db\_name: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Build](https://api.rocket.rs/v0.5/rocket/phase/enum.Build.html "enum rocket::phase::Build") \>) -> [PoolResult](https://api.rocket.rs/v0.5/rocket_sync_db_pools/type.PoolResult.html "type rocket_sync_db_pools::PoolResult") Creates an `r2d2` connection pool for `Manager::Connection`, returning the pool on success. Dyn Compatibility[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#dyn-compatibility) ------------------------------------------------------------------------------------------------------- This trait is **not** [dyn compatible](https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility) . _In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe._ Implementations on Foreign Types[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#foreign-impls) ------------------------------------------------------------------------------------------------------------------ [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#171-185) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#impl-Poolable-for-MysqlConnection) ### impl [Poolable](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") for [MysqlConnection](https://docs.rs/diesel/2.1.6/diesel/mysql/connection/struct.MysqlConnection.html "struct diesel::mysql::connection::MysqlConnection") Available on **crate feature `diesel_mysql_pool`** only. [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#172) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Manager-1) #### type [Manager](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Manager) = [ConnectionManager](https://docs.rs/diesel/2.1.6/diesel/r2d2/struct.ConnectionManager.html "struct diesel::r2d2::ConnectionManager") <[MysqlConnection](https://docs.rs/diesel/2.1.6/diesel/mysql/connection/struct.MysqlConnection.html "struct diesel::mysql::connection::MysqlConnection") \> [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#173) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Error) = [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#175-184) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#method.pool) #### fn [pool](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#tymethod.pool) (db\_name: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Build](https://api.rocket.rs/v0.5/rocket/phase/enum.Build.html "enum rocket::phase::Build") \>) -> [PoolResult](https://api.rocket.rs/v0.5/rocket_sync_db_pools/type.PoolResult.html "type rocket_sync_db_pools::PoolResult") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#154-168) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#impl-Poolable-for-PgConnection) ### impl [Poolable](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") for [PgConnection](https://docs.rs/diesel/2.1.6/diesel/pg/connection/struct.PgConnection.html "struct diesel::pg::connection::PgConnection") Available on **crate feature `diesel_postgres_pool`** only. [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#155) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Manager-2) #### type [Manager](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Manager) = [ConnectionManager](https://docs.rs/diesel/2.1.6/diesel/r2d2/struct.ConnectionManager.html "struct diesel::r2d2::ConnectionManager") <[PgConnection](https://docs.rs/diesel/2.1.6/diesel/pg/connection/struct.PgConnection.html "struct diesel::pg::connection::PgConnection") \> [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#156) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Error-2) #### type [Error](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Error) = [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#158-167) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#method.pool-1) #### fn [pool](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#tymethod.pool) (db\_name: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Build](https://api.rocket.rs/v0.5/rocket/phase/enum.Build.html "enum rocket::phase::Build") \>) -> [PoolResult](https://api.rocket.rs/v0.5/rocket_sync_db_pools/type.PoolResult.html "type rocket_sync_db_pools::PoolResult") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#118-151) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#impl-Poolable-for-SqliteConnection) ### impl [Poolable](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") for [SqliteConnection](https://docs.rs/diesel/2.1.6/diesel/sqlite/connection/struct.SqliteConnection.html "struct diesel::sqlite::connection::SqliteConnection") Available on **crate feature `diesel_sqlite_pool`** only. [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#119) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Manager-3) #### type [Manager](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Manager) = [ConnectionManager](https://docs.rs/diesel/2.1.6/diesel/r2d2/struct.ConnectionManager.html "struct diesel::r2d2::ConnectionManager") <[SqliteConnection](https://docs.rs/diesel/2.1.6/diesel/sqlite/connection/struct.SqliteConnection.html "struct diesel::sqlite::connection::SqliteConnection") \> [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#120) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Error-3) #### type [Error](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Error) = [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#122-150) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#method.pool-2) #### fn [pool](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#tymethod.pool) (db\_name: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Build](https://api.rocket.rs/v0.5/rocket/phase/enum.Build.html "enum rocket::phase::Build") \>) -> [PoolResult](https://api.rocket.rs/v0.5/rocket_sync_db_pools/type.PoolResult.html "type rocket_sync_db_pools::PoolResult") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#266-281) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#impl-Poolable-for-Client) ### impl [Poolable](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") for [Client](https://docs.rs/memcache/0.15.2/memcache/client/struct.Client.html "struct memcache::client::Client") Available on **crate feature `memcache_pool`** only. [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#267) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Manager-4) #### type [Manager](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Manager) = [MemcacheConnectionManager](https://docs.rs/r2d2-memcache/0.6.0/r2d2_memcache/connection_manager/struct.MemcacheConnectionManager.html "struct r2d2_memcache::connection_manager::MemcacheConnectionManager") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#269) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Error-4) #### type [Error](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Error) = [MemcacheError](https://docs.rs/memcache/0.15.2/memcache/error/enum.MemcacheError.html "enum memcache::error::MemcacheError") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#271-280) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#method.pool-3) #### fn [pool](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#tymethod.pool) (db\_name: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Build](https://api.rocket.rs/v0.5/rocket/phase/enum.Build.html "enum rocket::phase::Build") \>) -> [PoolResult](https://api.rocket.rs/v0.5/rocket_sync_db_pools/type.PoolResult.html "type rocket_sync_db_pools::PoolResult") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#189-204) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#impl-Poolable-for-Client-1) ### impl [Poolable](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") for [Client](https://docs.rs/postgres/0.19.12/postgres/client/struct.Client.html "struct postgres::client::Client") Available on **crate feature `postgres_pool`** only. [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#190) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Manager-5) #### type [Manager](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Manager) = [PostgresConnectionManager](https://docs.rs/r2d2_postgres/0.18.2/r2d2_postgres/struct.PostgresConnectionManager.html "struct r2d2_postgres::PostgresConnectionManager") <[NoTls](https://docs.rs/tokio-postgres/0.7.15/tokio_postgres/tls/struct.NoTls.html "struct tokio_postgres::tls::NoTls") \> [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#191) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Error-5) #### type [Error](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Error) = [Error](https://docs.rs/tokio-postgres/0.7.15/tokio_postgres/error/struct.Error.html "struct tokio_postgres::error::Error") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#193-203) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#method.pool-4) #### fn [pool](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#tymethod.pool) (db\_name: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Build](https://api.rocket.rs/v0.5/rocket/phase/enum.Build.html "enum rocket::phase::Build") \>) -> [PoolResult](https://api.rocket.rs/v0.5/rocket_sync_db_pools/type.PoolResult.html "type rocket_sync_db_pools::PoolResult") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#207-263) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#impl-Poolable-for-Connection) ### impl [Poolable](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html "trait rocket_sync_db_pools::Poolable") for [Connection](https://docs.rs/rusqlite/0.29.0/rusqlite/struct.Connection.html "struct rusqlite::Connection") Available on **crate feature `sqlite_pool`** only. [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#208) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Manager-6) #### type [Manager](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Manager) = [SqliteConnectionManager](https://docs.rs/r2d2_sqlite/0.22.0/r2d2_sqlite/struct.SqliteConnectionManager.html "struct r2d2_sqlite::SqliteConnectionManager") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#209) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Error-6) #### type [Error](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#associatedtype.Error) = [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/poolable.rs.html#211-262) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#method.pool-5) #### fn [pool](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#tymethod.pool) (db\_name: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Build](https://api.rocket.rs/v0.5/rocket/phase/enum.Build.html "enum rocket::phase::Build") \>) -> [PoolResult](https://api.rocket.rs/v0.5/rocket_sync_db_pools/type.PoolResult.html "type rocket_sync_db_pools::PoolResult") Implementors[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable#implementors) --------------------------------------------------------------------------------------------- --- # ExampleDb in rocket_sync_db_pools::example - Rust [ExampleDb](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#) --------------------------------------------------------------------------------------- [rocket\_sync\_db\_pools](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html) ::[example](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/index.html) Struct ExampleDb Copy item path =============================== [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/lib.rs.html#406) pub struct ExampleDb(/* private fields */); Available on **`nightly` and crate feature `diesel_sqlite_pool`** only. Expand description Example of code generated by the `#[database]` attribute. This implementation of `ExampleDb` was generated by: use rocket_sync_db_pools::{database, diesel}; #[database("example")] pub struct ExampleDb(diesel::SqliteConnection); Implementations[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#implementations) ------------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/lib.rs.html#408-544) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-ExampleDb) ### impl [ExampleDb](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html "struct rocket_sync_db_pools::example::ExampleDb") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/lib.rs.html#433-438) #### pub fn [fairing](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.fairing) () -> impl [Fairing](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html "trait rocket::fairing::Fairing") Returns a fairing that initializes the database connection pool associated with `Self`. The fairing _must_ be attached before `Self` can be used as a request guard. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example) Example use rocket_sync_db_pools::diesel; #[database("my_db")] struct MyConn(diesel::SqliteConnection); #[launch] fn rocket() -> _ { rocket::build().attach(MyConn::fairing()) } [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/lib.rs.html#489-496) #### pub fn [pool](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.pool) ( \_\_rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket")

, ) -> [Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <&ConnectionPool> Returns an opaque type that represents the connection pool backing connections of type `Self` _as long as_ the fairing returned by [`Self::fairing()`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html#method.fairing "associated function rocket_sync_db_pools::example::ExampleDb::fairing") is attached and has run on `__rocket`. The returned pool is `Clone`. Values of type `Self` can be retrieved from the pool by calling `pool.get().await` which has the same signature and semantics as [`Self::get_one()`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html#method.get_one "associated function rocket_sync_db_pools::example::ExampleDb::get_one") . ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-1) Example use rocket::tokio::{task, time}; use rocket::fairing::AdHoc; use rocket_sync_db_pools::diesel; #[database("my_db")] struct MyConn(diesel::SqliteConnection); #[launch] fn rocket() -> _ { rocket::build() .attach(MyConn::fairing()) .attach(AdHoc::try_on_ignite("Background DB", |rocket| async { let pool = match MyConn::pool(&rocket) { Some(pool) => pool.clone(), None => return Err(rocket) }; // Start a background task that runs some database // operation every 10 seconds. If a connection isn't // available, retries 10 + timeout seconds later. tokio::task::spawn(async move { loop { time::sleep(time::Duration::from_secs(10)).await; if let Some(conn) = pool.get().await { conn.run(|c| { /* perform db ops */ }).await; } } }); Ok(rocket) })) } [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/lib.rs.html#524-530) #### pub async fn [run](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.run) (&self, \_\_f: F) -> R where F: [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&mut [SqliteConnection](https://docs.rs/diesel/2.1.6/diesel/sqlite/connection/struct.SqliteConnection.html "struct diesel::sqlite::connection::SqliteConnection") ) -> R + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'static, R: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'static, Runs the provided function `__f` in an async-safe blocking thread. The function is supplied with a mutable reference to the raw connection (a value of type `&mut Self.0`). `.await`ing the return value of this function yields the value returned by `__f`. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-2) Example use rocket_sync_db_pools::diesel; #[database("my_db")] struct MyConn(diesel::SqliteConnection); #[get("/")] async fn f(conn: MyConn) { // The type annotation is illustrative and isn't required. let result = conn.run(|c: &mut diesel::SqliteConnection| { // Use `c`. }).await; } [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/lib.rs.html#535-543) #### pub async fn [get\_one](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.get_one) (\_\_rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket")

) -> Option<&Self> { ... } } Expand description Derivable trait which ties a database [`Pool`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") with a configuration name. This trait should rarely, if ever, be implemented manually. Instead, it should be derived: use rocket_db_pools::{deadpool_redis, Database}; #[derive(Database)] #[database("memdb")] struct Db(deadpool_redis::Pool); #[launch] fn rocket() -> _ { rocket::build().attach(Db::init()) } See the [`Database` derive](https://api.rocket.rs/v0.5/rocket_db_pools/derive.Database.html "derive rocket_db_pools::Database") for details. Required Associated Constants[§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database#required-associated-consts) ----------------------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#47) #### const [NAME](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database#associatedconstant.NAME) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) The configuration name for this database. When `Database` is derived, this takes the value `"name"` in the `#[database("name")]` attribute. Required Associated Types[§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database#required-associated-types) ------------------------------------------------------------------------------------------------------------------ [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#41) #### type [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database#associatedtype.Pool) : [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") The [`Pool`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") type of connections to this database. When `Database` is derived, this takes the value of the `Inner` type in `struct Db(Inner)`. Provided Methods[§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database#provided-methods) ------------------------------------------------------------------------------------------------ [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#68-70) #### fn [init](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database#method.init) () -> [Initializer](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Initializer.html "struct rocket_db_pools::Initializer") Returns a fairing that initializes the database and its connection pool. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database#example) Example use rocket_db_pools::{deadpool_postgres, Database}; #[derive(Database)] #[database("pg_db")] struct Db(deadpool_postgres::Pool); #[launch] fn rocket() -> _ { rocket::build().attach(Db::init()) } [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#120-130) #### fn [fetch](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database#method.fetch) (rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket")

) -> [Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <&Self> Returns a reference to the initialized database in `rocket`. The initializer fairing returned by `init()` must have already executed for `Option` to be `Some`. This is guaranteed to be the case if the fairing is attached and either: * Rocket is in the [`Orbit`](https://api.rocket.rs/v0.5/rocket/phase/enum.Orbit.html "enum rocket::phase::Orbit") phase. That is, the application is running. This is always the case in request guards and liftoff fairings, * _or_ Rocket is in the [`Build`](https://api.rocket.rs/v0.5/rocket/phase/enum.Build.html "enum rocket::phase::Build") or [`Ignite`](https://api.rocket.rs/v0.5/rocket/phase/enum.Ignite.html "enum rocket::phase::Ignite") phase and the `Initializer` fairing has already been run. This is the case in all fairing callbacks corresponding to fairings attached _after_ the `Initializer` fairing. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database#example-1) Example Run database migrations in an ignite fairing. It is imperative that the migration fairing be registered _after_ the `init()` fairing. use rocket::{Rocket, Build}; use rocket::fairing::{self, AdHoc}; use rocket_db_pools::{sqlx, Database}; #[derive(Database)] #[database("sqlite_db")] struct Db(sqlx::SqlitePool); async fn run_migrations(rocket: Rocket) -> fairing::Result { if let Some(db) = Db::fetch(&rocket) { // run migrations using `db`. get the inner type with &db.0. Ok(rocket) } else { Err(rocket) } } #[launch] fn rocket() -> _ { rocket::build() .attach(Db::init()) .attach(AdHoc::try_on_ignite("DB Migrations", run_migrations)) } Dyn Compatibility[§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database#dyn-compatibility) -------------------------------------------------------------------------------------------------- This trait is **not** [dyn compatible](https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility) . _In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe._ Implementors[§](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database#implementors) ---------------------------------------------------------------------------------------- --- # Template in rocket_dyn_templates - Rust [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#) ----------------------------------------------------------------------------- [rocket\_dyn\_templates](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html) Struct Template Copy item path ============================== [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#27-30) pub struct Template { /* private fields */ } Expand description Responder that renders a dynamic template. `Template` serves as a _proxy_ type for rendering a template and _does not_ contain the rendered template itself. The template is lazily rendered, at response time. To render a template greedily, use [`Template::show()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.show "associated function rocket_dyn_templates::Template::show") . See the [crate root](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html "mod rocket_dyn_templates") for usage details. Implementations[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#implementations) ---------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#42-256) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Template) ### impl [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#73-75) #### pub fn [fairing](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.fairing) () -> impl [Fairing](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html "trait rocket::fairing::Fairing") Returns a fairing that initializes and maintains templating state. This fairing, or the one returned by [`Template::custom()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.custom "associated function rocket_dyn_templates::Template::custom") , _must_ be attached to any `Rocket` instance that wishes to render templates. Failure to attach this fairing will result in a “Uninitialized template context: missing fairing.” error message when a template is attempted to be rendered. If you wish to customize the internal templating engines, use [`Template::custom()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.custom "associated function rocket_dyn_templates::Template::custom") instead. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example) Example To attach this fairing, simple call `attach` on the application’s `Rocket` instance with `Template::fairing()`: extern crate rocket; extern crate rocket_dyn_templates; use rocket_dyn_templates::Template; fn main() { rocket::build() // ... .attach(Template::fairing()) // ... } [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#104-108) #### pub fn [custom](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.custom) (f: F) -> impl [Fairing](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html "trait rocket::fairing::Fairing") where F: [Fn](https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html "trait core::ops::function::Fn") (&mut [Engines](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Engines.html "struct rocket_dyn_templates::Engines") ) + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") + 'static, Returns a fairing that initializes and maintains templating state. Unlike [`Template::fairing()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.fairing "associated function rocket_dyn_templates::Template::fairing") , this method allows you to configure templating engines via the function `f`. Note that only the enabled templating engines will be accessible from the `Engines` type. This method does not allow the function `f` to fail. If `f` is fallible, use [`Template::try_custom()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.try_custom "associated function rocket_dyn_templates::Template::try_custom") instead. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-1) Example extern crate rocket; extern crate rocket_dyn_templates; use rocket_dyn_templates::Template; fn main() { rocket::build() // ... .attach(Template::custom(|engines| { // engines.handlebars.register_helper ... })) // ... } [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#136-140) #### pub fn [try\_custom](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.try_custom) (f: F) -> impl [Fairing](https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html "trait rocket::fairing::Fairing") where F: [Fn](https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html "trait core::ops::function::Fn") (&mut [Engines](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Engines.html "struct rocket_dyn_templates::Engines") ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[()](https://doc.rust-lang.org/nightly/std/primitive.unit.html) , [Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") + 'static, Returns a fairing that initializes and maintains templating state. This variant of [`Template::custom()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.custom "associated function rocket_dyn_templates::Template::custom") allows a fallible `f`. If `f` returns an error during initialization, it will cancel the launch. If `f` returns an error during template reloading (in debug mode), then the newly-reloaded templates are discarded. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-2) Example extern crate rocket; extern crate rocket_dyn_templates; use rocket_dyn_templates::Template; fn main() { rocket::build() // ... .attach(Template::try_custom(|engines| { // engines.handlebars.register_helper ... Ok(()) })) // ... } [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#174-181) #### pub fn [render](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.render) (name: S, context: C) -> [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow") <'static, [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) \>>, C: [Serialize](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serialize.html "trait serde_core::ser::Serialize") , Render the template named `name` with the context `context`. The `context` is typically created using the \[`context!`\] macro, but it can be of any type that implements `Serialize`, such as `HashMap` or a custom `struct`. To render a template directly into a string, use \[`Metadata::render()`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#examples) Examples Using the `context` macro: use rocket_dyn_templates::{Template, context}; let template = Template::render("index", context! { foo: "Hello, world!", }); Using a `HashMap` as the context: use std::collections::HashMap; use rocket_dyn_templates::Template; // Create a `context` from a `HashMap`. let mut context = HashMap::new(); context.insert("foo", "Hello, world!"); let template = Template::render("index", context); [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#217-228) #### pub fn [show](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.show) (rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Orbit](https://api.rocket.rs/v0.5/rocket/phase/enum.Orbit.html "enum rocket::phase::Orbit") \>, name: S, context: C) -> [Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <[String](https://doc.rust-lang.org/nightly/alloc/string/struct.String.html "struct alloc::string::String") \> where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow") <'static, [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) \>>, C: [Serialize](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serialize.html "trait serde_core::ser::Serialize") , Render the template named `name` with the context `context` into a `String`. This method should **not** be used in any running Rocket application. This method should only be used during testing to validate `Template` responses. For other uses, use [`render()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.render) instead. The `context` can be of any type that implements `Serialize`. This is typically a `HashMap` or a custom `struct`. Returns `Some` if the template could be rendered. Otherwise, returns `None`. If rendering fails, error output is printed to the console. `None` is also returned if a `Template` fairing has not been attached. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-3) Example use std::collections::HashMap; use rocket_dyn_templates::Template; use rocket::local::blocking::Client; fn main() { let rocket = rocket::build().attach(Template::fairing()); let client = Client::untracked(rocket).expect("valid rocket"); // Create a `context`. Here, just an empty `HashMap`. let mut context = HashMap::new(); let template = Template::show(client.rocket(), "index", context); } Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#trait-implementations) ---------------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#26) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Debug-for-Template) ### impl [Debug](https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html "trait core::fmt::Debug") for [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#26) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.fmt) #### fn [fmt](https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html "struct core::fmt::Formatter") <'\_>) -> [Result](https://doc.rust-lang.org/nightly/core/fmt/type.Result.html "type core::fmt::Result") Formats the value using the given formatter. [Read more](https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#261-274) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Responder%3C'r,+'static%3E-for-Template) ### impl<'r> [Responder](https://api.rocket.rs/v0.5/rocket/response/responder/trait.Responder.html "trait rocket::response::responder::Responder") <'r, 'static> for [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") Returns a response with the Content-Type derived from the template’s extension and a fixed-size body containing the rendered template. If rendering fails, an `Err` of `Status::InternalServerError` is returned. [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#262-273) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.respond_to) #### fn [respond\_to](https://api.rocket.rs/v0.5/rocket/response/responder/trait.Responder.html#tymethod.respond_to) (self, req: &'r [Request](https://api.rocket.rs/v0.5/rocket/request/request/struct.Request.html "struct rocket::request::request::Request") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/response/type.Result.html "type rocket::response::Result") <'static> Returns `Ok` if a `Response` could be generated successfully. Otherwise, returns an `Err` with a failing `Status`. [Read more](https://api.rocket.rs/v0.5/rocket/response/responder/trait.Responder.html#tymethod.respond_to) [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#276-289) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Sentinel-for-Template) ### impl [Sentinel](https://api.rocket.rs/v0.5/rocket/sentinel/trait.Sentinel.html "trait rocket::sentinel::Sentinel") for [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/template.rs.html#277-288) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.abort) #### fn [abort](https://api.rocket.rs/v0.5/rocket/sentinel/trait.Sentinel.html#tymethod.abort) (rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Ignite](https://api.rocket.rs/v0.5/rocket/phase/enum.Ignite.html "enum rocket::phase::Ignite") \>) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if launch should be aborted and `false` otherwise. Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#synthetic-implementations) ------------------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Freeze-for-Template) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-RefUnwindSafe-for-Template) ### impl ![RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Send-for-Template) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Sync-for-Template) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Unpin-for-Template) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-UnwindSafe-for-Template) ### impl ![UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html "struct rocket_dyn_templates::Template") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#blanket-implementations) -------------------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html "trait asn1_rs::traits::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.explicit) #### fn [explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Explicit.html "enum asn1_rs::asn1_types::tagged::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html "trait asn1_rs::traits::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.implicit) #### fn [implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Implicit.html "enum asn1_rs::asn1_types::tagged::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-From%3CT%3E-for-T) ### impl [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.from) #### fn [from](https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Into%3CU%3E-for-T) ### impl [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") for T where U: [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.into) #### fn [into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-IntoCollection%3CT%3E-for-T) ### impl IntoCollection for T [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.into_collection) #### fn into\_collection(self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.mapped) #### fn mapped(self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html "trait core::ops::function::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") where F: [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-4) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-5) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-6) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-7) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-8) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-9) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-10) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-11) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-12) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-13) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-14) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-15) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-16) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-17) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-18) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-19) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-20) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-21) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-22) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-23) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-24) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-25) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-26) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-27) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-28) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-29) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-30) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-31) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-32) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-33) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-34) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-35) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-36) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-37) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-38) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-39) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-40) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-41) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-42) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-43) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-44) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-45) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-46) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-47) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-48) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-49) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-50) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-51) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-52) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-53) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-54) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-55) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-56) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-57) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-58) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-59) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-60) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-61) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#example-62) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#194) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Pointable-for-T) ### impl [Pointable](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html "trait crossbeam_epoch::atomic::Pointable") for T [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#195) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#associatedconstant.ALIGN) #### const [ALIGN](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#associatedconstant.ALIGN) : [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) The alignment of pointer. [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#197) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#associatedtype.Init) #### type [Init](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#associatedtype.Init) = T The type for initializers. [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#199) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.init) #### unsafe fn [init](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.init) (init: ::[Init](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#associatedtype.Init "type crossbeam_epoch::atomic::Pointable::Init") ) -> [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) Initializes a with the given initializer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.init) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#203) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.deref) #### unsafe fn [deref](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref) <'a>(ptr: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) -> [&'a T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Dereferences the given pointer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#207) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.deref_mut) #### unsafe fn [deref\_mut](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref_mut) <'a>(ptr: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) -> [&'a mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably dereferences the given pointer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref_mut) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#211) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.drop) #### unsafe fn [drop](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.drop) (ptr: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) Drops the object pointed to by the given pointer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.drop) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") for T where U: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#associatedtype.Error-1) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.try_from) #### fn [try\_from](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html "trait core::convert::TryInto") for T where U: [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#associatedtype.Error) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.try_into) #### fn [try\_into](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # Metadata in rocket_dyn_templates - Rust [Metadata](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#) ----------------------------------------------------------------------------- [rocket\_dyn\_templates](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html) Struct Metadata Copy item path ============================== [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/metadata.rs.html#42) pub struct Metadata<'a>(/* private fields */); Expand description Request guard for dynamically querying template metadata. [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#usage) Usage -------------------------------------------------------------------------------- The `Metadata` type implements Rocket’s [`FromRequest`](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html "trait rocket::request::from_request::FromRequest") trait, so it can be used as a request guard in any request handler. use rocket_dyn_templates::{Template, Metadata, context}; #[get("/")] fn homepage(metadata: Metadata) -> Template { // Conditionally render a template if it's available. if metadata.contains_template("some-template") { Template::render("some-template", &context) } else { Template::render("fallback", &context) } } fn main() { rocket::build() .attach(Template::fairing()) // ... } Implementations[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#implementations) ---------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/metadata.rs.html#44-126) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Metadata%3C'_%3E) ### impl [Metadata](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html "struct rocket_dyn_templates::Metadata") <'\_> [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/metadata.rs.html#62-64) #### pub fn [contains\_template](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.contains_template) (&self, name: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if the template with the given `name` is currently loaded. Otherwise, returns `false`. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example) Example use rocket_dyn_templates::Metadata; #[get("/")] fn handler(metadata: Metadata) { // Returns `true` if the template with name `"name"` was loaded. let loaded = metadata.contains_template("name"); } [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/metadata.rs.html#82-84) #### pub fn [reloading](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.reloading) (&self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if template reloading is enabled. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-1) Example use rocket_dyn_templates::Metadata; #[get("/")] fn handler(metadata: Metadata) { // Returns `true` if template reloading is enabled. let reloading = metadata.reloading(); } [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/metadata.rs.html#121-125) #### pub fn [render](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.render) (&self, name: S, context: C) -> [Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <(ContentType, [String](https://doc.rust-lang.org/nightly/alloc/string/struct.String.html "struct alloc::string::String") )> where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow") <'static, [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) \>>, C: [Serialize](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serialize.html "trait serde_core::ser::Serialize") , Directly render the template named `name` with the context `context` into a `String`. Also returns the template’s detected `ContentType`. See [`Template::render()`](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.render "associated function rocket_dyn_templates::Template::render") for more details on rendering. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#examples) Examples use rocket::http::ContentType; use rocket_dyn_templates::{Metadata, Template, context}; #[get("/")] fn send_email(metadata: Metadata) -> Option<()> { let (mime, string) = metadata.render("email", context! { field: "Hello, world!" })?; send_email(mime, string).await?; Some(()) } #[get("/")] fn raw_render(metadata: Metadata) -> Option<(ContentType, String)> { metadata.render("index", context! { field: "Hello, world!" }) } // Prefer the following, however, which is nearly identical but pithier: #[get("/")] fn render() -> Template { Template::render("index", context! { field: "Hello, world!" }) } Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#trait-implementations) ---------------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/metadata.rs.html#128-134) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Debug-for-Metadata%3C'_%3E) ### impl [Debug](https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html "trait core::fmt::Debug") for [Metadata](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html "struct rocket_dyn_templates::Metadata") <'\_> [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/metadata.rs.html#129-133) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.fmt) #### fn [fmt](https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html "struct core::fmt::Formatter") <'\_>) -> [Result](https://doc.rust-lang.org/nightly/core/fmt/type.Result.html "type core::fmt::Result") Formats the value using the given formatter. [Read more](https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/metadata.rs.html#155-168) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-FromRequest%3C'r%3E-for-Metadata%3C'r%3E) ### impl<'r> [FromRequest](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html "trait rocket::request::from_request::FromRequest") <'r> for [Metadata](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html "struct rocket_dyn_templates::Metadata") <'r> Retrieves the template metadata. If a template fairing hasn’t been attached, an error is printed and an empty `Err` with status `InternalServerError` (`500`) is returned. [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/metadata.rs.html#156) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html#associatedtype.Error) = [()](https://doc.rust-lang.org/nightly/std/primitive.unit.html) The associated error to be returned if derivation fails. [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/metadata.rs.html#158-167) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.from_request) #### fn [from\_request](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request) <'life0, 'async\_trait>( request: &'r [Request](https://api.rocket.rs/v0.5/rocket/request/request/struct.Request.html "struct rocket::request::request::Request") <'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'r: 'async\_trait, 'life0: 'async\_trait, Derives an instance of `Self` from the incoming request metadata. [Read more](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request) [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/metadata.rs.html#136-149) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Sentinel-for-Metadata%3C'_%3E) ### impl [Sentinel](https://api.rocket.rs/v0.5/rocket/sentinel/trait.Sentinel.html "trait rocket::sentinel::Sentinel") for [Metadata](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html "struct rocket_dyn_templates::Metadata") <'\_> [Source](https://api.rocket.rs/v0.5/src/rocket_dyn_templates/metadata.rs.html#137-148) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.abort) #### fn [abort](https://api.rocket.rs/v0.5/rocket/sentinel/trait.Sentinel.html#tymethod.abort) (rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Ignite](https://api.rocket.rs/v0.5/rocket/phase/enum.Ignite.html "enum rocket::phase::Ignite") \>) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if launch should be aborted and `false` otherwise. Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#synthetic-implementations) ------------------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Freeze-for-Metadata%3C'a%3E) ### impl<'a> [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Metadata](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html "struct rocket_dyn_templates::Metadata") <'a> [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-RefUnwindSafe-for-Metadata%3C'a%3E) ### impl<'a> [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Metadata](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html "struct rocket_dyn_templates::Metadata") <'a> [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Send-for-Metadata%3C'a%3E) ### impl<'a> [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Metadata](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html "struct rocket_dyn_templates::Metadata") <'a> [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Sync-for-Metadata%3C'a%3E) ### impl<'a> [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Metadata](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html "struct rocket_dyn_templates::Metadata") <'a> [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Unpin-for-Metadata%3C'a%3E) ### impl<'a> [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Metadata](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html "struct rocket_dyn_templates::Metadata") <'a> [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-UnwindSafe-for-Metadata%3C'a%3E) ### impl<'a> [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Metadata](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html "struct rocket_dyn_templates::Metadata") <'a> Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#blanket-implementations) -------------------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html "trait asn1_rs::traits::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.explicit) #### fn [explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Explicit.html "enum asn1_rs::asn1_types::tagged::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html "trait asn1_rs::traits::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.implicit) #### fn [implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Implicit.html "enum asn1_rs::asn1_types::tagged::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-From%3CT%3E-for-T) ### impl [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.from) #### fn [from](https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Into%3CU%3E-for-T) ### impl [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") for T where U: [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.into) #### fn [into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-IntoCollection%3CT%3E-for-T) ### impl IntoCollection for T [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.into_collection) #### fn into\_collection(self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.mapped) #### fn mapped(self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html "trait core::ops::function::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") where F: [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-2) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-3) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-4) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-5) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-6) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-7) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-8) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-9) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-10) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-11) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-12) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-13) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-14) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-15) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-16) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-17) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-18) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-19) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-20) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-21) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-22) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-23) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-24) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-25) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-26) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-27) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-28) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-29) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-30) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-31) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-32) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-33) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-34) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-35) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-36) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-37) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-38) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-39) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-40) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-41) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-42) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-43) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-44) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-45) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-46) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-47) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-48) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-49) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-50) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-51) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-52) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-53) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-54) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-55) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-56) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-57) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-58) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-59) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#example-60) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#194) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Pointable-for-T) ### impl [Pointable](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html "trait crossbeam_epoch::atomic::Pointable") for T [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#195) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#associatedconstant.ALIGN) #### const [ALIGN](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#associatedconstant.ALIGN) : [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) The alignment of pointer. [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#197) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#associatedtype.Init) #### type [Init](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#associatedtype.Init) = T The type for initializers. [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#199) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.init) #### unsafe fn [init](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.init) (init: ::[Init](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#associatedtype.Init "type crossbeam_epoch::atomic::Pointable::Init") ) -> [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) Initializes a with the given initializer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.init) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#203) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.deref) #### unsafe fn [deref](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref) <'a>(ptr: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) -> [&'a T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Dereferences the given pointer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#207) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.deref_mut) #### unsafe fn [deref\_mut](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref_mut) <'a>(ptr: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) -> [&'a mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably dereferences the given pointer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref_mut) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#211) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.drop) #### unsafe fn [drop](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.drop) (ptr: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) Drops the object pointed to by the given pointer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.drop) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") for T where U: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#associatedtype.Error-2) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.try_from) #### fn [try\_from](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html "trait core::convert::TryInto") for T where U: [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#associatedtype.Error-1) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.try_into) #### fn [try\_into](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # Ident in rocket::config - Rust [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#) ---------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[config](https://api.rocket.rs/v0.5/rocket/config/index.html) Struct Ident Copy item path =========================== [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#78) pub struct Ident(/* private fields */); Expand description An identifier (or `None`) to send as the `Server` header. [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#deserialization) Deserialization ------------------------------------------------------------------------------------------ An `Ident` deserializes from any of the following: * `string` The string must be a valid `Ident`. See [`Ident::try_new()`](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html#method.try_new "associated function rocket::config::Ident::try_new") for details. * `boolean` The boolean must be `false`. The value will be [`Ident::none()`](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html#method.none "associated function rocket::config::Ident::none") . * `Option` If `Some`, this is the same as deserializing from the inner string. If `None`, the value is [`Ident::none()`](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html#method.none "associated function rocket::config::Ident::none") . * `unit` Always deserializes as [`Ident::none()`](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html#method.none "associated function rocket::config::Ident::none") . [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#examples) Examples ---------------------------------------------------------------------------- As with all Rocket configuration options, when using the default [`Config::figment()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.figment "associated function rocket::Config::figment") , `Ident` can be configured via a `Rocket.toml` file. When no value for `ident` is provided, the value defaults to `"Rocket"`. Because a default is provided, configuration only needs to provided to customize or remove the value. use rocket::config::{Config, Ident}; // If these are the contents of `Rocket.toml`... [default] ident = false // The config parses as follows: assert_eq!(config.ident, Ident::none()); // If these are the contents of `Rocket.toml`... [default] ident = "My Server" // The config parses as follows: assert_eq!(config.ident, Ident::try_new("My Server").unwrap()); The following example illustrates manual configuration: use rocket::config::{Config, Ident}; let figment = rocket::Config::figment().merge(("ident", false)); let config = rocket::Config::from(figment); assert_eq!(config.ident, Ident::none()); let figment = rocket::Config::figment().merge(("ident", "Fancy/1.0")); let config = rocket::Config::from(figment); assert_eq!(config.ident, Ident::try_new("Fancy/1.0").unwrap()); Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#implementations) ------------------------------------------------------------------------------------------ [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#94-175) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Ident) ### impl [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#128-136) #### pub fn [try\_new](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.try_new) >(ident: S) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") , [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") \> Returns a new `Ident` with the string `ident`. When configured as the [`Config::ident`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.ident "field rocket::Config::ident") , Rocket will set a `Server` header with the `ident` value on all responses. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#errors) Errors The string `ident` must be non-empty and may only contain visible ASCII characters. The first character cannot be whitespace. The only whitespace characters allowed are (space) and `\t` (horizontal tab). The string is returned wrapped in `Err` if it contains any invalid characters. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example) Example use rocket::config::Ident; let ident = Ident::try_new("Rocket").unwrap(); assert_eq!(ident.as_str(), Some("Rocket")); let ident = Ident::try_new("Rocket Run").unwrap(); assert_eq!(ident.as_str(), Some("Rocket Run")); let ident = Ident::try_new(" Rocket"); assert!(ident.is_err()); let ident = Ident::try_new("Rocket\nRun"); assert!(ident.is_err()); let ident = Ident::try_new("\tShip"); assert!(ident.is_err()); [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#152-154) #### pub const fn [none](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.none) () -> [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") Returns a new `Ident` which is `None`. When configured as the [`Config::ident`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.ident "field rocket::Config::ident") , Rocket will not set a `Server` header on any response. Any `Server` header emitted by the application will still be written out. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-1) Example use rocket::config::Ident; let ident = Ident::none(); assert_eq!(ident.as_str(), None); [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#172-174) #### pub fn [as\_str](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.as_str) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <&[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) \> Returns `self` as an `Option<&str>`. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-2) Example use rocket::config::Ident; let ident = Ident::try_new("Rocket").unwrap(); assert_eq!(ident.as_str(), Some("Rocket")); let ident = Ident::try_new("Rocket/1 (Unix)").unwrap(); assert_eq!(ident.as_str(), Some("Rocket/1 (Unix)")); let ident = Ident::none(); assert_eq!(ident.as_str(), None); Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#trait-implementations) ------------------------------------------------------------------------------------------------------ [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#77) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Clone-for-Ident) ### impl [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#77) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.clone) #### fn [clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) (&self) -> [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#245-247) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.clone_from) #### fn [clone\_from](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) (&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#77) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Debug-for-Ident) ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#77) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.fmt) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#234-238) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Default-for-Ident) ### impl [Default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html "trait core::default::Default") for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") The default `Ident` is `"Rocket"`. [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#235-237) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.default) #### fn [default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default) () -> Self Returns the “default value” for a type. [Read more](https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default) [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#177-222) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Deserialize%3C'de%3E-for-Ident) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#178-221) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.deserialize) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html#tymethod.deserialize) >(de: D) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") Deserialize this value from the given Serde deserializer. [Read more](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html#tymethod.deserialize) [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#224-231) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Display-for-Ident) ### impl [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#225-230) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.fmt-1) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#77) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-PartialEq-for-Ident) ### impl [PartialEq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::PartialEq") for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#77) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.eq) #### fn [eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html#tymethod.eq) (&self, other: &[Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `self` and `other` values to be equal, and is used by `==`. 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#264) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.ne) #### fn [ne](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html#method.ne) (&self, other: [&Rhs](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#77) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Serialize-for-Ident) ### impl [Serialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html "trait rocket::serde::Serialize") for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#77) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.serialize) #### fn [serialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html#tymethod.serialize) <\_\_S>(&self, \_\_serializer: \_\_S) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <\_\_S::[Ok](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html#associatedtype.Ok "type rocket::serde::Serializer::Ok") , \_\_S::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html#associatedtype.Error "type rocket::serde::Serializer::Error") \> where \_\_S: [Serializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html "trait rocket::serde::Serializer") , Serialize this value into the given Serde serializer. [Read more](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html#tymethod.serialize) [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#77) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-StructuralPartialEq-for-Ident) ### impl [StructuralPartialEq](https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html "trait core::marker::StructuralPartialEq") for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#synthetic-implementations) --------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Freeze-for-Ident) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-RefUnwindSafe-for-Ident) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Send-for-Ident) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Sync-for-Ident) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Unpin-for-Ident) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-UnwindSafe-for-Ident) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#blanket-implementations) ---------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#547) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-CloneToUninit-for-T) ### impl [CloneToUninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html "trait core::clone::CloneToUninit") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#549) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.clone_to_uninit) #### unsafe fn [clone\_to\_uninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) (&self, dest: [\*mut](https://doc.rust-lang.org/nightly/std/primitive.pointer.html) [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) 🔬This is a nightly-only experimental API. (`clone_to_uninit`) Performs copy-assignment from `self` to `dest`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-3) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-4) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-5) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-6) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-7) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-8) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-9) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-10) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-11) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-12) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-13) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-14) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-15) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-16) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-17) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-18) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-19) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-20) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-21) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-22) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-23) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-24) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-25) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-26) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-27) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-28) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-29) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-30) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-31) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-32) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-33) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-34) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-35) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-36) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-37) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-38) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-39) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-40) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-41) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-42) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-43) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-44) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-45) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-46) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-47) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-48) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-49) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-50) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-51) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-52) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-53) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-54) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-55) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-56) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-57) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-58) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-59) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-60) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#example-61) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-ToOwned-for-T) ### impl [ToOwned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html "trait alloc::borrow::ToOwned") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#associatedtype.Owned) #### type [Owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned) = T The resulting type after obtaining ownership. [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#90) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.to_owned) #### fn [to\_owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) (&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#94) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.clone_into) #### fn [clone\_into](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) (&self, target: [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) Uses borrowed data to replace owned data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2861) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-ToString-for-T) ### impl [ToString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::string::ToString") for T where T: [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2863) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.to_string) #### fn [to\_string](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string) (&self) -> [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") Converts the given value to a `String`. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/mod.rs.html#633) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Ident#impl-DeserializeOwned-for-T) ### impl [DeserializeOwned](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned.html "trait rocket::serde::DeserializeOwned") for T where T: for<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, --- # Catcher in rocket::catcher - Rust [Catcher](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#) --------------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[catcher](https://api.rocket.rs/v0.5/rocket/catcher/index.html) Struct Catcher Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#112-124) pub struct Catcher { pub name: Option>, pub base: Origin<'static>, pub code: Option, pub handler: Box, } Expand description An error catching route. Catchers are routes that run when errors are produced by the application. They consist of a [`Handler`](https://api.rocket.rs/v0.5/rocket/catcher/trait.Handler.html "trait rocket::catcher::Handler") and an optional status code to match against arising errors. Errors arise from the the following sources: * A failing guard. * A failing responder. * A forwarding guard. * Routing failure. Each error or forward is paired with a status code. Guards and responders indicate the status code themselves via their `Err` and `Outcome` return value. A complete routing failure is always a `404`. Rocket invokes the error handler for the catcher with an error’s status code, or in the case of every route resulting in a forward, the last forwarded status code. #### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#error-handler-restrictions) Error Handler Restrictions Because error handlers are a last resort, they should not fail to produce a response. If an error handler _does_ fail, Rocket invokes its default `500` error catcher. Error handlers cannot forward. [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#routing) Routing ----------------------------------------------------------------------------- If a route fails by returning an error [`Outcome`](https://api.rocket.rs/v0.5/rocket/request/type.Outcome.html "type rocket::request::Outcome") , Rocket routes the erroring request to the highest precedence catcher among all the catchers that match. Precedence is determined by the catcher’s _base_, which is provided as the first argument to [`Rocket::register()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.register "method rocket::Rocket::register") . Catchers with more non-empty segments have a higher precedence. Rocket provides [built-in defaults](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#built-in-default) , but _default_ catchers can also be registered. A _default_ catcher is a catcher with no explicit status code: `None`. [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#collisions) Collisions ----------------------------------------------------------------------------------- Two catchers are said to _collide_ if there exists an error that matches both catchers. Colliding catchers present a routing ambiguity and are thus disallowed by Rocket. Because catchers can be constructed dynamically, collision checking is done at [`ignite`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.ignite "method rocket::Rocket::ignite") time, after it becomes statically impossible to register any more catchers on an instance of `Rocket`. #### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#built-in-default) Built-In Default Rocket’s provides a built-in default catcher that can handle all errors. It produces HTML or JSON, depending on the value of the `Accept` header. As such, catchers only need to be registered if an error needs to be handled in a custom fashion. The built-in default never conflicts with any user-registered catchers. [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#code-generation) Code Generation --------------------------------------------------------------------------------------------- Catchers should rarely be constructed or used directly. Instead, they are typically generated via the [`catch`](https://api.rocket.rs/v0.5/rocket/attr.catch.html "attr rocket::catch") attribute, as follows: #[macro_use] extern crate rocket; use rocket::Request; use rocket::http::Status; #[catch(500)] fn internal_error() -> &'static str { "Whoops! Looks like we messed up." } #[catch(404)] fn not_found(req: &Request) -> String { format!("I couldn't find '{}'. Try something else?", req.uri()) } #[catch(default)] fn default(status: Status, req: &Request) -> String { format!("{} ({})", status, req.uri()) } #[launch] fn rocket() -> _ { rocket::build().register("/", catchers![internal_error, not_found, default]) } A function decorated with `#[catch]` may take zero, one, or two arguments. It’s type signature must be one of the following, where `R:`[`Responder`](https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html "trait rocket::response::Responder") : * `fn() -> R` * `fn(`[`&Request`](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") `) -> R` * `fn(`[`Status`](https://api.rocket.rs/v0.5/rocket/http/struct.Status.html "struct rocket::http::Status") `,` [`&Request`](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") `) -> R` See the [`catch`](https://api.rocket.rs/v0.5/rocket/attr.catch.html "attr rocket::catch") documentation for full details. Fields[§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#fields) --------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#structfield.name) `name: [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow") <'static, [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) >>` The name of this catcher, if one was given. [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#structfield.base) `base: [Origin](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html "struct rocket::http::uri::Origin") <'static>` The mount point. [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#structfield.code) `code: [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html) >` The HTTP status to match against if this route is not `default`. [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#structfield.handler) `handler: [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") ` The catcher’s associated error handler. Implementations[§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#implementations) --------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#126-222) [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Catcher) ### impl [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher") [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#163-177) #### pub fn [new](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.new) (code: S, handler: H) -> [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher") where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html) \>>, H: [Handler](https://api.rocket.rs/v0.5/rocket/catcher/trait.Handler.html "trait rocket::catcher::Handler") , Creates a catcher for the given `status`, or a default catcher if `status` is `None`, using the given error handler. This should only be used when routing manually. ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#examples) Examples use rocket::request::Request; use rocket::catcher::{Catcher, BoxFuture}; use rocket::response::Responder; use rocket::http::Status; fn handle_404<'r>(status: Status, req: &'r Request<'_>) -> BoxFuture<'r> { let res = (status, format!("404: {}", req.uri())); Box::pin(async move { res.respond_to(req) }) } fn handle_500<'r>(_: Status, req: &'r Request<'_>) -> BoxFuture<'r> { Box::pin(async move{ "Whoops, we messed up!".respond_to(req) }) } fn handle_default<'r>(status: Status, req: &'r Request<'_>) -> BoxFuture<'r> { let res = (status, format!("{}: {}", status, req.uri())); Box::pin(async move { res.respond_to(req) }) } let not_found_catcher = Catcher::new(404, handle_404); let internal_server_error_catcher = Catcher::new(500, handle_500); let default_error_catcher = Catcher::new(None, handle_default); ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#panics) Panics Panics if `code` is not in the HTTP status code error range `[400, 600)`.\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#212-221)\ \ #### pub fn [map\_base](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.map_base)\ <'a, F>(self, mapper: F) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result")\ >\ \ where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce")\ ([Origin](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html "struct rocket::http::uri::Origin")\ <'a>) -> [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String")\ ,\ \ Maps the `base` of this catcher using `mapper`, returning a new `Catcher` with the returned base.\ \ `mapper` is called with the current base. The returned `String` is used as the new base if it is a valid URI. If the returned base URI contains a query, it is ignored. Returns an error if the base produced by `mapper` is not a valid origin URI.\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example)\ Example\ \ use rocket::request::Request;\ use rocket::catcher::{Catcher, BoxFuture};\ use rocket::response::Responder;\ use rocket::http::Status;\ \ fn handle_404<'r>(status: Status, req: &'r Request<'_>) -> BoxFuture<'r> {\ let res = (status, format!("404: {}", req.uri()));\ Box::pin(async move { res.respond_to(req) })\ }\ \ let catcher = Catcher::new(404, handle_404);\ assert_eq!(catcher.base.path(), "/");\ \ let catcher = catcher.map_base(|_| format!("/bar")).unwrap();\ assert_eq!(catcher.base.path(), "/bar");\ \ let catcher = catcher.map_base(|base| format!("/foo{}", base)).unwrap();\ assert_eq!(catcher.base.path(), "/foo/bar");\ \ let catcher = catcher.map_base(|base| format!("/foo ? {}", base));\ assert!(catcher.is_err());\ \ Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#trait-implementations)\ \ ---------------------------------------------------------------------------------------------------------\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#111)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Clone-for-Catcher)\ \ ### impl [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#111)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.clone)\ \ #### fn [clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone)\ (&self) -> [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone)\ \ 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#245-247)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.clone_from)\ \ #### fn [clone\_from](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from)\ (&mut self, source: &Self)\ \ Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#274-282)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Debug-for-Catcher)\ \ ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#275-281)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.fmt-1)\ \ #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt)\ (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter")\ <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result")\ \ Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#224-234)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Default-for-Catcher)\ \ ### impl [Default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html "trait core::default::Default")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#225-233)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.default)\ \ #### fn [default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default)\ () -> Self\ \ Returns the “default value” for a type. [Read more](https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default)\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#257-272)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Display-for-Catcher)\ \ ### impl [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [Source](https://api.rocket.rs/v0.5/src/rocket/catcher/catcher.rs.html#258-271)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.fmt)\ \ #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt)\ (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter")\ <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result")\ \ Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt)\ \ Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#synthetic-implementations)\ \ ------------------------------------------------------------------------------------------------------------------\ \ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Freeze-for-Catcher)\ \ ### impl ![Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-RefUnwindSafe-for-Catcher)\ \ ### impl ![RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Send-for-Catcher)\ \ ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Sync-for-Catcher)\ \ ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Unpin-for-Catcher)\ \ ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-UnwindSafe-for-Catcher)\ \ ### impl ![UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe")\ for [Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher")\ \ Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#blanket-implementations)\ \ -------------------------------------------------------------------------------------------------------------\ \ [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Any-for-T)\ \ ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any")\ for T\ \ where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.type_id)\ \ #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id)\ (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId")\ \ Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id)\ \ [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-AsTaggedExplicit%3C'a%3E-for-T)\ \ ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit")\ <'a> for T\ \ where T: 'a,\ \ [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.explicit)\ \ #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit)\ (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class")\ , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html)\ ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser")\ <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit")\ , Self>\ \ [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-AsTaggedImplicit%3C'a%3E-for-T)\ \ ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit")\ <'a> for T\ \ where T: 'a,\ \ [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.implicit)\ \ #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit)\ ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class")\ , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html)\ , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html)\ , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser")\ <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit")\ , Self>\ \ [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Borrow%3CT%3E-for-T)\ \ ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow")\ for T\ \ where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.borrow)\ \ #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow)\ (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \ Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow)\ \ [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-BorrowMut%3CT%3E-for-T)\ \ ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut")\ for T\ \ where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.borrow_mut)\ \ #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut)\ (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \ Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut)\ \ [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#547)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-CloneToUninit-for-T)\ \ ### impl [CloneToUninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html "trait core::clone::CloneToUninit")\ for T\ \ where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#549)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.clone_to_uninit)\ \ #### unsafe fn [clone\_to\_uninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit)\ (&self, dest: [\*mut](https://doc.rust-lang.org/nightly/std/primitive.pointer.html)\ [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ )\ \ 🔬This is a nightly-only experimental API. (`clone_to_uninit`)\ \ Performs copy-assignment from `self` to `dest`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit)\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-From%3CT%3E-for-T)\ \ ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From")\ for T\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.from)\ \ #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from)\ (t: T) -> T\ \ Returns the argument unchanged.\ \ [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Instrument-for-T)\ \ ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument")\ for T\ \ [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.instrument)\ \ #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument)\ (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span")\ ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented")\ [ⓘ](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#)\ \ Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span")\ , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument)\ \ [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.in_current_span)\ \ #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span)\ (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented")\ [ⓘ](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#)\ \ Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current")\ [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span")\ , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span)\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Into%3CU%3E-for-T)\ \ ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into")\ for T\ \ where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.into)\ \ #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into)\ (self) -> U\ \ Calls `U::from(self)`.\ \ That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do.\ \ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-IntoCollection%3CT%3E-for-T)\ \ ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection")\ for T\ \ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.into_collection)\ \ #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection)\ (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec")\ \ \ where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array")\ ,\ \ Converts `self` into a collection.\ \ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.mapped)\ \ #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped)\ (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec")\ \ \ where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut")\ (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array")\ ,\ \ [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-IntoEither-for-T)\ \ ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither")\ for T\ \ [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.into_either)\ \ #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either)\ (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html)\ ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either")\ [ⓘ](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#)\ \ Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left")\ variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either")\ if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right")\ variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either")\ otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either)\ \ [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.into_either_with)\ \ #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with)\ (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either")\ [ⓘ](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#)\ \ where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce")\ (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html)\ ,\ \ Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left")\ variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either")\ if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right")\ variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either")\ otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with)\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Paint-for-T)\ \ ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint")\ for T\ \ where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized")\ ,\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.fg)\ \ #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg)\ (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color")\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns a styled value derived from `self` with the foreground set to `value`.\ \ This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red())\ and [`green()`](self::green())\ , which have the same functionality but are pithier.\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-1)\ Example\ \ Set foreground color to white using `fg()`:\ \ use yansi::{Paint, Color};\ \ painted.fg(Color::White);\ \ Set foreground color to white using [`white()`](self::white())\ .\ \ use yansi::Paint;\ \ painted.white();\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.primary)\ \ #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Primary`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-2)\ Example\ \ println!("{}", value.primary());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.fixed)\ \ #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed)\ (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Fixed`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-3)\ Example\ \ println!("{}", value.fixed(color));\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.rgb)\ \ #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb)\ (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Rgb`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-4)\ Example\ \ println!("{}", value.rgb(r, g, b));\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.black)\ \ #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Black`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-5)\ Example\ \ println!("{}", value.black());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.red)\ \ #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Red`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-6)\ Example\ \ println!("{}", value.red());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.green)\ \ #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Green`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-7)\ Example\ \ println!("{}", value.green());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.yellow)\ \ #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Yellow`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-8)\ Example\ \ println!("{}", value.yellow());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.blue)\ \ #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Blue`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-9)\ Example\ \ println!("{}", value.blue());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.magenta)\ \ #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Magenta`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-10)\ Example\ \ println!("{}", value.magenta());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.cyan)\ \ #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: Cyan`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-11)\ Example\ \ println!("{}", value.cyan());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.white)\ \ #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: White`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-12)\ Example\ \ println!("{}", value.white());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.bright_black)\ \ #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightBlack`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-13)\ Example\ \ println!("{}", value.bright_black());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.bright_red)\ \ #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightRed`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-14)\ Example\ \ println!("{}", value.bright_red());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.bright_green)\ \ #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightGreen`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-15)\ Example\ \ println!("{}", value.bright_green());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.bright_yellow)\ \ #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightYellow`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-16)\ Example\ \ println!("{}", value.bright_yellow());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.bright_blue)\ \ #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightBlue`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-17)\ Example\ \ println!("{}", value.bright_blue());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.bright_magenta)\ \ #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightMagenta`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-18)\ Example\ \ println!("{}", value.bright_magenta());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.bright_cyan)\ \ #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightCyan`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-19)\ Example\ \ println!("{}", value.bright_cyan());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.bright_white)\ \ #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`fg()`](self::fg())\ set to \[`Color :: BrightWhite`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-20)\ Example\ \ println!("{}", value.bright_white());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.bg)\ \ #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg)\ (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color")\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns a styled value derived from `self` with the background set to `value`.\ \ This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red())\ and [`on_green()`](self::on_green())\ , which have the same functionality but are pithier.\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-21)\ Example\ \ Set background color to red using `fg()`:\ \ use yansi::{Paint, Color};\ \ painted.bg(Color::Red);\ \ Set background color to red using [`on_red()`](self::on_red())\ .\ \ use yansi::Paint;\ \ painted.on_red();\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_primary)\ \ #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Primary`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-22)\ Example\ \ println!("{}", value.on_primary());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_fixed)\ \ #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed)\ (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Fixed`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-23)\ Example\ \ println!("{}", value.on_fixed(color));\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_rgb)\ \ #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb)\ (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Rgb`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-24)\ Example\ \ println!("{}", value.on_rgb(r, g, b));\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_black)\ \ #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Black`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-25)\ Example\ \ println!("{}", value.on_black());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_red)\ \ #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Red`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-26)\ Example\ \ println!("{}", value.on_red());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_green)\ \ #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Green`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-27)\ Example\ \ println!("{}", value.on_green());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_yellow)\ \ #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Yellow`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-28)\ Example\ \ println!("{}", value.on_yellow());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_blue)\ \ #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Blue`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-29)\ Example\ \ println!("{}", value.on_blue());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_magenta)\ \ #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Magenta`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-30)\ Example\ \ println!("{}", value.on_magenta());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_cyan)\ \ #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: Cyan`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-31)\ Example\ \ println!("{}", value.on_cyan());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_white)\ \ #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: White`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-32)\ Example\ \ println!("{}", value.on_white());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_bright_black)\ \ #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightBlack`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-33)\ Example\ \ println!("{}", value.on_bright_black());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_bright_red)\ \ #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightRed`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-34)\ Example\ \ println!("{}", value.on_bright_red());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_bright_green)\ \ #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightGreen`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-35)\ Example\ \ println!("{}", value.on_bright_green());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_bright_yellow)\ \ #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightYellow`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-36)\ Example\ \ println!("{}", value.on_bright_yellow());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_bright_blue)\ \ #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightBlue`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-37)\ Example\ \ println!("{}", value.on_bright_blue());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_bright_magenta)\ \ #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightMagenta`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-38)\ Example\ \ println!("{}", value.on_bright_magenta());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_bright_cyan)\ \ #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightCyan`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-39)\ Example\ \ println!("{}", value.on_bright_cyan());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_bright_white)\ \ #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`bg()`](self::bg())\ set to \[`Color :: BrightWhite`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-40)\ Example\ \ println!("{}", value.on_bright_white());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.attr)\ \ #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr)\ (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute")\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute")\ `value`.\ \ This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold())\ and [`underline()`](self::underline())\ , which have the same functionality but are pithier.\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-41)\ Example\ \ Make text bold using `attr()`:\ \ use yansi::{Paint, Attribute};\ \ painted.attr(Attribute::Bold);\ \ Make text bold using using [`bold()`](self::bold())\ .\ \ use yansi::Paint;\ \ painted.bold();\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.bold)\ \ #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Bold`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-42)\ Example\ \ println!("{}", value.bold());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.dim)\ \ #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Dim`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-43)\ Example\ \ println!("{}", value.dim());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.italic)\ \ #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Italic`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-44)\ Example\ \ println!("{}", value.italic());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.underline)\ \ #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Underline`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-45)\ Example\ \ println!("{}", value.underline());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.blink)\ \ #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Blink`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-46)\ Example\ \ println!("{}", value.blink());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.rapid_blink)\ \ #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: RapidBlink`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-47)\ Example\ \ println!("{}", value.rapid_blink());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.invert)\ \ #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Invert`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-48)\ Example\ \ println!("{}", value.invert());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.conceal)\ \ #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Conceal`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-49)\ Example\ \ println!("{}", value.conceal());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.strike)\ \ #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`attr()`](self::attr())\ set to \[`Attribute :: Strike`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-50)\ Example\ \ println!("{}", value.strike());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.quirk)\ \ #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk)\ (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk")\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk")\ `value`.\ \ This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask())\ and [`wrap()`](self::wrap())\ , which have the same functionality but are pithier.\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-51)\ Example\ \ Enable wrapping using `.quirk()`:\ \ use yansi::{Paint, Quirk};\ \ painted.quirk(Quirk::Wrap);\ \ Enable wrapping using [`wrap()`](self::wrap())\ .\ \ use yansi::Paint;\ \ painted.wrap();\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.mask)\ \ #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: Mask`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-52)\ Example\ \ println!("{}", value.mask());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.wrap)\ \ #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: Wrap`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-53)\ Example\ \ println!("{}", value.wrap());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.linger)\ \ #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: Linger`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-54)\ Example\ \ println!("{}", value.linger());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.clear)\ \ #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release.\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: Clear`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-55)\ Example\ \ println!("{}", value.clear());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.resetting)\ \ #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: Resetting`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-56)\ Example\ \ println!("{}", value.resetting());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.bright)\ \ #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: Bright`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-57)\ Example\ \ println!("{}", value.bright());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.on_bright)\ \ #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright)\ (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Returns `self` with the [`quirk()`](self::quirk())\ set to \[`Quirk :: OnBright`\].\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-58)\ Example\ \ println!("{}", value.on_bright());\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.whenever)\ \ #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever)\ (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition")\ ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ \>\ \ Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition")\ `value` applies. Replaces any previous condition.\ \ See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi")\ for more details.\ \ ##### [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#example-59)\ Example\ \ Enable styling `painted` only when both `stdout` and `stderr` are TTYs:\ \ use yansi::{Paint, Condition};\ \ painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.new-1)\ \ #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new)\ (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ \ \ where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized")\ ,\ \ Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style")\ . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new)\ \ [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.paint)\ \ #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint)\ (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted")\ <&Self>\ \ where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into")\ <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style")\ \>,\ \ Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint)\ \ [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-Same-for-T)\ \ ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same")\ for T\ \ [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#associatedtype.Output)\ \ #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output)\ = T\ \ Should always be `Self`\ \ [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-ToOwned-for-T)\ \ ### impl [ToOwned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html "trait alloc::borrow::ToOwned")\ for T\ \ where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#associatedtype.Owned)\ \ #### type [Owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned)\ = T\ \ The resulting type after obtaining ownership.\ \ [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#90)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.to_owned)\ \ #### fn [to\_owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned)\ (&self) -> T\ \ Creates owned data from borrowed data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned)\ \ [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#94)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.clone_into)\ \ #### fn [clone\_into](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into)\ (&self, target: [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html)\ )\ \ Uses borrowed data to replace owned data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into)\ \ [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2861)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-ToString-for-T)\ \ ### impl [ToString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::string::ToString")\ for T\ \ where T: [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display")\ + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2863)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.to_string)\ \ #### fn [to\_string](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string)\ (&self) -> [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String")\ \ Converts the given value to a `String`. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string)\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-TryFrom%3CU%3E-for-T)\ \ ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom")\ for T\ \ where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#associatedtype.Error-1)\ \ #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error)\ = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible")\ \ The type returned in the event of a conversion error.\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.try_from)\ \ #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from)\ (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result")\ >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error")\ \>\ \ Performs the conversion.\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-TryInto%3CU%3E-for-T)\ \ ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto")\ for T\ \ where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom")\ ,\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#associatedtype.Error)\ \ #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error)\ = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error")\ \ The type returned in the event of a conversion error.\ \ [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.try_into)\ \ #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into)\ (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result")\ >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error")\ \>\ \ Performs the conversion.\ \ [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-VZip%3CV%3E-for-T)\ \ ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip")\ for T\ \ where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane")\ ,\ \ [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.vzip)\ \ #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip)\ (self) -> V\ \ [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#impl-WithSubscriber-for-T)\ \ ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber")\ for T\ \ [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.with_subscriber)\ \ #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber)\ (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch")\ [ⓘ](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#)\ \ where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into")\ <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch")\ \>,\ \ Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber")\ to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch")\ wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber)\ \ [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228)\ [§](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#method.with_current_subscriber)\ \ #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber)\ (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch")\ [ⓘ](https://api.rocket.rs/v0.5/rocket/catcher/struct.Catcher#)\ \ Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher")\ [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber")\ to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch")\ wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # rocket_db_pools::diesel - Rust [Module diesel](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/#) --------------------------------------------------------------------- [rocket\_db\_pools](https://api.rocket.rs/v0.5/rocket_db_pools/index.html) Module diesel Copy item path ============================ [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/diesel.rs.html#1-149) Expand description Re-export of [`diesel`](https://docs.rs/diesel/2.1.6/diesel/index.html "mod diesel") with prelude types overridden with `async` variants from [`diesel_async`](https://docs.rs/diesel-async/0.4.1/diesel_async/index.html "mod diesel_async") . [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/#usage) Usage ------------------------------------------------------------------- To use `async` `diesel` support provided here, enable the following dependencies in your `Cargo.toml`: [dependencies] rocket = "0.5.1" diesel = "2" [dependencies.rocket_db_pools] version = "0.2.0" features = ["diesel_mysql"] Then, import `rocket_db_pools::diesel::prelude::*` as well as the appropriate pool type and, optionally, [`QueryResult`](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/type.QueryResult.html "type rocket_db_pools::diesel::QueryResult") . To use macros or `diesel` functions, use `diesel::` directly. That is, _do not_ import `rocket_db_pools::diesel`. Doing so will, by design, cause import errors. [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/#example) Example ----------------------------------------------------------------------- use rocket_db_pools::{Database, Connection}; use rocket_db_pools::diesel::{QueryResult, MysqlPool, prelude::*}; #[derive(Database)] #[database("diesel_mysql")] struct Db(MysqlPool); #[derive(Queryable, Insertable)] #[diesel(table_name = posts)] struct Post { id: i64, title: String, published: bool, } diesel::table! { posts (id) { id -> BigInt, title -> Text, published -> Bool, } } #[get("/")] async fn list(mut db: Connection) -> QueryResult { let post_ids: Vec = posts::table .select(posts::id) .load(&mut db) .await?; Ok(format!("{post_ids:?}")) } Modules[§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/#modules) ----------------------------------------------------------------------- [prelude](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/index.html "mod rocket_db_pools::diesel::prelude") The [`diesel`](https://docs.rs/diesel/2.1.6/diesel/index.html "mod diesel") prelude with `sync`\-only traits replaced with their [`diesel_async`](https://docs.rs/diesel-async/0.4.1/diesel_async/index.html "mod diesel_async") variants. Structs[§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/#structs) ----------------------------------------------------------------------- [AsyncMysqlConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncMysqlConnection.html "struct rocket_db_pools::diesel::AsyncMysqlConnection") A connection to a MySQL database. Connection URLs should be in the form `mysql://[user[:password]@]host/database_name` [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") A connection to a PostgreSQL database. Type Aliases[§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/#types) -------------------------------------------------------------------------- [MysqlPool](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/type.MysqlPool.html "type rocket_db_pools::diesel::MysqlPool") Type alias for an `async` pool of MySQL connections for `async` [diesel](https://docs.rs/diesel/2.1.6/diesel/index.html "mod diesel") . [PgPool](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/type.PgPool.html "type rocket_db_pools::diesel::PgPool") Type alias for an `async` pool of Postgres connections for `async` [diesel](https://docs.rs/diesel/2.1.6/diesel/index.html "mod diesel") . [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/type.Pool.html "type rocket_db_pools::diesel::Pool") Type alias for using [`deadpool::managed::Pool`](https://docs.rs/deadpool/0.12.3/deadpool/managed/struct.Pool.html "struct deadpool::managed::Pool") with \[`diesel-async`\] [QueryResult](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/type.QueryResult.html "type rocket_db_pools::diesel::QueryResult") Alias of a `Result` with an error type of [`Debug`](https://api.rocket.rs/v0.5/rocket/response/debug/struct.Debug.html "struct rocket::response::debug::Debug") for a `diesel::Error`. --- # List of all items in this crate [All](https://api.rocket.rs/v0.5/rocket_ws/all#) ------------------------------------------------- List of all items ================= ### Structs * [Channel](https://api.rocket.rs/v0.5/rocket_ws/struct.Channel.html) * [Config](https://api.rocket.rs/v0.5/rocket_ws/struct.Config.html) * [WebSocket](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html) * [frame::CloseFrame](https://api.rocket.rs/v0.5/rocket_ws/frame/struct.CloseFrame.html) * [frame::Frame](https://api.rocket.rs/v0.5/rocket_ws/frame/struct.Frame.html) * [stream::DuplexStream](https://api.rocket.rs/v0.5/rocket_ws/stream/struct.DuplexStream.html) * [stream::MessageStream](https://api.rocket.rs/v0.5/rocket_ws/stream/struct.MessageStream.html) ### Enums * [Message](https://api.rocket.rs/v0.5/rocket_ws/enum.Message.html) * [frame::CloseCode](https://api.rocket.rs/v0.5/rocket_ws/frame/enum.CloseCode.html) * [result::Error](https://api.rocket.rs/v0.5/rocket_ws/result/enum.Error.html) ### Macros * [Stream](https://api.rocket.rs/v0.5/rocket_ws/macro.Stream.html) ### Type Aliases * [result::Result](https://api.rocket.rs/v0.5/rocket_ws/result/type.Result.html) --- # Config in rocket::config - Rust [Config](https://api.rocket.rs/v0.5/rocket/config/struct.Config#) ------------------------------------------------------------------ [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[config](https://api.rocket.rs/v0.5/rocket/config/index.html) Struct Config Copy item path ============================ [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#60-138) pub struct Config {Show 15 fields pub profile: Profile, pub address: IpAddr, pub port: u16, pub workers: usize, pub max_blocking: usize, pub ident: Ident, pub ip_header: Option>, pub limits: Limits, pub temp_dir: RelativePathBuf, pub keep_alive: u32, pub tls: Option, pub secret_key: SecretKey, pub shutdown: Shutdown, pub log_level: LogLevel, pub cli_colors: bool, /* private fields */ } Expand description Rocket server configuration. See the [module level docs](https://api.rocket.rs/v0.5/rocket/config/index.html "mod rocket::config") as well as the [configuration guide](https://rocket.rs/v0.5/guide/configuration/) for further details. [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#defaults) Defaults ----------------------------------------------------------------------------- All configuration values have a default, documented in the [fields](https://api.rocket.rs/v0.5/rocket/config/struct.Config#fields) section below. [`Config::debug_default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.debug_default "associated function rocket::Config::debug_default") returns the default values for the debug profile while [`Config::release_default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.release_default "associated function rocket::Config::release_default") the default values for the release profile. The [`Config::default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.default "associated function rocket::Config::default") method automatically selects the appropriate of the two based on the selected profile. With the exception of `log_level`, which is `normal` in `debug` and `critical` in `release`, and `secret_key`, which is regenerated from a random value if not set in “debug” mode only, all default values are identical in all profiles. [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#provider-details) Provider Details --------------------------------------------------------------------------------------------- `Config` is a Figment [`Provider`](https://docs.rs/figment/0.10.19/figment/provider/trait.Provider.html "trait figment::provider::Provider") with the following characteristics: * **Profile** The profile is set to the value of the `profile` field. * **Metadata** This provider is named `Rocket Config`. It does not specify a [`Source`](https://docs.rs/figment/0.10.19/figment/metadata/enum.Source.html "enum figment::metadata::Source") and uses default interpolation. * **Data** The data emitted by this provider are the keys and values corresponding to the fields and values of the structure. The dictionary is emitted to the “default” meta-profile. Note that these behaviors differ from those of [`Config::figment()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.figment "associated function rocket::Config::figment") . Fields[§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#fields) ------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.profile) `profile: [Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") ` The selected profile. **(default: _debug_ `debug` / _release_ `release`)** _**Note:** This field is never serialized nor deserialized. When a `Config` is merged into a `Figment` as a `Provider`, this profile is selected on the `Figment`. When a `Config` is extracted, this field is set to the extracting Figment’s selected `Profile`._ [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.address) `address: [IpAddr](https://doc.rust-lang.org/nightly/core/net/ip_addr/enum.IpAddr.html "enum core::net::ip_addr::IpAddr") ` IP address to serve on. **(default: `127.0.0.1`)** [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.port) `port: [u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html) ` Port to serve on. **(default: `8000`)** [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.workers) `workers: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ` Number of threads to use for executing futures. **(default: `num_cores`)** _**Note:** Rocket only reads this value from sources in the [default provider](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.figment "associated function rocket::Config::figment") ._ [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.max_blocking) `max_blocking: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ` Limit on threads to start for blocking tasks. **(default: `512`)** [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.ident) `ident: [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") ` How, if at all, to identify the server via the `Server` header. **(default: `"Rocket"`)** [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.ip_header) `ip_header: [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[Uncased](https://api.rocket.rs/v0.5/rocket/http/uncased/struct.Uncased.html "struct rocket::http::uncased::Uncased") <'static>>` The name of a header, whose value is typically set by an intermediary server or proxy, which contains the real IP address of the connecting client. Used internally and by [`Request::client_ip()`](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.client_ip "method rocket::Request::client_ip") and [`Request::real_ip()`](https://api.rocket.rs/v0.5/rocket/struct.Request.html#method.real_ip "method rocket::Request::real_ip") . To disable using any header for this purpose, set this value to `false`. Deserialization semantics are identical to those of [`Ident`](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") except that the value must syntactically be a valid HTTP header name. **(default: `"X-Real-IP"`)** [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.limits) `limits: [Limits](https://api.rocket.rs/v0.5/rocket/data/struct.Limits.html "struct rocket::data::Limits") ` Streaming read size limits. **(default: [`Limits::default()`](https://api.rocket.rs/v0.5/rocket/data/struct.Limits.html#method.default "associated function rocket::data::Limits::default") )** [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.temp_dir) `temp_dir: [RelativePathBuf](https://docs.rs/figment/0.10.19/figment/value/magic/struct.RelativePathBuf.html "struct figment::value::magic::RelativePathBuf") ` Directory to store temporary files in. **(default: [`std::env::temp_dir()`](https://doc.rust-lang.org/nightly/std/env/fn.temp_dir.html "fn std::env::temp_dir") )** [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.keep_alive) `keep_alive: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ` Keep-alive timeout in seconds; disabled when `0`. **(default: `5`)** [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.tls) `tls: [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[TlsConfig](https://api.rocket.rs/v0.5/rocket/config/struct.TlsConfig.html "struct rocket::config::TlsConfig") >` Available on **crate feature `tls`** only. The TLS configuration, if any. **(default: `None`)** [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.secret_key) `secret_key: [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") ` Available on **crate feature `secrets`** only. The secret key for signing and encrypting. **(default: `0`)** _**Note:** This field _always_ serializes as a 256-bit array of `0`s to aid in preventing leakage of the secret key._ [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.shutdown) `shutdown: [Shutdown](https://api.rocket.rs/v0.5/rocket/config/struct.Shutdown.html "struct rocket::config::Shutdown") ` Graceful shutdown configuration. **(default: [`Shutdown::default()`](https://api.rocket.rs/v0.5/rocket/config/struct.Shutdown.html#method.default "associated function rocket::config::Shutdown::default") )** [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.log_level) `log_level: [LogLevel](https://api.rocket.rs/v0.5/rocket/config/enum.LogLevel.html "enum rocket::config::LogLevel") ` Max level to log. **(default: _debug_ `normal` / _release_ `critical`)** [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#structfield.cli_colors) `cli_colors: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ` Whether to use colors and emoji when logging. **(default: `true`)** Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#implementations) ------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#158-469) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Config) ### impl [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#183-204) #### pub fn [debug\_default](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.debug_default) () -> [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Returns the default configuration for the `debug` profile, _irrespective of the Rust compilation profile_ and `ROCKET_PROFILE`. This may differ from the configuration used by default, [`Config::default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.default "associated function rocket::Config::default") , which is selected based on the Rust compilation profile. See [defaults](https://api.rocket.rs/v0.5/rocket/config/struct.Config#defaults) and [provider details](https://api.rocket.rs/v0.5/rocket/config/struct.Config#provider-details) for specifics. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example) Example use rocket::Config; let config = Config::debug_default(); [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#221-227) #### pub fn [release\_default](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.release_default) () -> [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Returns the default configuration for the `release` profile, _irrespective of the Rust compilation profile_ and `ROCKET_PROFILE`. This may differ from the configuration used by default, [`Config::default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.default "associated function rocket::Config::default") , which is selected based on the Rust compilation profile. See [defaults](https://api.rocket.rs/v0.5/rocket/config/struct.Config#defaults) and [provider details](https://api.rocket.rs/v0.5/rocket/config/struct.Config#provider-details) for specifics. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-1) Example use rocket::Config; let config = Config::release_default(); [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#257-262) #### pub fn [figment](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.figment) () -> [Figment](https://docs.rs/figment/0.10.19/figment/figment/struct.Figment.html "struct figment::figment::Figment") Returns the default provider figment used by [`rocket::build()`](https://api.rocket.rs/v0.5/rocket/fn.build.html "fn rocket::build") . The default figment reads from the following sources, in ascending priority order: 1. [`Config::default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.default "associated function rocket::Config::default") (see [defaults](https://api.rocket.rs/v0.5/rocket/config/struct.Config#defaults) ) 2. `Rocket.toml` _or_ filename in `ROCKET_CONFIG` environment variable 3. `ROCKET_` prefixed environment variables The profile selected is the value set in the `ROCKET_PROFILE` environment variable. If it is not set, it defaults to `debug` when compiled in debug mode and `release` when compiled in release mode. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-2) Example use rocket::Config; use serde::Deserialize; #[derive(Deserialize)] struct MyConfig { app_key: String, } let my_config = Config::figment().extract::(); [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#280-285) #### pub fn [try\_from](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.try_from) (provider: T) -> [Result](https://docs.rs/figment/0.10.19/figment/error/type.Result.html "type figment::error::Result") Attempts to extract a `Config` from `provider`, returning the result. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-3) Example use rocket::Config; use rocket::figment::providers::{Toml, Format, Env}; // Use Rocket's default `Figment`, but allow values from `MyApp.toml` // and `MY_APP_` prefixed environment variables to supersede its values. let figment = Config::figment() .merge(("some-thing", 123)) .merge(Env::prefixed("CONFIG_")); let config = Config::try_from(figment); [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#308-310) #### pub fn [from](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.from) (provider: T) -> Self Extract a `Config` from `provider`, panicking if extraction fails. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#panics) Panics If extraction fails, prints an error message indicating the error and panics. For a version that doesn’t panic, use [`Config::try_from()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.try_from "associated function rocket::Config::try_from") . ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-4) Example use rocket::Config; use rocket::figment::providers::{Toml, Format, Env}; // Use Rocket's default `Figment`, but allow values from `MyApp.toml` // and `MY_APP_` prefixed environment variables to supersede its values. let figment = Config::figment() .merge(Toml::file("MyApp.toml").nested()) .merge(Env::prefixed("MY_APP_")); let config = Config::from(figment); [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#329-335) #### pub fn [tls\_enabled](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.tls_enabled) (&self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if TLS is enabled. TLS is enabled when the `tls` feature is enabled and TLS has been configured with at least one ciphersuite. Note that without changing defaults, all supported ciphersuites are enabled in the recommended configuration. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-5) Example let config = rocket::Config::default(); if config.tls_enabled() { println!("TLS is enabled!"); } else { println!("TLS is disabled."); } [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#353-363) #### pub fn [mtls\_enabled](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.mtls_enabled) (&self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if mTLS is enabled. mTLS is enabled when TLS is enabled ([`Config::tls_enabled()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.tls_enabled "method rocket::Config::tls_enabled") ) _and_ the `mtls` feature is enabled _and_ mTLS has been configured with a CA certificate chain. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-6) Example let config = rocket::Config::default(); if config.mtls_enabled() { println!("mTLS is enabled!"); } else { println!("mTLS is disabled."); } [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#472-486) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Config-1) ### impl [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Associated constants for default profiles. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#474) #### pub const [DEBUG\_PROFILE](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.DEBUG_PROFILE) : [Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") The default debug profile: `debug`. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#477) #### pub const [RELEASE\_PROFILE](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.RELEASE_PROFILE) : [Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") The default release profile: `release`. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#481) #### pub const [DEFAULT\_PROFILE](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.DEFAULT_PROFILE) : [Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") = Self::DEBUG\_PROFILE Available on **debug-assertions enabled** only. The default profile: “debug” on `debug`, “release” on `release`. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#489-544) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Config-2) ### impl [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Associated constants for stringy versions of configuration parameters. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#496) #### pub const [ADDRESS](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.ADDRESS) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "address" The stringy parameter name for setting/extracting [`Config::address`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.address "field rocket::Config::address") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#499) #### pub const [PORT](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.PORT) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "port" The stringy parameter name for setting/extracting [`Config::port`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.port "field rocket::Config::port") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#502) #### pub const [WORKERS](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.WORKERS) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "workers" The stringy parameter name for setting/extracting [`Config::workers`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.workers "field rocket::Config::workers") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#505) #### pub const [MAX\_BLOCKING](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.MAX_BLOCKING) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "max\_blocking" The stringy parameter name for setting/extracting [`Config::max_blocking`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.max_blocking "field rocket::Config::max_blocking") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#508) #### pub const [KEEP\_ALIVE](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.KEEP_ALIVE) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "keep\_alive" The stringy parameter name for setting/extracting [`Config::keep_alive`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.keep_alive "field rocket::Config::keep_alive") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#511) #### pub const [IDENT](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.IDENT) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "ident" The stringy parameter name for setting/extracting [`Config::ident`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.ident "field rocket::Config::ident") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#514) #### pub const [IP\_HEADER](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.IP_HEADER) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "ip\_header" The stringy parameter name for setting/extracting [`Config::ip_header`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.ip_header "field rocket::Config::ip_header") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#517) #### pub const [LIMITS](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.LIMITS) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "limits" The stringy parameter name for setting/extracting [`Config::limits`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.limits "field rocket::Config::limits") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#520) #### pub const [TLS](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.TLS) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "tls" The stringy parameter name for setting/extracting [`Config::tls`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.tls "field rocket::Config::tls") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#523) #### pub const [SECRET\_KEY](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.SECRET_KEY) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "secret\_key" The stringy parameter name for setting/extracting [`Config::secret_key`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.secret_key "field rocket::Config::secret_key") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#526) #### pub const [TEMP\_DIR](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.TEMP_DIR) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "temp\_dir" The stringy parameter name for setting/extracting [`Config::temp_dir`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.temp_dir "field rocket::Config::temp_dir") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#529) #### pub const [LOG\_LEVEL](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.LOG_LEVEL) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "log\_level" The stringy parameter name for setting/extracting [`Config::log_level`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.log_level "field rocket::Config::log_level") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#532) #### pub const [SHUTDOWN](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.SHUTDOWN) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "shutdown" The stringy parameter name for setting/extracting [`Config::shutdown`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.shutdown "field rocket::Config::shutdown") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#535) #### pub const [CLI\_COLORS](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.CLI_COLORS) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "cli\_colors" The stringy parameter name for setting/extracting [`Config::cli_colors`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.cli_colors "field rocket::Config::cli_colors") . [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#538-543) #### pub const [PARAMETERS](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedconstant.PARAMETERS) : &'static \[&'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html)\ \] An array of all of the stringy parameter names. Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#trait-implementations) ------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Clone-for-Config) ### impl [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.clone) #### fn [clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) (&self) -> [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#245-247) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.clone_from) #### fn [clone\_from](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) (&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Debug-for-Config) ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.fmt) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#140-156) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Default-for-Config) ### impl [Default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html "trait core::default::Default") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#152-155) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.default) #### fn [default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default) () -> [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Returns the default configuration based on the Rust compilation profile. This is [`Config::debug_default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.debug_default "associated function rocket::Config::debug_default") in `debug` and [`Config::release_default()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.release_default "associated function rocket::Config::release_default") in `release`. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-7) Example use rocket::Config; let config = Config::default(); [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Deserialize%3C'de%3E-for-Config) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.deserialize) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html#tymethod.deserialize) <\_\_D>(\_\_deserializer: \_\_D) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") where \_\_D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, Deserialize this value from the given Serde deserializer. [Read more](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html#tymethod.deserialize) [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#578-584) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-FromRequest%3C'r%3E-for-%26Config) ### impl<'r> [FromRequest](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html "trait rocket::request::FromRequest") <'r> for &'r [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#579) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The associated error to be returned if derivation fails. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#581-583) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.from_request) #### fn [from\_request](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#tymethod.from_request) <'life0, 'async\_trait>( req: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'r: 'async\_trait, 'life0: 'async\_trait, Derives an instance of `Self` from the incoming request metadata. [Read more](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#tymethod.from_request) [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-PartialEq-for-Config) ### impl [PartialEq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::PartialEq") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.eq) #### fn [eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html#tymethod.eq) (&self, other: &[Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `self` and `other` values to be equal, and is used by `==`. 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#264) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.ne) #### fn [ne](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html#method.ne) (&self, other: [&Rhs](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#546-575) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Provider-for-Config) ### impl [Provider](https://docs.rs/figment/0.10.19/figment/provider/trait.Provider.html "trait figment::provider::Provider") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#548-554) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.metadata) #### fn [metadata](https://docs.rs/figment/0.10.19/figment/provider/trait.Provider.html#tymethod.metadata) (&self) -> [Metadata](https://docs.rs/figment/0.10.19/figment/metadata/struct.Metadata.html "struct figment::metadata::Metadata") Returns the [`Metadata`](https://docs.rs/figment/0.10.19/figment/metadata/struct.Metadata.html "struct figment::metadata::Metadata") for this provider, identifying itself and its configuration sources. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#557-570) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.data) #### fn [data](https://docs.rs/figment/0.10.19/figment/provider/trait.Provider.html#tymethod.data) (&self) -> [Result](https://docs.rs/figment/0.10.19/figment/error/type.Result.html "type figment::error::Result") <[Map](https://docs.rs/figment/0.10.19/figment/value/value/type.Map.html "type figment::value::value::Map") <[Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") , [Dict](https://docs.rs/figment/0.10.19/figment/value/value/type.Dict.html "type figment::value::value::Dict") \>> Returns the configuration data. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#572-574) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.profile) #### fn [profile](https://docs.rs/figment/0.10.19/figment/provider/trait.Provider.html#method.profile) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") \> Optionally returns a profile to set on the [`Figment`](https://docs.rs/figment/0.10.19/figment/figment/struct.Figment.html "struct figment::figment::Figment") this provider is merged into. The profile is only set if `self` is _merged_. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Serialize-for-Config) ### impl [Serialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html "trait rocket::serde::Serialize") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.serialize) #### fn [serialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html#tymethod.serialize) <\_\_S>(&self, \_\_serializer: \_\_S) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <\_\_S::[Ok](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html#associatedtype.Ok "type rocket::serde::Serializer::Ok") , \_\_S::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html#associatedtype.Error "type rocket::serde::Serializer::Error") \> where \_\_S: [Serializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html "trait rocket::serde::Serializer") , Serialize this value into the given Serde serializer. [Read more](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html#tymethod.serialize) [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-StructuralPartialEq-for-Config) ### impl [StructuralPartialEq](https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html "trait core::marker::StructuralPartialEq") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#synthetic-implementations) ---------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Freeze-for-Config) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-RefUnwindSafe-for-Config) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Send-for-Config) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Sync-for-Config) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Unpin-for-Config) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-UnwindSafe-for-Config) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#blanket-implementations) ----------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#547) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-CloneToUninit-for-T) ### impl [CloneToUninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html "trait core::clone::CloneToUninit") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#549) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.clone_to_uninit) #### unsafe fn [clone\_to\_uninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) (&self, dest: [\*mut](https://doc.rust-lang.org/nightly/std/primitive.pointer.html) [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) 🔬This is a nightly-only experimental API. (`clone_to_uninit`) Performs copy-assignment from `self` to `dest`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.from-1) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.Config#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.Config#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.Config#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.Config#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-8) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-9) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-10) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-11) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-12) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-13) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-14) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-15) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-16) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-17) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-18) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-19) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-20) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-21) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-22) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-23) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-24) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-25) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-26) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-27) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-28) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-29) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-30) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-31) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-32) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-33) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-34) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-35) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-36) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-37) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-38) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-39) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-40) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-41) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-42) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-43) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-44) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-45) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-46) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-47) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-48) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-49) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-50) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-51) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-52) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-53) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-54) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-55) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-56) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-57) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-58) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-59) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-60) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-61) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-62) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-63) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-64) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-65) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#example-66) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-ToOwned-for-T) ### impl [ToOwned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html "trait alloc::borrow::ToOwned") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedtype.Owned) #### type [Owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned) = T The resulting type after obtaining ownership. [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#90) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.to_owned) #### fn [to\_owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) (&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#94) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.clone_into) #### fn [clone\_into](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) (&self, target: [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) Uses borrowed data to replace owned data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedtype.Error-2) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.try_from-1) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.Config#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.Config#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/mod.rs.html#633) [§](https://api.rocket.rs/v0.5/rocket/config/struct.Config#impl-DeserializeOwned-for-T) ### impl [DeserializeOwned](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned.html "trait rocket::serde::DeserializeOwned") for T where T: for<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, --- # Deserialize in rocket::serde - Rust [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#) -------------------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[serde](https://api.rocket.rs/v0.5/rocket/serde/index.html) Trait Deserialize Copy item path ================================ [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/mod.rs.html#554) pub trait Deserialize<'de>: Sized { // Required method fn deserialize( deserializer: D, ) -> Result>::Error> where D: Deserializer<'de>; } Expand description A **data structure** that can be deserialized from any data format supported by Serde. Serde provides `Deserialize` implementations for many Rust primitive and standard library types. The complete list is [here](https://docs.rs/serde_core/1.0.228/serde_core/de/index.html "mod serde_core::de") . All of these can be deserialized using Serde out of the box. Additionally, Serde provides a procedural macro called `serde_derive` to automatically generate `Deserialize` implementations for structs and enums in your program. See the [derive section of the manual](https://serde.rs/derive.html) for how to use this. In rare cases it may be necessary to implement `Deserialize` manually for some type in your program. See the [Implementing `Deserialize`](https://serde.rs/impl-deserialize.html) section of the manual for more about this. Third-party crates may provide `Deserialize` implementations for types that they expose. For example the `linked-hash-map` crate provides a `LinkedHashMap` type that is deserializable by Serde because the crate provides an implementation of `Deserialize` for it. [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#lifetime) Lifetime -------------------------------------------------------------------------------- The `'de` lifetime of this trait is the lifetime of data that may be borrowed by `Self` when deserialized. See the page [Understanding deserializer lifetimes](https://serde.rs/lifetimes.html) for a more detailed explanation of these lifetimes. Required Methods[§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#required-methods) ------------------------------------------------------------------------------------------------ [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/mod.rs.html#561-563) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, Deserialize this value from the given Serde deserializer. See the [Implementing `Deserialize`](https://serde.rs/impl-deserialize.html) section of the manual for more information about how to implement this method. Dyn Compatibility[§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#dyn-compatibility) -------------------------------------------------------------------------------------------------- This trait is **not** [dyn compatible](https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility) . _In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe._ Implementations on Foreign Types[§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#foreign-impls) ------------------------------------------------------------------------------------------------------------- [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1706) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-IpAddr) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [IpAddr](https://doc.rust-lang.org/nightly/core/net/ip_addr/enum.IpAddr.html "enum core::net::ip_addr::IpAddr") Available on **crate feature `std` or non-`no_core_net`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1707-1709) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[IpAddr](https://doc.rust-lang.org/nightly/core/net/ip_addr/enum.IpAddr.html "enum core::net::ip_addr::IpAddr") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1752) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-SocketAddr) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [SocketAddr](https://doc.rust-lang.org/nightly/core/net/socket_addr/enum.SocketAddr.html "enum core::net::socket_addr::SocketAddr") Available on **crate feature `std` or non-`no_core_net`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1753-1755) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-1) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[SocketAddr](https://doc.rust-lang.org/nightly/core/net/socket_addr/enum.SocketAddr.html "enum core::net::socket_addr::SocketAddr") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/figment/0.10.19/src/figment/value/de.rs.html#430) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Value) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Value](https://docs.rs/figment/0.10.19/figment/value/value/enum.Value.html "enum figment::value::value::Value") [Source](https://docs.rs/figment/0.10.19/src/figment/value/de.rs.html#431) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-2) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) (de: D) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Value](https://docs.rs/figment/0.10.19/figment/value/value/enum.Value.html "enum figment::value::value::Value") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/toml/0.8.23/src/toml/value.rs.html#415) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Value-1) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Value](https://docs.rs/toml/0.8.23/toml/value/enum.Value.html "enum toml::value::Value") [Source](https://docs.rs/toml/0.8.23/src/toml/value.rs.html#416-418) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-3) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Value](https://docs.rs/toml/0.8.23/toml/value/enum.Value.html "enum toml::value::Value") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#70) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-bool) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#71-73) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-4) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#567) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-char) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [char](https://doc.rust-lang.org/nightly/std/primitive.char.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#569-571) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-5) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[char](https://doc.rust-lang.org/nightly/std/primitive.char.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#450-456) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-f32) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [f32](https://doc.rust-lang.org/nightly/std/primitive.f32.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#450-456) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-6) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[f32](https://doc.rust-lang.org/nightly/std/primitive.f32.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#458-464) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-f64) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#458-464) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-7) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#376-381) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-i8) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [i8](https://doc.rust-lang.org/nightly/std/primitive.i8.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#376-381) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-8) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[i8](https://doc.rust-lang.org/nightly/std/primitive.i8.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#383-389) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-i16) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [i16](https://doc.rust-lang.org/nightly/std/primitive.i16.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#383-389) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-9) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[i16](https://doc.rust-lang.org/nightly/std/primitive.i16.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#391-397) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-i32) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [i32](https://doc.rust-lang.org/nightly/std/primitive.i32.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#391-397) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-10) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[i32](https://doc.rust-lang.org/nightly/std/primitive.i32.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#399-404) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-i64) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [i64](https://doc.rust-lang.org/nightly/std/primitive.i64.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#399-404) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-11) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[i64](https://doc.rust-lang.org/nightly/std/primitive.i64.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#519-525) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-i128) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [i128](https://doc.rust-lang.org/nightly/std/primitive.i128.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#519-525) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-12) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[i128](https://doc.rust-lang.org/nightly/std/primitive.i128.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#406-411) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-isize) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#406-411) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-13) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#413-418) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-u8) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#413-418) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-14) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#420-426) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-u16) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#420-426) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-15) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#428-434) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-u32) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#428-434) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-16) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#436-441) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-u64) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [u64](https://doc.rust-lang.org/nightly/std/primitive.u64.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#436-441) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-17) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[u64](https://doc.rust-lang.org/nightly/std/primitive.u64.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#527-533) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-u128) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [u128](https://doc.rust-lang.org/nightly/std/primitive.u128.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#527-533) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-18) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[u128](https://doc.rust-lang.org/nightly/std/primitive.u128.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#31) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-()) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [()](https://doc.rust-lang.org/nightly/std/primitive.unit.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#32-34) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-19) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[()](https://doc.rust-lang.org/nightly/std/primitive.unit.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#443-448) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-usize) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#443-448) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-20) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#832) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-CString) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [CString](https://doc.rust-lang.org/nightly/alloc/ffi/c_str/struct.CString.html "struct alloc::ffi::c_str::CString") Available on **crate feature `std`, or non-`no_core_cstr` and crate feature `alloc`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#833-835) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-21) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[CString](https://doc.rust-lang.org/nightly/alloc/ffi/c_str/struct.CString.html "struct alloc::ffi::c_str::CString") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1725) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Ipv4Addr) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Ipv4Addr](https://doc.rust-lang.org/nightly/core/net/ip_addr/struct.Ipv4Addr.html "struct core::net::ip_addr::Ipv4Addr") [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1725) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-22) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Ipv4Addr](https://doc.rust-lang.org/nightly/core/net/ip_addr/struct.Ipv4Addr.html "struct core::net::ip_addr::Ipv4Addr") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1728) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Ipv6Addr) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Ipv6Addr](https://doc.rust-lang.org/nightly/core/net/ip_addr/struct.Ipv6Addr.html "struct core::net::ip_addr::Ipv6Addr") [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1728) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-23) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Ipv6Addr](https://doc.rust-lang.org/nightly/core/net/ip_addr/struct.Ipv6Addr.html "struct core::net::ip_addr::Ipv6Addr") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1771-1774) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-SocketAddrV4) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [SocketAddrV4](https://doc.rust-lang.org/nightly/core/net/socket_addr/struct.SocketAddrV4.html "struct core::net::socket_addr::SocketAddrV4") [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1771-1774) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-24) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[SocketAddrV4](https://doc.rust-lang.org/nightly/core/net/socket_addr/struct.SocketAddrV4.html "struct core::net::socket_addr::SocketAddrV4") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1777-1780) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-SocketAddrV6) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [SocketAddrV6](https://doc.rust-lang.org/nightly/core/net/socket_addr/struct.SocketAddrV6.html "struct core::net::socket_addr::SocketAddrV6") [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1777-1780) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-25) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[SocketAddrV6](https://doc.rust-lang.org/nightly/core/net/socket_addr/struct.SocketAddrV6.html "struct core::net::socket_addr::SocketAddrV6") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#376-381) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-NonZero%3Ci8%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[i8](https://doc.rust-lang.org/nightly/std/primitive.i8.html) \> [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#376-381) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-26) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[i8](https://doc.rust-lang.org/nightly/std/primitive.i8.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#383-389) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-NonZero%3Ci16%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[i16](https://doc.rust-lang.org/nightly/std/primitive.i16.html) \> [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#383-389) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-27) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[i16](https://doc.rust-lang.org/nightly/std/primitive.i16.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#391-397) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-NonZero%3Ci32%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[i32](https://doc.rust-lang.org/nightly/std/primitive.i32.html) \> [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#391-397) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-28) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[i32](https://doc.rust-lang.org/nightly/std/primitive.i32.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#399-404) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-NonZero%3Ci64%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[i64](https://doc.rust-lang.org/nightly/std/primitive.i64.html) \> [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#399-404) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-29) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[i64](https://doc.rust-lang.org/nightly/std/primitive.i64.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#519-525) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-NonZero%3Ci128%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[i128](https://doc.rust-lang.org/nightly/std/primitive.i128.html) \> [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#519-525) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-30) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[i128](https://doc.rust-lang.org/nightly/std/primitive.i128.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#406-411) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-NonZero%3Cisize%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) \> [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#406-411) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-31) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#413-418) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-NonZero%3Cu8%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) \> [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#413-418) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-32) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#420-426) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-NonZero%3Cu16%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html) \> [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#420-426) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-33) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#428-434) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-NonZero%3Cu32%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) \> [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#428-434) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-34) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#436-441) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-NonZero%3Cu64%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[u64](https://doc.rust-lang.org/nightly/std/primitive.u64.html) \> [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#436-441) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-35) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[u64](https://doc.rust-lang.org/nightly/std/primitive.u64.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#527-533) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-NonZero%3Cu128%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[u128](https://doc.rust-lang.org/nightly/std/primitive.u128.html) \> [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#527-533) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-36) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[u128](https://doc.rust-lang.org/nightly/std/primitive.u128.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#443-448) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-NonZero%3Cusize%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) \> [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#443-448) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-37) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#376-381) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Saturating%3Ci8%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[i8](https://doc.rust-lang.org/nightly/std/primitive.i8.html) \> Available on **non-`no_core_num_saturating`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#376-381) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-38) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[i8](https://doc.rust-lang.org/nightly/std/primitive.i8.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#383-389) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Saturating%3Ci16%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[i16](https://doc.rust-lang.org/nightly/std/primitive.i16.html) \> Available on **non-`no_core_num_saturating`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#383-389) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-39) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[i16](https://doc.rust-lang.org/nightly/std/primitive.i16.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#391-397) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Saturating%3Ci32%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[i32](https://doc.rust-lang.org/nightly/std/primitive.i32.html) \> Available on **non-`no_core_num_saturating`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#391-397) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-40) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[i32](https://doc.rust-lang.org/nightly/std/primitive.i32.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#399-404) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Saturating%3Ci64%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[i64](https://doc.rust-lang.org/nightly/std/primitive.i64.html) \> Available on **non-`no_core_num_saturating`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#399-404) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-41) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[i64](https://doc.rust-lang.org/nightly/std/primitive.i64.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#519-525) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Saturating%3Ci128%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[i128](https://doc.rust-lang.org/nightly/std/primitive.i128.html) \> Available on **non-`no_core_num_saturating`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#519-525) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-42) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[i128](https://doc.rust-lang.org/nightly/std/primitive.i128.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#406-411) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Saturating%3Cisize%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) \> Available on **non-`no_core_num_saturating`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#406-411) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-43) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#413-418) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Saturating%3Cu8%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) \> Available on **non-`no_core_num_saturating`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#413-418) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-44) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#420-426) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Saturating%3Cu16%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html) \> Available on **non-`no_core_num_saturating`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#420-426) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-45) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#428-434) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Saturating%3Cu32%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) \> Available on **non-`no_core_num_saturating`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#428-434) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-46) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#436-441) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Saturating%3Cu64%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[u64](https://doc.rust-lang.org/nightly/std/primitive.u64.html) \> Available on **non-`no_core_num_saturating`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#436-441) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-47) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[u64](https://doc.rust-lang.org/nightly/std/primitive.u64.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#527-533) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Saturating%3Cu128%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[u128](https://doc.rust-lang.org/nightly/std/primitive.u128.html) \> Available on **non-`no_core_num_saturating`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#527-533) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-48) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[u128](https://doc.rust-lang.org/nightly/std/primitive.u128.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#443-448) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Saturating%3Cusize%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) \> Available on **non-`no_core_num_saturating`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#443-448) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-49) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Saturating](https://doc.rust-lang.org/nightly/core/num/saturating/struct.Saturating.html "struct core::num::saturating::Saturating") <[usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-AtomicBool) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [AtomicBool](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicBool.html "struct core::sync::atomic::AtomicBool") Available on **`no_target_has_atomic` or `target_has_atomic=8`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-50) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[AtomicBool](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicBool.html "struct core::sync::atomic::AtomicBool") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-AtomicI8) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [AtomicI8](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicI8.html "struct core::sync::atomic::AtomicI8") Available on **`no_target_has_atomic` or `target_has_atomic=8`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-51) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[AtomicI8](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicI8.html "struct core::sync::atomic::AtomicI8") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-AtomicI16) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [AtomicI16](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicI16.html "struct core::sync::atomic::AtomicI16") Available on **`no_target_has_atomic` or `target_has_atomic=16`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-52) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[AtomicI16](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicI16.html "struct core::sync::atomic::AtomicI16") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-AtomicI32) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [AtomicI32](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicI32.html "struct core::sync::atomic::AtomicI32") Available on **`no_target_has_atomic` or `target_has_atomic=32`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-53) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[AtomicI32](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicI32.html "struct core::sync::atomic::AtomicI32") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3134-3137) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-AtomicI64) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [AtomicI64](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicI64.html "struct core::sync::atomic::AtomicI64") Available on **`no_target_has_atomic` or `target_has_atomic=64`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3134-3137) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-54) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[AtomicI64](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicI64.html "struct core::sync::atomic::AtomicI64") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-AtomicIsize) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [AtomicIsize](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicIsize.html "struct core::sync::atomic::AtomicIsize") Available on **`no_target_has_atomic` or `target_has_atomic=ptr`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-55) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[AtomicIsize](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicIsize.html "struct core::sync::atomic::AtomicIsize") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-AtomicU8) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [AtomicU8](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicU8.html "struct core::sync::atomic::AtomicU8") Available on **`no_target_has_atomic` or `target_has_atomic=8`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-56) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[AtomicU8](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicU8.html "struct core::sync::atomic::AtomicU8") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-AtomicU16) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [AtomicU16](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicU16.html "struct core::sync::atomic::AtomicU16") Available on **`no_target_has_atomic` or `target_has_atomic=16`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-57) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[AtomicU16](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicU16.html "struct core::sync::atomic::AtomicU16") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-AtomicU32) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [AtomicU32](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicU32.html "struct core::sync::atomic::AtomicU32") Available on **`no_target_has_atomic` or `target_has_atomic=32`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-58) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[AtomicU32](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicU32.html "struct core::sync::atomic::AtomicU32") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3134-3137) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-AtomicU64) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [AtomicU64](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicU64.html "struct core::sync::atomic::AtomicU64") Available on **`no_target_has_atomic` or `target_has_atomic=64`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3134-3137) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-59) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[AtomicU64](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicU64.html "struct core::sync::atomic::AtomicU64") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-AtomicUsize) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [AtomicUsize](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicUsize.html "struct core::sync::atomic::AtomicUsize") Available on **`no_target_has_atomic` or `target_has_atomic=ptr`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3121-3131) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-60) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[AtomicUsize](https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicUsize.html "struct core::sync::atomic::AtomicUsize") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2129) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Duration) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Duration](https://doc.rust-lang.org/nightly/core/time/struct.Duration.html "struct core::time::Duration") [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2130-2132) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-61) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Duration](https://doc.rust-lang.org/nightly/core/time/struct.Duration.html "struct core::time::Duration") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1943) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-OsString) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [OsString](https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsString.html "struct std::ffi::os_str::OsString") Available on **crate feature `std` and (Unix or Windows)** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1944-1946) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-62) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[OsString](https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsString.html "struct std::ffi::os_str::OsString") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1869) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-PathBuf) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [PathBuf](https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html "struct std::path::PathBuf") Available on **crate feature `std`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1870-1872) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-63) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[PathBuf](https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html "struct std::path::PathBuf") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2271) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-SystemTime) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [SystemTime](https://doc.rust-lang.org/nightly/std/time/struct.SystemTime.html "struct std::time::SystemTime") Available on **crate feature `std`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2272-2274) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-64) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[SystemTime](https://doc.rust-lang.org/nightly/std/time/struct.SystemTime.html "struct std::time::SystemTime") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/figment/0.10.19/src/figment/profile.rs.html#276) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Profile) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") [Source](https://docs.rs/figment/0.10.19/src/figment/profile.rs.html#277-278) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-65) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Profile](https://docs.rs/figment/0.10.19/figment/profile/struct.Profile.html "struct figment::profile::Profile") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/figment/0.10.19/src/figment/value/magic.rs.html#713) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-RelativePathBuf) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [RelativePathBuf](https://docs.rs/figment/0.10.19/figment/value/magic/struct.RelativePathBuf.html "struct figment::value::magic::RelativePathBuf") [Source](https://docs.rs/figment/0.10.19/src/figment/value/magic.rs.html#714-716) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-66) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) <\_\_D>( \_\_deserializer: \_\_D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[RelativePathBuf](https://docs.rs/figment/0.10.19/figment/value/magic/struct.RelativePathBuf.html "struct figment::value::magic::RelativePathBuf") , <\_\_D as [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>>::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where \_\_D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/figment/0.10.19/src/figment/value/tag.rs.html#136) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Tag) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Tag](https://docs.rs/figment/0.10.19/figment/value/tag/struct.Tag.html "struct figment::value::tag::Tag") [Source](https://docs.rs/figment/0.10.19/src/figment/value/tag.rs.html#137-138) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-67) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Tag](https://docs.rs/figment/0.10.19/figment/value/tag/struct.Tag.html "struct figment::value::tag::Tag") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_json/1.0.148/src/serde_json/map.rs.html#506) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Map%3CString,+Value%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Map](https://docs.rs/serde_json/1.0.148/serde_json/map/struct.Map.html "struct serde_json::map::Map") <[String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") , [Value](https://api.rocket.rs/v0.5/rocket/serde/json/enum.Value.html "enum rocket::serde::json::Value") \> [Source](https://docs.rs/serde_json/1.0.148/src/serde_json/map.rs.html#508-510) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-68) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Map](https://docs.rs/serde_json/1.0.148/serde_json/map/struct.Map.html "struct serde_json::map::Map") <[String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") , [Value](https://api.rocket.rs/v0.5/rocket/serde/json/enum.Value.html "enum rocket::serde::json::Value") \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_json/1.0.148/src/serde_json/number.rs.html#395) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Number) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Number](https://docs.rs/serde_json/1.0.148/serde_json/number/struct.Number.html "struct serde_json::number::Number") [Source](https://docs.rs/serde_json/1.0.148/src/serde_json/number.rs.html#397-399) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-69) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Number](https://docs.rs/serde_json/1.0.148/serde_json/number/struct.Number.html "struct serde_json::number::Number") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/toml/0.8.23/src/toml/map.rs.html#311) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Map%3CString,+Value%3E-1) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Map](https://docs.rs/toml/0.8.23/toml/map/struct.Map.html "struct toml::map::Map") <[String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") , [Value](https://docs.rs/toml/0.8.23/toml/value/enum.Value.html "enum toml::value::Value") \> [Source](https://docs.rs/toml/0.8.23/src/toml/map.rs.html#313-315) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-70) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Map](https://docs.rs/toml/0.8.23/toml/map/struct.Map.html "struct toml::map::Map") <[String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") , [Value](https://docs.rs/toml/0.8.23/toml/value/enum.Value.html "enum toml::value::Value") \>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/toml_datetime/0.6.11/src/toml_datetime/datetime.rs.html#835) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Date) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Date](https://docs.rs/toml_datetime/0.6.11/toml_datetime/datetime/struct.Date.html "struct toml_datetime::datetime::Date") Available on **crate feature `serde`** only. [Source](https://docs.rs/toml_datetime/0.6.11/src/toml_datetime/datetime.rs.html#836-838) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-71) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Date](https://docs.rs/toml_datetime/0.6.11/toml_datetime/datetime/struct.Date.html "struct toml_datetime::datetime::Date") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/toml_datetime/0.6.11/src/toml_datetime/datetime.rs.html#802) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Datetime) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Datetime](https://docs.rs/toml_datetime/0.6.11/toml_datetime/datetime/struct.Datetime.html "struct toml_datetime::datetime::Datetime") Available on **crate feature `serde`** only. [Source](https://docs.rs/toml_datetime/0.6.11/src/toml_datetime/datetime.rs.html#803-805) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-72) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Datetime](https://docs.rs/toml_datetime/0.6.11/toml_datetime/datetime/struct.Datetime.html "struct toml_datetime::datetime::Datetime") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/toml_datetime/0.6.11/src/toml_datetime/datetime.rs.html#855) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Time) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Time](https://docs.rs/toml_datetime/0.6.11/toml_datetime/datetime/struct.Time.html "struct toml_datetime::datetime::Time") Available on **crate feature `serde`** only. [Source](https://docs.rs/toml_datetime/0.6.11/src/toml_datetime/datetime.rs.html#856-858) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-73) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Time](https://docs.rs/toml_datetime/0.6.11/toml_datetime/datetime/struct.Time.html "struct toml_datetime::datetime::Time") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/toml_edit/0.22.27/src/toml_edit/internal_string.rs.html#124) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-InternalString) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [InternalString](https://docs.rs/toml_edit/0.22.27/toml_edit/internal_string/struct.InternalString.html "struct toml_edit::internal_string::InternalString") Available on **crate feature `serde`** only. [Source](https://docs.rs/toml_edit/0.22.27/src/toml_edit/internal_string.rs.html#125-127) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-74) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[InternalString](https://docs.rs/toml_edit/0.22.27/toml_edit/internal_string/struct.InternalString.html "struct toml_edit::internal_string::InternalString") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/uuid/1.19.0/src/uuid/external/serde_support.rs.html#140) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-NonNilUuid) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [NonNilUuid](https://docs.rs/uuid/1.19.0/uuid/non_nil/struct.NonNilUuid.html "struct uuid::non_nil::NonNilUuid") [Source](https://docs.rs/uuid/1.19.0/src/uuid/external/serde_support.rs.html#141-143) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-75) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[NonNilUuid](https://docs.rs/uuid/1.19.0/uuid/non_nil/struct.NonNilUuid.html "struct uuid::non_nil::NonNilUuid") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#730) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%26str) ### impl<'de, 'a> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for &'a [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) where 'de: 'a, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#731-733) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-76) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <&'a [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1814) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%26Path) ### impl<'de, 'a> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for &'a [Path](https://doc.rust-lang.org/nightly/std/path/struct.Path.html "struct std::path::Path") where 'de: 'a, Available on **crate feature `std`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1815-1817) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-77) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <&'a [Path](https://doc.rust-lang.org/nightly/std/path/struct.Path.html "struct std::path::Path") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_json/1.0.148/src/serde_json/raw.rs.html#312) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%26RawValue) ### impl<'de, 'a> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for &'a [RawValue](https://docs.rs/serde_json/1.0.148/serde_json/raw/struct.RawValue.html "struct serde_json::raw::RawValue") where 'de: 'a, [Source](https://docs.rs/serde_json/1.0.148/src/serde_json/raw.rs.html#313-315) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-78) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <&'a [RawValue](https://docs.rs/serde_json/1.0.148/serde_json/raw/struct.RawValue.html "struct serde_json::raw::RawValue") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#765) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%26%5Bu8%5D) ### impl<'de, 'a> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for &'a \[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \] where 'de: 'a, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#766-768) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-79) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <&'a \[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \], >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1980-1983) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Cow%3C'a,+T%3E) ### impl<'de, 'a, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow") <'a, T> where T: [ToOwned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html "trait alloc::borrow::ToOwned") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , ::[Owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned "type alloc::borrow::ToOwned::Owned") : [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, Available on **crate features `std` or `alloc`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1986-1988) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-80) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow") <'a, T>, >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/figment/0.10.19/src/figment/value/magic.rs.html#491-492) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Either%3CA,+B%3E) ### impl<'de, 'b, A, B> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Either](https://docs.rs/figment/0.10.19/figment/value/magic/enum.Either.html "enum figment::value::magic::Either") where 'de: 'b, A: [Magic](https://docs.rs/figment/0.10.19/figment/value/magic/trait.Magic.html "trait figment::value::magic::Magic") , B: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'b>, [Source](https://docs.rs/figment/0.10.19/src/figment/value/magic.rs.html#494-495) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-81) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( de: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Either](https://docs.rs/figment/0.10.19/figment/value/magic/enum.Either.html "enum figment::value::magic::Either") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/indexmap/2.12.1/src/indexmap/serde.rs.html#73-77) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-IndexMap%3CK,+V,+S%3E) ### impl<'de, K, V, S> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [IndexMap](https://docs.rs/indexmap/2.12.1/indexmap/map/struct.IndexMap.html "struct indexmap::map::IndexMap") where K: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> + [Eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Eq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Eq") + [Hash](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hash.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::Hash") , V: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, S: [Default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html "trait core::default::Default") + [BuildHasher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.BuildHasher.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::BuildHasher") , [Source](https://docs.rs/indexmap/2.12.1/src/indexmap/serde.rs.html#79-81) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-82) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[IndexMap](https://docs.rs/indexmap/2.12.1/indexmap/map/struct.IndexMap.html "struct indexmap::map::IndexMap") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/either/1/src/either/lib.rs.html#47) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Either%3CL,+R%3E) ### impl<'de, L, R> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") where L: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, R: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/either/1/src/either/lib.rs.html#47) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-83) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) <\_\_D>( \_\_deserializer: \_\_D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") , <\_\_D as [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>>::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where \_\_D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1)) ### impl<'de, T0, T1> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-84) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2)) ### impl<'de, T0, T1, T2> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-85) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2,+T3)) ### impl<'de, T0, T1, T2, T3> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2, T3)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T3: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-86) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2, T3)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2,+T3,+T4)) ### impl<'de, T0, T1, T2, T3, T4> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2, T3, T4)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T3: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T4: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-87) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2, T3, T4)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2,+T3,+T4,+T5)) ### impl<'de, T0, T1, T2, T3, T4, T5> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2, T3, T4, T5)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T3: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T4: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T5: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-88) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2, T3, T4, T5)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2,+T3,+T4,+T5,+T6)) ### impl<'de, T0, T1, T2, T3, T4, T5, T6> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2, T3, T4, T5, T6)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T3: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T4: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T5: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T6: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-89) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2, T3, T4, T5, T6)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2,+T3,+T4,+T5,+T6,+T7)) ### impl<'de, T0, T1, T2, T3, T4, T5, T6, T7> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2, T3, T4, T5, T6, T7)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T3: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T4: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T5: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T6: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T7: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-90) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2, T3, T4, T5, T6, T7)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2,+T3,+T4,+T5,+T6,+T7,+T8)) ### impl<'de, T0, T1, T2, T3, T4, T5, T6, T7, T8> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2, T3, T4, T5, T6, T7, T8)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T3: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T4: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T5: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T6: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T7: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T8: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-91) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2, T3, T4, T5, T6, T7, T8)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2,+T3,+T4,+T5,+T6,+T7,+T8,+T9)) ### impl<'de, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T3: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T4: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T5: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T6: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T7: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T8: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T9: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-92) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2,+T3,+T4,+T5,+T6,+T7,+T8,+T9,+T10)) ### impl<'de, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T3: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T4: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T5: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T6: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T7: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T8: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T9: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T10: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-93) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2,+T3,+T4,+T5,+T6,+T7,+T8,+T9,+T10,+T11)) ### impl<'de, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T3: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T4: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T5: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T6: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T7: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T8: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T9: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T10: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T11: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-94) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2,+T3,+T4,+T5,+T6,+T7,+T8,+T9,+T10,+T11,+T12)) ### impl<'de, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T3: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T4: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T5: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T6: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T7: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T8: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T9: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T10: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T11: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T12: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-95) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2,+T3,+T4,+T5,+T6,+T7,+T8,+T9,+T10,+T11,+T12,+T13)) ### impl<'de, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T3: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T4: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T5: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T6: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T7: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T8: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T9: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T10: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T11: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T12: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T13: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-96) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2,+T3,+T4,+T5,+T6,+T7,+T8,+T9,+T10,+T11,+T12,+T13,+T14)) ### impl<'de, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T3: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T4: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T5: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T6: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T7: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T8: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T9: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T10: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T11: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T12: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T13: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T14: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-97) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T0,+T1,+T2,+T3,+T4,+T5,+T6,+T7,+T8,+T9,+T10,+T11,+T12,+T13,+T14,+T15)) ### impl<'de, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T0: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T1: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T2: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T3: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T4: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T5: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T6: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T7: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T8: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T9: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T10: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T11: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T12: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T13: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T14: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T15: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1481-1497) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-98) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1258) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+0%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 0\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1259-1261) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-99) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 0\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+1%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 1\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-100) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 1\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+2%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 2\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-101) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 2\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+3%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 3\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-102) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 3\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+4%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 4\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-103) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 4\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+5%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 5\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-104) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 5\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+6%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 6\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-105) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 6\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+7%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 7\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-106) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 7\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+8%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 8\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-107) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 8\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+9%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 9\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-108) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 9\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+10%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 10\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-109) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 10\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+11%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 11\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-110) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 11\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+12%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 12\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-111) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 12\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+13%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 13\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-112) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 13\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+14%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 14\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-113) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 14\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+15%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 15\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-114) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 15\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+16%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 16\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-115) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 16\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+17%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 17\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-116) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 17\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+18%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 18\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-117) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 18\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+19%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 19\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-118) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 19\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+20%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 20\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-119) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 20\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+21%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 21\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-120) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 21\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+22%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 22\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-121) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 22\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+23%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 23\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-122) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 23\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+24%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 24\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-123) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 24\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+25%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 25\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-124) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 25\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+26%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 26\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-125) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 26\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+27%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 27\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-126) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 27\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+28%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 28\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-127) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 28\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+29%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 29\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-128) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 29\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+30%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 30\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-129) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 30\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+31%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 31\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-130) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 31\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%5BT;+32%5D) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [\[T; 32\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1345-1378) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-131) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[\[T; 32\]](https://doc.rust-lang.org/nightly/std/primitive.array.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1474-1476) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-(T,)) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [(T,)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1478) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-132) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[(T,)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2063-2074) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Rc%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Rc](https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html "struct alloc::rc::Rc") where [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") : [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Available on **crate feature `rc` and (crate features `std` or `alloc`)** only. This impl requires the [`"rc"`](https://serde.rs/feature-flags.html#-features-rc) Cargo feature of Serde. Deserializing a data structure containing `Rc` will not attempt to deduplicate `Rc` references to the same data. Every deserialized `Rc` will end up with a strong count of 1. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2063-2074) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-133) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Rc](https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html "struct alloc::rc::Rc") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2005-2007) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Weak%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Weak](https://doc.rust-lang.org/nightly/alloc/rc/struct.Weak.html "struct alloc::rc::Weak") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, Available on **crate feature `rc` and (crate features `std` or `alloc`)** only. This impl requires the [`"rc"`](https://serde.rs/feature-flags.html#-features-rc) Cargo feature of Serde. The resulting `Weak` has a reference count of 0 and cannot be upgraded. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2009-2011) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-134) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Weak](https://doc.rust-lang.org/nightly/alloc/rc/struct.Weak.html "struct alloc::rc::Weak") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2076-2087) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Arc%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Arc](https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html "struct alloc::sync::Arc") where [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") : [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Available on **crate feature `rc` and (crate features `std` or `alloc`)** only. This impl requires the [`"rc"`](https://serde.rs/feature-flags.html#-features-rc) Cargo feature of Serde. Deserializing a data structure containing `Arc` will not attempt to deduplicate `Arc` references to the same data. Every deserialized `Arc` will end up with a strong count of 1. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2076-2087) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-135) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Arc](https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html "struct alloc::sync::Arc") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2027-2029) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Weak%3CT%3E-1) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Weak](https://doc.rust-lang.org/nightly/alloc/sync/struct.Weak.html "struct alloc::sync::Weak") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, Available on **crate feature `rc` and (crate features `std` or `alloc`)** only. This impl requires the [`"rc"`](https://serde.rs/feature-flags.html#-features-rc) Cargo feature of Serde. The resulting `Weak` has a reference count of 0 and cannot be upgraded. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2031-2033) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-136) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Weak](https://doc.rust-lang.org/nightly/alloc/sync/struct.Weak.html "struct alloc::sync::Weak") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2091-2093) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Cell%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Cell](https://doc.rust-lang.org/nightly/core/cell/struct.Cell.html "struct core::cell::Cell") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> + [Copy](https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html "trait core::marker::Copy") , [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2095-2097) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-137) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Cell](https://doc.rust-lang.org/nightly/core/cell/struct.Cell.html "struct core::cell::Cell") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2103-2105) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-RefCell%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [RefCell](https://doc.rust-lang.org/nightly/core/cell/struct.RefCell.html "struct core::cell::RefCell") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2103-2105) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-138) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[RefCell](https://doc.rust-lang.org/nightly/core/cell/struct.RefCell.html "struct core::cell::RefCell") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#961-963) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-PhantomData%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [PhantomData](https://doc.rust-lang.org/nightly/core/marker/struct.PhantomData.html "struct core::marker::PhantomData") where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#965-967) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-139) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[PhantomData](https://doc.rust-lang.org/nightly/core/marker/struct.PhantomData.html "struct core::marker::PhantomData") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3090-3092) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Wrapping%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Wrapping](https://doc.rust-lang.org/nightly/core/num/wrapping/struct.Wrapping.html "struct core::num::wrapping::Wrapping") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#3094-3096) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-140) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Wrapping](https://doc.rust-lang.org/nightly/core/num/wrapping/struct.Wrapping.html "struct core::num::wrapping::Wrapping") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2107-2111) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Mutex%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Mutex](https://doc.rust-lang.org/nightly/std/sync/poison/mutex/struct.Mutex.html "struct std::sync::poison::mutex::Mutex") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, Available on **crate feature `std`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2107-2111) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-141) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Mutex](https://doc.rust-lang.org/nightly/std/sync/poison/mutex/struct.Mutex.html "struct std::sync::poison::mutex::Mutex") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2113-2117) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-RwLock%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [RwLock](https://doc.rust-lang.org/nightly/std/sync/poison/rwlock/struct.RwLock.html "struct std::sync::poison::rwlock::RwLock") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, Available on **crate feature `std`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2113-2117) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-142) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[RwLock](https://doc.rust-lang.org/nightly/std/sync/poison/rwlock/struct.RwLock.html "struct std::sync::poison::rwlock::RwLock") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/figment/0.10.19/src/figment/value/magic.rs.html#1060-1062) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Tagged%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Tagged](https://docs.rs/figment/0.10.19/figment/value/magic/struct.Tagged.html "struct figment::value::magic::Tagged") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/figment/0.10.19/src/figment/value/magic.rs.html#1064-1066) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-143) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) <\_\_D>( \_\_deserializer: \_\_D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Tagged](https://docs.rs/figment/0.10.19/figment/value/magic/struct.Tagged.html "struct figment::value::magic::Tagged") , <\_\_D as [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>>::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where \_\_D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/serde_spanned/0.6.9/src/serde_spanned/spanned.rs.html#161-163) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Spanned%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Spanned](https://docs.rs/serde_spanned/0.6.9/serde_spanned/spanned/struct.Spanned.html "struct serde_spanned::spanned::Spanned") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, Available on **crate feature `serde`** only. [Source](https://docs.rs/serde_spanned/0.6.9/src/serde_spanned/spanned.rs.html#165-167) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-144) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Spanned](https://docs.rs/serde_spanned/0.6.9/serde_spanned/spanned/struct.Spanned.html "struct serde_spanned::spanned::Spanned") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, [Source](https://docs.rs/indexmap/2.12.1/src/indexmap/serde.rs.html#141-144) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-IndexSet%3CT,+S%3E) ### impl<'de, T, S> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [IndexSet](https://docs.rs/indexmap/2.12.1/indexmap/set/struct.IndexSet.html "struct indexmap::set::IndexSet") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> + [Eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Eq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Eq") + [Hash](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hash.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::Hash") , S: [Default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html "trait core::default::Default") + [BuildHasher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.BuildHasher.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::BuildHasher") , [Source](https://docs.rs/indexmap/2.12.1/src/indexmap/serde.rs.html#146-148) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#method.deserialize-145) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#tymethod.deserialize) ( deserializer: D, ) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[IndexSet](https://docs.rs/indexmap/2.12.1/indexmap/set/struct.IndexSet.html "struct indexmap::set::IndexSet") , >::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html#associatedtype.Error "type rocket::serde::Deserializer::Error") \> where D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, Implementors[§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#implementors) ---------------------------------------------------------------------------------------- [Source](https://docs.rs/uncased/0.9.10/src/uncased/serde.rs.html#6) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%26UncasedStr) ### impl<'a, 'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for &'a [UncasedStr](https://api.rocket.rs/v0.5/rocket/http/uncased/struct.UncasedStr.html "struct rocket::http::uncased::UncasedStr") where 'de: 'a, [Source](https://docs.rs/uncased/0.9.10/src/uncased/serde.rs.html#25) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Uncased%3C'a%3E) ### impl<'a, 'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Uncased](https://api.rocket.rs/v0.5/rocket/http/uncased/struct.Uncased.html "struct rocket::http::uncased::Uncased") <'a> [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Absolute%3C'a%3E) ### impl<'a, 'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Absolute](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Absolute.html "struct rocket::http::uri::Absolute") <'a> [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Asterisk) ### impl<'a, 'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Asterisk](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Asterisk.html "struct rocket::http::uri::Asterisk") [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Authority%3C'a%3E) ### impl<'a, 'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Authority](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Authority.html "struct rocket::http::uri::Authority") <'a> [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Host%3C'a%3E) ### impl<'a, 'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Host](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Host.html "struct rocket::http::uri::Host") <'a> [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Origin%3C'a%3E) ### impl<'a, 'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Origin](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html "struct rocket::http::uri::Origin") <'a> [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Reference%3C'a%3E) ### impl<'a, 'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Reference](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Reference.html "struct rocket::http::uri::Reference") <'a> [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#182) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-CipherSuite) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [CipherSuite](https://api.rocket.rs/v0.5/rocket/config/enum.CipherSuite.html "enum rocket::config::CipherSuite") Available on **crate feature `tls`** only. [Source](https://api.rocket.rs/v0.5/src/rocket/log.rs.html#229-237) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-LogLevel) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [LogLevel](https://api.rocket.rs/v0.5/rocket/config/enum.LogLevel.html "enum rocket::config::LogLevel") [Source](https://api.rocket.rs/v0.5/src/rocket/config/shutdown.rs.html#19) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Sig) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Sig](https://api.rocket.rs/v0.5/rocket/config/enum.Sig.html "enum rocket::config::Sig") [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Method) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Method](https://api.rocket.rs/v0.5/rocket/http/enum.Method.html "enum rocket::http::Method") [Source](https://docs.rs/serde_json/1.0.148/src/serde_json/value/de.rs.html#22) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Value-2) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for rocket::serde::json::[Value](https://api.rocket.rs/v0.5/rocket/serde/json/enum.Value.html "enum rocket::serde::json::Value") [Source](https://api.rocket.rs/v0.5/src/rocket/config/ident.rs.html#177-222) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Ident) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Ident](https://api.rocket.rs/v0.5/rocket/config/struct.Ident.html "struct rocket::config::Ident") [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#160) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-MutualTls) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") Available on **crate feature `tls`** only. [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#199-252) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-SecretKey) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") Available on **crate feature `secrets`** only. [Source](https://api.rocket.rs/v0.5/src/rocket/config/shutdown.rs.html#206) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Shutdown) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Shutdown](https://api.rocket.rs/v0.5/rocket/config/struct.Shutdown.html "struct rocket::config::Shutdown") [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#79) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-TlsConfig) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [TlsConfig](https://api.rocket.rs/v0.5/rocket/config/struct.TlsConfig.html "struct rocket::config::TlsConfig") Available on **crate feature `tls`** only. [Source](https://docs.rs/ubyte/0.10.4/src/ubyte/ser_de.rs.html#6) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-ByteUnit) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [ByteUnit](https://api.rocket.rs/v0.5/rocket/data/struct.ByteUnit.html "struct rocket::data::ByteUnit") [Source](https://api.rocket.rs/v0.5/src/rocket/data/limits.rs.html#124) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Limits) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Limits](https://api.rocket.rs/v0.5/rocket/data/struct.Limits.html "struct rocket::data::Limits") [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Status) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Status](https://api.rocket.rs/v0.5/rocket/http/struct.Status.html "struct rocket::http::Status") [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1966-1970) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Box%3Cstr%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") <[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) \> Available on **crate features `std` or `alloc`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#858-862) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Box%3CCStr%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") <[CStr](https://doc.rust-lang.org/nightly/core/ffi/c_str/struct.CStr.html "struct core::ffi::c_str::CStr") \> Available on **crate feature `std`, or non-`no_core_cstr` and crate feature `alloc`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1972-1976) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Box%3COsStr%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") <[OsStr](https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html "struct std::ffi::os_str::OsStr") \> Available on **crate feature `std` and (Unix or Windows)** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1878-1882) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Box%3CPath%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") <[Path](https://doc.rust-lang.org/nightly/std/path/struct.Path.html "struct std::path::Path") \> Available on **crate feature `std`** only. [Source](https://docs.rs/serde_json/1.0.148/src/serde_json/raw.rs.html#342) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Box%3CRawValue%3E) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") <[RawValue](https://docs.rs/serde_json/1.0.148/serde_json/raw/struct.RawValue.html "struct serde_json::raw::RawValue") \> [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#688) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-String) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") Available on **crate features `std` or `alloc`** only. [Source](https://api.rocket.rs/v0.5/src/rocket/config/config.rs.html#59) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Config) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/ignored_any.rs.html#230) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-IgnoredAny) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [IgnoredAny](https://docs.rs/serde_core/1.0.228/serde_core/de/ignored_any/struct.IgnoredAny.html "struct serde_core::de::ignored_any::IgnoredAny") [Source](https://docs.rs/uuid/1.19.0/src/uuid/external/serde_support.rs.html#67) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Uuid) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Uuid](https://api.rocket.rs/v0.5/rocket/serde/uuid/struct.Uuid.html "struct rocket::serde::uuid::Uuid") [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%26RawStr) ### impl<'de, 'a> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for &'a [RawStr](https://api.rocket.rs/v0.5/rocket/http/struct.RawStr.html "struct rocket::http::RawStr") where 'de: 'a, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2423-2425) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Range%3CIdx%3E) ### impl<'de, Idx> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Range](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.Range.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Range") where Idx: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2602-2604) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-RangeFrom%3CIdx%3E) ### impl<'de, Idx> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [RangeFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.RangeFrom.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::ops::RangeFrom") where Idx: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2443-2445) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-RangeInclusive%3CIdx%3E) ### impl<'de, Idx> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [RangeInclusive](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.RangeInclusive.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::ops::RangeInclusive") where Idx: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2741-2743) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-RangeTo%3CIdx%3E) ### impl<'de, Idx> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [RangeTo](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/struct.RangeTo.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::ops::RangeTo") where Idx: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1557-1563) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-BTreeMap%3CK,+V%3E) ### impl<'de, K, V> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [BTreeMap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.BTreeMap.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::collections::BTreeMap") where K: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> + [Ord](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Ord") , V: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, Available on **crate features `std` or `alloc`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1565-1571) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-HashMap%3CK,+V,+S%3E) ### impl<'de, K, V, S> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [HashMap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.HashMap.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::collections::HashMap") where K: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> + [Eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Eq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Eq") + [Hash](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hash.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::Hash") , V: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, S: [BuildHasher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.BuildHasher.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::BuildHasher") + [Default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html "trait core::default::Default") , Available on **crate feature `std`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2873-2875) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Bound%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Bound](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/enum.Bound.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::collections::Bound") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#916-918) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Option%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1960-1964) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Box%3C%5BT%5D%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") <[\[T\]](https://doc.rust-lang.org/nightly/std/primitive.slice.html) \> where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, Available on **crate features `std` or `alloc`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1954-1958) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Box%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, Available on **crate features `std` or `alloc`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#864-866) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Reverse%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Reverse](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/struct.Reverse.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Reverse") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1087-1096) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-BTreeSet%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [BTreeSet](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.BTreeSet.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::collections::BTreeSet") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> + [Eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Eq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Eq") + [Ord](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Ord") , Available on **crate features `std` or `alloc`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1076-1085) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-BinaryHeap%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [BinaryHeap](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.BinaryHeap.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::collections::BinaryHeap") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> + [Ord](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Ord.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Ord") , Available on **crate features `std` or `alloc`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1098-1107) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-LinkedList%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [LinkedList](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.LinkedList.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::collections::LinkedList") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, Available on **crate features `std` or `alloc`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1120-1129) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-VecDeque%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [VecDeque](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.VecDeque.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::collections::VecDeque") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, Available on **crate features `std` or `alloc`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1135-1137) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Vec%3CT%3E) ### impl<'de, T> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Vec](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/vec/struct.Vec.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::vec::Vec") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, Available on **crate features `std` or `alloc`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#2982-2985) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-Result%3CT,+E%3E) ### impl<'de, T, E> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, E: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, Available on **crate feature `result`** only. [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/impls.rs.html#1109-1118) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-HashSet%3CT,+S%3E) ### impl<'de, T, S> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [HashSet](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/collections/struct.HashSet.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::collections::HashSet") where T: [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> + [Eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.Eq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::Eq") + [Hash](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.Hash.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::Hash") , S: [BuildHasher](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/hash/trait.BuildHasher.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::hash::BuildHasher") + [Default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html "trait core::default::Default") , Available on **crate feature `std`** only. [Source](https://api.rocket.rs/v0.5/src/rocket/form/name/key.rs.html#94-100) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%26Key) ### impl<'de: 'a, 'a> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for &'a [Key](https://api.rocket.rs/v0.5/rocket/form/name/struct.Key.html "struct rocket::form::name::Key") [Source](https://api.rocket.rs/v0.5/src/rocket/form/name/name.rs.html#139-145) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize#impl-Deserialize%3C'de%3E-for-%26Name) ### impl<'de: 'a, 'a> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for &'a [Name](https://api.rocket.rs/v0.5/rocket/form/name/struct.Name.html "struct rocket::form::name::Name") --- # rocket::http - Rust [Module http](https://api.rocket.rs/v0.5/rocket/http/#) -------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Module http Copy item path ========================== [Source](https://api.rocket.rs/v0.5/src/rocket/lib.rs.html#141) Expand description Types that map to concepts in HTTP. This module exports types that map to HTTP concepts or to the underlying HTTP library when needed. Modules[§](https://api.rocket.rs/v0.5/rocket/http/#modules) ------------------------------------------------------------ [ext](https://api.rocket.rs/v0.5/rocket/http/ext/index.html "mod rocket::http::ext") Extension traits implemented by several HTTP types. [hyper](https://api.rocket.rs/v0.5/rocket/http/hyper/index.html "mod rocket::http::hyper") Re-exported hyper HTTP library types. [uncased](https://api.rocket.rs/v0.5/rocket/http/uncased/index.html "mod rocket::http::uncased") Case-preserving, ASCII case-insensitive string types. [uri](https://api.rocket.rs/v0.5/rocket/http/uri/index.html "mod rocket::http::uri") Types for URIs and traits for rendering URI components. Macros[§](https://api.rocket.rs/v0.5/rocket/http/#macros) ---------------------------------------------------------- [impl\_from\_uri\_param\_identity](https://api.rocket.rs/v0.5/rocket/http/macro.impl_from_uri_param_identity.html "macro rocket::http::impl_from_uri_param_identity") Macro to automatically generate _identity_ [`FromUriParam`](https://api.rocket.rs/v0.5/rocket/http/uri/fmt/trait.FromUriParam.html "trait rocket::http::uri::fmt::FromUriParam") trait implementations. Structs[§](https://api.rocket.rs/v0.5/rocket/http/#structs) ------------------------------------------------------------ [Accept](https://api.rocket.rs/v0.5/rocket/http/struct.Accept.html "struct rocket::http::Accept") The HTTP Accept header. [ContentType](https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html "struct rocket::http::ContentType") Representation of HTTP Content-Types. [Cookie](https://api.rocket.rs/v0.5/rocket/http/struct.Cookie.html "struct rocket::http::Cookie") Representation of an HTTP cookie. [CookieJar](https://api.rocket.rs/v0.5/rocket/http/struct.CookieJar.html "struct rocket::http::CookieJar") Collection of one or more HTTP cookies. [Header](https://api.rocket.rs/v0.5/rocket/http/struct.Header.html "struct rocket::http::Header") Simple representation of an HTTP header. [HeaderMap](https://api.rocket.rs/v0.5/rocket/http/struct.HeaderMap.html "struct rocket::http::HeaderMap") A collection of headers, mapping a header name to its many ordered values. [Iter](https://api.rocket.rs/v0.5/rocket/http/struct.Iter.html "struct rocket::http::Iter") Iterator over all of the cookies in a jar. [MediaType](https://api.rocket.rs/v0.5/rocket/http/struct.MediaType.html "struct rocket::http::MediaType") An HTTP media type. [QMediaType](https://api.rocket.rs/v0.5/rocket/http/struct.QMediaType.html "struct rocket::http::QMediaType") A `MediaType` with an associated quality value. [RawStr](https://api.rocket.rs/v0.5/rocket/http/struct.RawStr.html "struct rocket::http::RawStr") A reference to a string inside of a raw HTTP message. [RawStrBuf](https://api.rocket.rs/v0.5/rocket/http/struct.RawStrBuf.html "struct rocket::http::RawStrBuf") An owned version of [`RawStr`](https://api.rocket.rs/v0.5/rocket/http/struct.RawStr.html "struct rocket::http::RawStr") . [Status](https://api.rocket.rs/v0.5/rocket/http/struct.Status.html "struct rocket::http::Status") Structure representing an HTTP status: an integer code. Enums[§](https://api.rocket.rs/v0.5/rocket/http/#enums) -------------------------------------------------------- [Method](https://api.rocket.rs/v0.5/rocket/http/enum.Method.html "enum rocket::http::Method") Representation of HTTP methods. [SameSite](https://api.rocket.rs/v0.5/rocket/http/enum.SameSite.html "enum rocket::http::SameSite") The `SameSite` cookie attribute. [StatusClass](https://api.rocket.rs/v0.5/rocket/http/enum.StatusClass.html "enum rocket::http::StatusClass") Enumeration of HTTP status classes. --- # rocket_dyn_templates::minijinja - Rust [Crate minijinja](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#) ------------------------------------------------------------------------------- [rocket\_dyn\_templates](https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html) Crate minijinja Copy item path ============================== [Source](https://docs.rs/minijinja/2.14.0/src/minijinja/lib.rs.html#1-285) Expand description The minijinja templating engine library, reexported. ![](https://github.com/mitsuhiko/minijinja/raw/main/artwork/logo.png) **MiniJinja: a powerful template engine for Rust with minimal dependencies** MiniJinja is a powerful but minimal dependency template engine for Rust which is based on the syntax and behavior of the [Jinja2](https://jinja.palletsprojects.com/) template engine for Python. It’s implemented on top of [`serde`](https://docs.rs/serde/1.0.228/serde/index.html "mod serde") . The goal is to be able to render a large chunk of the Jinja2 template ecosystem from Rust with a minimal engine and to leverage an already existing ecosystem of editor integrations. {% for user in users %}

  • {{ user.name }}
  • {% endfor %} You can play with MiniJinja online [in the browser playground](https://mitsuhiko.github.io/minijinja-playground/) powered by a WASM build of MiniJinja. [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#why-minijinja) Why MiniJinja ------------------------------------------------------------------------------------------- MiniJinja by its name wants to be a good default choice if you need a little bit of templating with minimal dependencies. It has the following goals: * Well documented, compact API * Minimal dependencies, reasonable compile times and decent runtime performance * Stay close as possible to Jinja2 * Support for expression evaluation * Support for all `serde` compatible types * Excellent test coverage * Support for dynamic runtime objects with methods and dynamic attributes [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#template-usage) Template Usage --------------------------------------------------------------------------------------------- To use MiniJinja one needs to create an [`Environment`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.Environment.html "struct rocket_dyn_templates::minijinja::Environment") and populate it with templates. Afterwards templates can be loaded and rendered. To pass data one can pass any serde serializable value. The [`context!`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/macro.context.html "macro rocket_dyn_templates::minijinja::context") macro can be used to quickly construct a template context: use minijinja::{Environment, context}; let mut env = Environment::new(); env.add_template("hello", "Hello {{ name }}!").unwrap(); let tmpl = env.get_template("hello").unwrap(); println!("{}", tmpl.render(context!(name => "John")).unwrap()); Hello John! For super trivial cases where you need to render a string once, you can also use the [`render!`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/macro.render.html "macro rocket_dyn_templates::minijinja::render") macro which acts a bit like a replacement for the [`format!`](https://doc.rust-lang.org/nightly/alloc/macro.format.html "macro alloc::format") macro. [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#expression-usage) Expression Usage ------------------------------------------------------------------------------------------------- MiniJinja — like Jinja2 — allows to be used as expression language. This can be useful to express logic in configuration files or similar things. For this purpose the [`Environment::compile_expression`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.Environment.html#method.compile_expression "method rocket_dyn_templates::minijinja::Environment::compile_expression") method can be used. It returns an expression object that can then be evaluated, returning the result: use minijinja::{Environment, context}; let env = Environment::new(); let expr = env.compile_expression("number < 42").unwrap(); let result = expr.eval(context!(number => 23)).unwrap(); assert_eq!(result.is_true(), true); This becomes particularly powerful when [dynamic objects](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/value/trait.Object.html "trait rocket_dyn_templates::minijinja::value::Object") are exposed to templates. [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#custom-filters) Custom Filters --------------------------------------------------------------------------------------------- MiniJinja lets you register functions as filter functions (see [`Function`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/filters/trait.Filter.html "trait rocket_dyn_templates::minijinja::filters::Filter") ) with the engine. These can then be invoked directly from the template: use minijinja::{Environment, context}; let mut env = Environment::new(); env.add_filter("repeat", str::repeat); env.add_template("hello", "{{ 'Na '|repeat(3) }} {{ name }}!").unwrap(); let tmpl = env.get_template("hello").unwrap(); println!("{}", tmpl.render(context!(name => "Batman")).unwrap()); Na Na Na Batman! [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#learn-more) Learn more ------------------------------------------------------------------------------------- * [`Environment`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.Environment.html "struct rocket_dyn_templates::minijinja::Environment") : the main API entry point. Teaches you how to configure the environment. * [`Template`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.Template.html "struct rocket_dyn_templates::minijinja::Template") : the template object API. Shows you how templates can be rendered. * [`syntax`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/syntax/index.html "mod rocket_dyn_templates::minijinja::syntax") : provides documentation of the template engine syntax. * [`filters`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/filters/index.html "mod rocket_dyn_templates::minijinja::filters") : teaches you how to write custom filters and to see the list of built-in filters. * [`tests`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/tests/index.html "mod rocket_dyn_templates::minijinja::tests") : teaches you how to write custom test functions and to see the list of built-in tests. * [`functions`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/functions/index.html "mod rocket_dyn_templates::minijinja::functions") : teaches how to write custom functions and to see the list of built-in functions. * For auto reloading use the [`minijinja-autoreload`](https://docs.rs/minijinja-autoreload) crate. * For simpler embedding of templates use the [`minijinja-embed`](https://docs.rs/minijinja-embed) crate. Additionally there is an [list of examples](https://github.com/mitsuhiko/minijinja/tree/main/examples) with many different small example programs on GitHub to explore. [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#error-handling) Error Handling --------------------------------------------------------------------------------------------- MiniJinja tries to give you good errors out of the box. However if you use includes or template inheritance your experience will improve greatly if you ensure to render chained errors. For more information see [`Error`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.Error.html "struct rocket_dyn_templates::minijinja::Error") with an example. [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#size-and-compile-times) Size and Compile Times ------------------------------------------------------------------------------------------------------------- MiniJinja attempts to compile fast so it can be used as a sensible template engine choice when compile times matter. Because of this it’s internally modular so unnecessary bits and pieces can be removed. The default set of features tries to strike a balance but in situations where only a subset is needed (eg: `build.rs`) all default features can be be disabled. [§](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#optional-features) Optional Features --------------------------------------------------------------------------------------------------- MiniJinja comes with a lot of optional features, some of which are turned on by default. If you plan on using MiniJinja in a library, please consider turning off all default features and to opt-in explicitly into the ones you actually need. **Configurable Features** To cut down on size of the engine some default functionality can be removed: * **Engine Features:** * `builtins`: if this feature is removed the default filters, tests and functions are not implemented. * `macros`: when removed the `{% macro %}` tag is not included. * `multi_template`: when removed the templates related to imports and extends are removed (`{% from %}`, `{% import %}`, `{% include %}`, and `{% extends %}` as well as `{% block %}`). * `adjacent_loop_items`: when removed the `previtem` and `nextitem` attributes of the `loop` object no longer exist. Removing this feature can provide faster template execution when a lot of loops are involved. * `unicode`: when added unicode identifiers are supported and the `sort` filter’s case insensitive comparison changes to using unicode and not ASCII rules. Without this features only ASCII identifiers can be used for variable names and attributes. * `serde`: enables or disables serde support. In current versions of MiniJinja it’s not possible to disable serde but it will become possible. To prevent breakage, MiniJinja warns if this feature is disabled. * **Rust Functionality:** * `debug`: if this feature is removed some debug functionality of the engine is removed as well. This mainly affects the quality of error reporting. * `deserialization`: when removed this disables deserialization support for the [`Value`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.Value.html "struct rocket_dyn_templates::minijinja::Value") type, removes the `ViaDeserialize` type and the error type no longer implements `serde::de::Error`. * `std_collections`: if this feature is removed some [`Object`](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/value/trait.Object.html "trait rocket_dyn_templates::minijinja::value::Object") implementations for standard library collections are removed. Only the ones needed for the engine to function itself are retained. There are some additional features that provide extra functionality: * `fuel`: enables the `fuel` feature which makes the engine track fuel consumption which can be used to better protect against expensive templates. * `loader`: enables owned and dynamic template loading of templates. * `custom_syntax`: when this feature is enabled, custom delimiters are supported by the parser. * `preserve_order`: When enable the internal value implementation uses an indexmap which preserves the original order of maps and structs. * `json`: When enabled the `tojson` filter is added as builtin filter as well as the ability to auto escape via `AutoEscape::Json`. * `urlencode`: When enabled the `urlencode` filter is added as builtin filter. * `loop_controls`: enables the `{% break %}` and `{% continue %}` loop control flow tags. Performance and memory related features: * `stacker`: enables automatic stack growth which permits much larger levels of recursion at runtime. This does not affect the maximum recursion at parsing time which is always limited. * `speedups`: enables all speedups, in particular it turns on the `v_htmlescape` dependency for faster HTML escaping. Internals: * `unstable_machinery`: exposes an unstable internal API (no semver guarantees) to parse templates and interact with the engine internals. If you need this functionality, please leave some feedback on GitHub. Modules[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#modules) ------------------------------------------------------------------------------- [filters](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/filters/index.html "mod rocket_dyn_templates::minijinja::filters") Filter functions and abstractions. [functions](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/functions/index.html "mod rocket_dyn_templates::minijinja::functions") Global functions and abstractions. [syntax](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/syntax/index.html "mod rocket_dyn_templates::minijinja::syntax") Documents the syntax for templates. [tests](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/tests/index.html "mod rocket_dyn_templates::minijinja::tests") Test functions and abstractions. [value](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/value/index.html "mod rocket_dyn_templates::minijinja::value") Provides a dynamic value type abstraction. Macros[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#macros) ----------------------------------------------------------------------------- [args](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/macro.args.html "macro rocket_dyn_templates::minijinja::args") An utility macro to create arguments for function calls. [context](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/macro.context.html "macro rocket_dyn_templates::minijinja::context") Creates a template context from keys and values or merging in another value. [render](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/macro.render.html "macro rocket_dyn_templates::minijinja::render") A macro similar to [`format!`](https://doc.rust-lang.org/nightly/alloc/macro.format.html "macro alloc::format") but that uses MiniJinja for rendering. Structs[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#structs) ------------------------------------------------------------------------------- [Environment](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.Environment.html "struct rocket_dyn_templates::minijinja::Environment") An abstraction that holds the engine configuration. [Error](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.Error.html "struct rocket_dyn_templates::minijinja::Error") Represents template errors. [Expression](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.Expression.html "struct rocket_dyn_templates::minijinja::Expression") A handle to a compiled expression. [HtmlEscape](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.HtmlEscape.html "struct rocket_dyn_templates::minijinja::HtmlEscape") Helper to HTML escape a string. [Output](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.Output.html "struct rocket_dyn_templates::minijinja::Output") An abstraction over [`fmt::Write`](https://doc.rust-lang.org/nightly/core/fmt/trait.Write.html "trait core::fmt::Write") for the rendering. [State](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.State.html "struct rocket_dyn_templates::minijinja::State") Provides access to the current execution state of the engine. [Template](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.Template.html "struct rocket_dyn_templates::minijinja::Template") Represents a handle to a template. [Value](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/struct.Value.html "struct rocket_dyn_templates::minijinja::Value") Represents a dynamically typed value in the template engine. Enums[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#enums) --------------------------------------------------------------------------- [AutoEscape](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/enum.AutoEscape.html "enum rocket_dyn_templates::minijinja::AutoEscape") Controls the autoescaping behavior. [ErrorKind](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/enum.ErrorKind.html "enum rocket_dyn_templates::minijinja::ErrorKind") An enum describing the error kind. [FormatStyle](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/enum.FormatStyle.html "enum rocket_dyn_templates::minijinja::FormatStyle") Controls the style of the format string. [UndefinedBehavior](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/enum.UndefinedBehavior.html "enum rocket_dyn_templates::minijinja::UndefinedBehavior") Defines the behavior of undefined values in the engine. Functions[§](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/#functions) ----------------------------------------------------------------------------------- [default\_auto\_escape\_callback](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/fn.default_auto_escape_callback.html "fn rocket_dyn_templates::minijinja::default_auto_escape_callback") The default logic for auto escaping based on file extension. [escape\_formatter](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/fn.escape_formatter.html "fn rocket_dyn_templates::minijinja::escape_formatter") The default formatter. [format\_filter](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/fn.format_filter.html "fn rocket_dyn_templates::minijinja::format_filter") A helper function to apply a set of values to a given format string. [path\_loader](https://api.rocket.rs/v0.5/rocket_dyn_templates/minijinja/fn.path_loader.html "fn rocket_dyn_templates::minijinja::path_loader") Helper to load templates from a given directory. --- # rocket_sync_db_pools::example - Rust [Module example](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/#) ---------------------------------------------------------------------------- [rocket\_sync\_db\_pools](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html) Module example Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/lib.rs.html#393) Available on **`nightly` and crate feature `diesel_sqlite_pool`** only. Expand description Example of code generated by the `#[database]` attribute. Structs[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/#structs) ----------------------------------------------------------------------------- [ExampleDb](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html "struct rocket_sync_db_pools::example::ExampleDb") Example of code generated by the `#[database]` attribute. --- # DeserializeOwned in rocket::serde - Rust [DeserializeOwned](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned#) ------------------------------------------------------------------------------------ [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[serde](https://api.rocket.rs/v0.5/rocket/serde/index.html) Trait DeserializeOwned Copy item path ===================================== [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/mod.rs.html#632) pub trait DeserializeOwned: for<'de> Deserialize<'de> { } Expand description A data structure that can be deserialized without borrowing any data from the deserializer. This is primarily useful for trait bounds on functions. For example a `from_str` function may be able to deserialize a data structure that borrows from the input string, but a `from_reader` function may only deserialize owned data. [ⓘ](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned# "This example runs with edition 2021") fn from_str<'a, T>(s: &'a str) -> Result where T: Deserialize<'a>; fn from_reader(rdr: R) -> Result where R: Read, T: DeserializeOwned; [§](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned#lifetime) Lifetime ------------------------------------------------------------------------------------- The relationship between `Deserialize` and `DeserializeOwned` in trait bounds is explained in more detail on the page [Understanding deserializer lifetimes](https://serde.rs/lifetimes.html) . Dyn Compatibility[§](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned#dyn-compatibility) ------------------------------------------------------------------------------------------------------- This trait is **not** [dyn compatible](https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility) . _In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe._ Implementors[§](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned#implementors) --------------------------------------------------------------------------------------------- [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/mod.rs.html#633) [§](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned#impl-DeserializeOwned-for-T) ### impl [DeserializeOwned](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned.html "trait rocket::serde::DeserializeOwned") for T where T: for<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, --- # MutualTls in rocket::config - Rust [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#) ------------------------------------------------------------------------ [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[config](https://api.rocket.rs/v0.5/rocket/config/index.html) Struct MutualTls Copy item path =============================== [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#163-178) pub struct MutualTls { pub mandatory: bool, /* private fields */ } Available on **crate feature `mtls`** only. Expand description Mutual TLS configuration. Configuration works in concert with the [`mtls`](https://api.rocket.rs/v0.5/rocket/mtls/index.html "mod rocket::mtls") module, which provides a request guard to validate, verify, and retrieve client certificates in routes. By default, mutual TLS is disabled and client certificates are not required, validated or verified. To enable mutual TLS, the `mtls` feature must be enabled and support configured via two `tls.mutual` parameters: * `ca_certs` A required path to a PEM file or raw bytes to a DER-encoded X.509 TLS certificate chain for the certificate authority to verify client certificates against. When a path is configured in a file, such as `Rocket.toml`, relative paths are interpreted as relative to the source file’s directory. * `mandatory` An optional boolean that control whether client authentication is required. When `true`, client authentication is required. TLS connections where the client does not present a certificate are immediately terminated. When `false`, the client is not required to present a certificate. In either case, if a certificate _is_ presented, it must be valid or the connection is terminated. In a `Rocket.toml`, configuration might look like: [default.tls.mutual] ca_certs = "/ssl/ca_cert.pem" mandatory = true # when absent, defaults to false Programmatically, configuration might look like: use rocket::config::{Config, TlsConfig, MutualTls}; #[launch] fn rocket() -> _ { let tls_config = TlsConfig::from_paths("/ssl/certs.pem", "/ssl/key.pem") .with_mutual(MutualTls::from_path("/ssl/ca_cert.pem")); let config = Config { tls: Some(tls_config), ..Default::default() }; rocket::custom(config) } Once mTLS is configured, the [`mtls::Certificate`](https://api.rocket.rs/v0.5/rocket/mtls/struct.Certificate.html "struct rocket::mtls::Certificate") request guard can be used to retrieve client certificates in routes. Fields[§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#fields) ---------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#structfield.mandatory) `mandatory: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ` Whether the client is required to present a certificate. When `true`, the client is required to present a valid certificate to proceed with TLS. When `false`, the client is not required to present a certificate. In either case, if a certificate _is_ presented, it must be valid or the connection is terminated. Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#implementations) ---------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#542-625) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-MutualTls) ### impl [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#558-563) #### pub fn [from\_path](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.from_path) >(ca\_certs: C) -> Self Available on **crate feature `tls`** only. Constructs a `MutualTls` from a path to a PEM file with a certificate authority `ca_certs` DER-encoded X.509 TLS certificate chain. This method does no validation; it simply creates a structure suitable for passing into a [`TlsConfig`](https://api.rocket.rs/v0.5/rocket/config/struct.TlsConfig.html "struct rocket::config::TlsConfig") . These certificates will be used to verify client-presented certificates in TLS connections. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example) Example use rocket::config::MutualTls; let tls_config = MutualTls::from_path("/ssl/ca_certs.pem"); [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#581-586) #### pub fn [from\_bytes](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.from_bytes) (ca\_certs: &\[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \]) -> Self Available on **crate feature `tls`** only. Constructs a `MutualTls` from a byte buffer to a certificate authority `ca_certs` DER-encoded X.509 TLS certificate chain. This method does no validation; it simply creates a structure suitable for passing into a [`TlsConfig`](https://api.rocket.rs/v0.5/rocket/config/struct.TlsConfig.html "struct rocket::config::TlsConfig") . These certificates will be used to verify client-presented certificates in TLS connections. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-1) Example use rocket::config::MutualTls; let mtls_config = MutualTls::from_bytes(ca_certs_buf); [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#604-607) #### pub fn [mandatory](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.mandatory) (self, mandatory: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> Self Available on **crate feature `tls`** only. Sets whether client authentication is required. Disabled by default. When `true`, client authentication will be required. TLS connections where the client does not present a certificate will be immediately terminated. When `false`, the client is not required to present a certificate. In either case, if a certificate _is_ presented, it must be valid or the connection is terminated. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-2) Example use rocket::config::MutualTls; let mtls_config = MutualTls::from_bytes(ca_certs_buf).mandatory(true); [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#619-624) #### pub fn [ca\_certs](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.ca_certs) (&self) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") <[PathBuf](https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html "struct std::path::PathBuf") , &\[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \]> [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#) Available on **crate feature `tls`** only. Returns the value of the `ca_certs` parameter. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-3) Example use rocket::config::MutualTls; let mtls_config = MutualTls::from_bytes(ca_certs_buf).mandatory(true); assert_eq!(mtls_config.ca_certs().unwrap_right(), ca_certs_buf); Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#trait-implementations) ---------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#160) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Clone-for-MutualTls) ### impl [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") for [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") Available on **crate feature `tls`** only. [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#160) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.clone) #### fn [clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) (&self) -> [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#245-247) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.clone_from) #### fn [clone\_from](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) (&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#160) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Debug-for-MutualTls) ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") for [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") Available on **crate feature `tls`** only. [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#160) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.fmt) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#160) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Deserialize%3C'de%3E-for-MutualTls) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") Available on **crate feature `tls`** only. [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#160) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.deserialize) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html#tymethod.deserialize) <\_\_D>(\_\_deserializer: \_\_D) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") where \_\_D: [Deserializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserializer.html "trait rocket::serde::Deserializer") <'de>, Deserialize this value from the given Serde deserializer. [Read more](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html#tymethod.deserialize) [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#160) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-PartialEq-for-MutualTls) ### impl [PartialEq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::PartialEq") for [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") Available on **crate feature `tls`** only. [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#160) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.eq) #### fn [eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html#tymethod.eq) (&self, other: &[MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `self` and `other` values to be equal, and is used by `==`. 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#264) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.ne) #### fn [ne](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html#method.ne) (&self, other: [&Rhs](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#160) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Serialize-for-MutualTls) ### impl [Serialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html "trait rocket::serde::Serialize") for [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") Available on **crate feature `tls`** only. [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#160) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.serialize) #### fn [serialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html#tymethod.serialize) <\_\_S>(&self, \_\_serializer: \_\_S) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <\_\_S::[Ok](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html#associatedtype.Ok "type rocket::serde::Serializer::Ok") , \_\_S::[Error](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html#associatedtype.Error "type rocket::serde::Serializer::Error") \> where \_\_S: [Serializer](https://api.rocket.rs/v0.5/rocket/serde/trait.Serializer.html "trait rocket::serde::Serializer") , Serialize this value into the given Serde serializer. [Read more](https://api.rocket.rs/v0.5/rocket/serde/trait.Serialize.html#tymethod.serialize) [Source](https://api.rocket.rs/v0.5/src/rocket/config/tls.rs.html#160) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-StructuralPartialEq-for-MutualTls) ### impl [StructuralPartialEq](https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html "trait core::marker::StructuralPartialEq") for [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") Available on **crate feature `tls`** only. Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#synthetic-implementations) ------------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Freeze-for-MutualTls) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-RefUnwindSafe-for-MutualTls) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Send-for-MutualTls) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Sync-for-MutualTls) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Unpin-for-MutualTls) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-UnwindSafe-for-MutualTls) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [MutualTls](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls.html "struct rocket::config::MutualTls") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#blanket-implementations) -------------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#547) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-CloneToUninit-for-T) ### impl [CloneToUninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html "trait core::clone::CloneToUninit") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#549) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.clone_to_uninit) #### unsafe fn [clone\_to\_uninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) (&self, dest: [\*mut](https://doc.rust-lang.org/nightly/std/primitive.pointer.html) [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) 🔬This is a nightly-only experimental API. (`clone_to_uninit`) Performs copy-assignment from `self` to `dest`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-4) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-5) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-6) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-7) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-8) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-9) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-10) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-11) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-12) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-13) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-14) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-15) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-16) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-17) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-18) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-19) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-20) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-21) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-22) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-23) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-24) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-25) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-26) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-27) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-28) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-29) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-30) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-31) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-32) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-33) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-34) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-35) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-36) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-37) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-38) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-39) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-40) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-41) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-42) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-43) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-44) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-45) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-46) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-47) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-48) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-49) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-50) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-51) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-52) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-53) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-54) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-55) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-56) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-57) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-58) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-59) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-60) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-61) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#example-62) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-ToOwned-for-T) ### impl [ToOwned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html "trait alloc::borrow::ToOwned") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#associatedtype.Owned) #### type [Owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned) = T The resulting type after obtaining ownership. [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#90) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.to_owned) #### fn [to\_owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) (&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#94) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.clone_into) #### fn [clone\_into](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) (&self, target: [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) Uses borrowed data to replace owned data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/mod.rs.html#633) [§](https://api.rocket.rs/v0.5/rocket/config/struct.MutualTls#impl-DeserializeOwned-for-T) ### impl [DeserializeOwned](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned.html "trait rocket::serde::DeserializeOwned") for T where T: for<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, --- # Redirection Redirecting to [../../rocket/trait.Sentinel.html](https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html) ... --- # PgPool in rocket_db_pools::diesel - Rust [PgPool](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/type.PgPool#) ------------------------------------------------------------------------- [rocket\_db\_pools](https://api.rocket.rs/v0.5/rocket_db_pools/index.html) ::[diesel](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/index.html) Type Alias PgPool Copy item path ================================ [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/diesel.rs.html#149) pub type PgPool = Pool; Expand description Type alias for an `async` pool of Postgres connections for `async` [diesel](https://docs.rs/diesel/2.1.6/diesel/index.html "mod diesel") . use rocket_db_pools::{Database, Connection}; use rocket_db_pools::diesel::{PgPool, prelude::*}; #[derive(Database)] #[database("my_pg_db_name")] struct Db(PgPool); #[get("/")] async fn use_db(mut db: Connection) { /* .. */ } Aliased Type[§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/type.PgPool#aliased-type) -------------------------------------------------------------------------------------------- pub struct PgPool { /* private fields */ } --- # Connection in rocket_db_pools - Rust [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#) ---------------------------------------------------------------------------- [rocket\_db\_pools](https://api.rocket.rs/v0.5/rocket_db_pools/index.html) Struct Connection Copy item path ================================ [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#197) pub struct Connection(/* private fields */); Expand description A request guard which retrieves a single connection to a [`Database`](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html "trait rocket_db_pools::Database") . For a database type of `Db`, a request guard of `Connection` retrieves a single connection to `Db`. The request guard succeeds if the database was initialized by the [`Initializer`](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Initializer.html "struct rocket_db_pools::Initializer") fairing and a connection is available within [`connect_timeout`](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Config.html#structfield.connect_timeout "field rocket_db_pools::Config::connect_timeout") seconds. * If the `Initializer` fairing was _not_ attached, the guard _fails_ with status `InternalServerError`. A [`Sentinel`](https://api.rocket.rs/v0.5/rocket/sentinel/trait.Sentinel.html "trait rocket::sentinel::Sentinel") guards this condition, and so this type of error is unlikely to occur. A `None` error is returned. * If a connection is not available within `connect_timeout` seconds or another error occurs, the guard _fails_ with status `ServiceUnavailable` and the error is returned in `Some`. ### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#deref) Deref A type of `Connection` dereferences, mutably and immutably, to the native database connection type. The [driver table](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#supported-drivers "mod rocket_db_pools") lists the concrete native `Deref` types. [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example) Example --------------------------------------------------------------------------------- use rocket_db_pools::{Database, Connection}; #[derive(Database)] #[database("db")] struct Db(Pool); #[get("/")] async fn db_op(db: Connection) { // use `&*db` to get an immutable borrow to the native connection type // use `&mut *db` to get a mutable borrow to the native connection type } Implementations[§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#implementations) ------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#217-246) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Connection%3CD%3E) ### impl [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#243-245) #### pub fn [into\_inner](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.into_inner) (self) -> ::[Connection](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html#associatedtype.Connection "type rocket_db_pools::Pool::Connection") Returns the internal connection value. See the [`Connection` Deref column](https://api.rocket.rs/v0.5/rocket_db_pools/index.html#supported-drivers "mod rocket_db_pools") for the expected type of this value. Note that `Connection` derefs to the internal connection type, so using this method is likely unnecessary. See [deref](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html#deref "struct rocket_db_pools::Connection") for examples. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-1) Example use rocket_db_pools::{Database, Connection}; #[derive(Database)] #[database("db")] struct Db(Pool); #[get("/")] async fn db_op(db: Connection) { let inner = db.into_inner(); } Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#trait-implementations) ------------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#304-310) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Deref-for-Connection%3CD%3E) ### impl [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") for [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#305) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.Target) #### type [Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target) = <::[Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html#associatedtype.Pool "type rocket_db_pools::Database::Pool") as [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") \>::[Connection](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html#associatedtype.Connection "type rocket_db_pools::Pool::Connection") The resulting type after dereferencing. [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#307-309) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.deref) #### fn [deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref) (&self) -> &Self::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") Dereferences the value. [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#312-316) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-DerefMut-for-Connection%3CD%3E) ### impl [DerefMut](https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html "trait core::ops::deref::DerefMut") for [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#313-315) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.deref_mut) #### fn [deref\_mut](https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut) (&mut self) -> &mut Self::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") Mutably dereferences the value. [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#284-296) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-FromRequest%3C'r%3E-for-Connection%3CD%3E) ### impl<'r, D: [Database](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html "trait rocket_db_pools::Database") \> [FromRequest](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html "trait rocket::request::from_request::FromRequest") <'r> for [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#285) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html#associatedtype.Error) = [Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <<::[Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html#associatedtype.Pool "type rocket_db_pools::Database::Pool") as [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") \>::[Error](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html#associatedtype.Error "type rocket_db_pools::Pool::Error") \> The associated error to be returned if derivation fails. [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#287-295) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.from_request) #### fn [from\_request](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request) <'life0, 'async\_trait>( req: &'r [Request](https://api.rocket.rs/v0.5/rocket/request/request/struct.Request.html "struct rocket::request::request::Request") <'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'r: 'async\_trait, 'life0: 'async\_trait, Derives an instance of `Self` from the incoming request metadata. [Read more](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request) [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#298-302) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Sentinel-for-Connection%3CD%3E) ### impl [Sentinel](https://api.rocket.rs/v0.5/rocket/sentinel/trait.Sentinel.html "trait rocket::sentinel::Sentinel") for [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#299-301) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.abort) #### fn [abort](https://api.rocket.rs/v0.5/rocket/sentinel/trait.Sentinel.html#tymethod.abort) (rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Ignite](https://api.rocket.rs/v0.5/rocket/phase/enum.Ignite.html "enum rocket::phase::Ignite") \>) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if launch should be aborted and `false` otherwise. Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#synthetic-implementations) ---------------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Freeze-for-Connection%3CD%3E) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") where <::[Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html#associatedtype.Pool "type rocket_db_pools::Database::Pool") as [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") \>::[Connection](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html#associatedtype.Connection "type rocket_db_pools::Pool::Connection") : [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") , [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-RefUnwindSafe-for-Connection%3CD%3E) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") where <::[Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html#associatedtype.Pool "type rocket_db_pools::Database::Pool") as [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") \>::[Connection](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html#associatedtype.Connection "type rocket_db_pools::Pool::Connection") : [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") , [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Send-for-Connection%3CD%3E) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") where <::[Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html#associatedtype.Pool "type rocket_db_pools::Database::Pool") as [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") \>::[Connection](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html#associatedtype.Connection "type rocket_db_pools::Pool::Connection") : [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Sync-for-Connection%3CD%3E) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") where <::[Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html#associatedtype.Pool "type rocket_db_pools::Database::Pool") as [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") \>::[Connection](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html#associatedtype.Connection "type rocket_db_pools::Pool::Connection") : [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") , [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Unpin-for-Connection%3CD%3E) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") where <::[Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html#associatedtype.Pool "type rocket_db_pools::Database::Pool") as [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") \>::[Connection](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html#associatedtype.Connection "type rocket_db_pools::Pool::Connection") : [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") , [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-UnwindSafe-for-Connection%3CD%3E) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Connection](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection.html "struct rocket_db_pools::Connection") where <::[Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database.html#associatedtype.Pool "type rocket_db_pools::Database::Pool") as [Pool](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html "trait rocket_db_pools::Pool") \>::[Connection](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Pool.html#associatedtype.Connection "type rocket_db_pools::Pool::Connection") : [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") , Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#blanket-implementations) ----------------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html "trait asn1_rs::traits::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.explicit) #### fn [explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Explicit.html "enum asn1_rs::asn1_types::tagged::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html "trait asn1_rs::traits::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.implicit) #### fn [implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Implicit.html "enum asn1_rs::asn1_types::tagged::Implicit") , Self> [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#178-181) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-AsyncConnection-for-C) ### impl [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") for C where C: [DerefMut](https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html "trait core::ops::deref::DerefMut") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , ::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") : [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") , [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#183) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.ExecuteFuture) #### type [ExecuteFuture](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.ExecuteFuture) <'conn, 'query> = <::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") as [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") \>::[ExecuteFuture](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.ExecuteFuture "type rocket_db_pools::diesel::prelude::AsyncConnection::ExecuteFuture") <'conn, 'query> where ::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") : 'conn, C: 'conn The future returned by `AsyncConnection::execute` [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#186) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.LoadFuture) #### type [LoadFuture](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.LoadFuture) <'conn, 'query> = <::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") as [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") \>::[LoadFuture](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.LoadFuture "type rocket_db_pools::diesel::prelude::AsyncConnection::LoadFuture") <'conn, 'query> where ::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") : 'conn, C: 'conn The future returned by `AsyncConnection::load` [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#188) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.Stream) #### type [Stream](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.Stream) <'conn, 'query> = <::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") as [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") \>::[Stream](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.Stream "type rocket_db_pools::diesel::prelude::AsyncConnection::Stream") <'conn, 'query> where ::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") : 'conn, C: 'conn The inner stream returned by `AsyncConnection::load` [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#190) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.Row) #### type [Row](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.Row) <'conn, 'query> = <::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") as [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") \>::[Row](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.Row "type rocket_db_pools::diesel::prelude::AsyncConnection::Row") <'conn, 'query> where ::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") : 'conn, C: 'conn The row type used by the stream returned by `AsyncConnection::load` [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#193) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.Backend) #### type [Backend](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.Backend) = <::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") as [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") \>::[Backend](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.Backend "type rocket_db_pools::diesel::prelude::AsyncConnection::Backend") The backend this type connects to [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#195) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.TransactionManager) #### type [TransactionManager](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.TransactionManager) = PoolTransactionManager<<::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") as [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") \>::[TransactionManager](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.TransactionManager "type rocket_db_pools::diesel::prelude::AsyncConnection::TransactionManager") \> [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#177) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.establish) #### fn [establish](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#tymethod.establish) <'life0, 'async\_trait>( \_database\_url: &'life0 [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where 'life0: 'async\_trait, C: 'async\_trait, Establishes a new connection to the database [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#tymethod.establish) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#204-209) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.load-1) #### fn [load](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#tymethod.load) <'conn, 'query, T>( &'conn mut self, source: T, ) -> ::[LoadFuture](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.LoadFuture "type rocket_db_pools::diesel::prelude::AsyncConnection::LoadFuture") <'conn, 'query> where T: [AsQuery](https://docs.rs/diesel/2.1.6/diesel/query_builder/trait.AsQuery.html "trait diesel::query_builder::AsQuery") + 'query, ::[Query](https://docs.rs/diesel/2.1.6/diesel/query_builder/trait.AsQuery.html#associatedtype.Query "type diesel::query_builder::AsQuery::Query") : [QueryFragment](https://docs.rs/diesel/2.1.6/diesel/query_builder/trait.QueryFragment.html "trait diesel::query_builder::QueryFragment") <::[Backend](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.Backend "type rocket_db_pools::diesel::prelude::AsyncConnection::Backend") \> + [QueryId](https://docs.rs/diesel/2.1.6/diesel/query_builder/query_id/trait.QueryId.html "trait diesel::query_builder::query_id::QueryId") + 'query, [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#215-222) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.execute_returning_count) #### fn [execute\_returning\_count](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#tymethod.execute_returning_count) <'conn, 'query, T>( &'conn mut self, source: T, ) -> ::[ExecuteFuture](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.ExecuteFuture "type rocket_db_pools::diesel::prelude::AsyncConnection::ExecuteFuture") <'conn, 'query> where T: [QueryFragment](https://docs.rs/diesel/2.1.6/diesel/query_builder/trait.QueryFragment.html "trait diesel::query_builder::QueryFragment") <::[Backend](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.Backend "type rocket_db_pools::diesel::prelude::AsyncConnection::Backend") \> + [QueryId](https://docs.rs/diesel/2.1.6/diesel/query_builder/query_id/trait.QueryId.html "trait diesel::query_builder::query_id::QueryId") + 'query, [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#228-230) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.transaction_state) #### fn [transaction\_state](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#tymethod.transaction_state) ( &mut self, ) -> &mut <::[TransactionManager](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.TransactionManager "type rocket_db_pools::diesel::prelude::AsyncConnection::TransactionManager") as [TransactionManager](https://docs.rs/diesel-async/0.4.1/diesel_async/transaction_manager/trait.TransactionManager.html "trait diesel_async::transaction_manager::TransactionManager") >::[TransactionStateData](https://docs.rs/diesel-async/0.4.1/diesel_async/transaction_manager/trait.TransactionManager.html#associatedtype.TransactionStateData "type diesel_async::transaction_manager::TransactionManager::TransactionStateData") [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#177) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.begin_test_transaction) #### fn [begin\_test\_transaction](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#method.begin_test_transaction) <'life0, 'async\_trait>( &'life0 mut self, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where 'life0: 'async\_trait, C: 'async\_trait, Creates a transaction that will never be committed. This is useful for tests. Panics if called while inside of a transaction or if called with a connection containing a broken transaction [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/lib.rs.html#127) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.transaction) #### fn [transaction](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#method.transaction) <'a, 'life0, 'async\_trait, R, E, F>( &'life0 mut self, callback: F, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where 'a: 'async\_trait, 'life0: 'async\_trait, F: for<'r> [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&'r mut Self) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") , Output = [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'r>> + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a + 'async\_trait, E: [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") <[Error](https://docs.rs/diesel/2.1.6/diesel/result/enum.Error.html "enum diesel::result::Error") \> + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a + 'async\_trait, R: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a + 'async\_trait, Self: 'async\_trait, Executes the given function inside of a database transaction [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#method.transaction) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/lib.rs.html#127) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.test_transaction) #### fn [test\_transaction](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#method.test_transaction) <'a, 'async\_trait, R, E, F>( &'a mut self, f: F, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where 'a: 'async\_trait, F: for<'r> [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&'r mut Self) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") , Output = [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'r>> + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a + 'async\_trait, E: [Debug](https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html "trait core::fmt::Debug") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a + 'async\_trait, R: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a + 'async\_trait, Self: 'a + 'async\_trait, Executes the given function inside a transaction, but does not commit it. Panics if the given function returns an error. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#method.test_transaction) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#2038) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Commands-for-T) ### impl [Commands](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html "trait redis::commands::Commands") for T where T: [ConnectionLike](https://docs.rs/redis/0.25.4/redis/connection/trait.ConnectionLike.html "trait redis::connection::ConnectionLike") , [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.get) #### fn [get](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.get) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get the value of a key. If key is a vec this becomes an `MGET`. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.mget) #### fn [mget](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.mget) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get values of keys [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.keys) #### fn [keys](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.keys) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Gets all keys matching pattern [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.set) #### fn [set](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.set) <'a, K, V, RV>(&mut self, key: K, value: V) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Set the string value of a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.set_options) #### fn [set\_options](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.set_options) <'a, K, V, RV>( &mut self, key: K, value: V, options: [SetOptions](https://docs.rs/redis/0.25.4/redis/commands/struct.SetOptions.html "struct redis::commands::SetOptions") , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Set the string value of a key with options. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.set_multiple) #### fn [set\_multiple](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.set_multiple) <'a, K, V, RV>( &mut self, items: &'a \[[(K, V)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)\ \], ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , 👎Deprecated since 0.22.4: Renamed to mset() to reflect Redis name Sets multiple keys to their values. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.mset) #### fn [mset](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.mset) <'a, K, V, RV>(&mut self, items: &'a \[[(K, V)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)\ \]) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Sets multiple keys to their values. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.set_ex) #### fn [set\_ex](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.set_ex) <'a, K, V, RV>( &mut self, key: K, value: V, seconds: [u64](https://doc.rust-lang.org/nightly/std/primitive.u64.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Set the value and expiration of a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pset_ex) #### fn [pset\_ex](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.pset_ex) <'a, K, V, RV>( &mut self, key: K, value: V, milliseconds: [u64](https://doc.rust-lang.org/nightly/std/primitive.u64.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Set the value and expiration in milliseconds of a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.set_nx) #### fn [set\_nx](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.set_nx) <'a, K, V, RV>(&mut self, key: K, value: V) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Set the value of a key, only if the key does not exist [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.mset_nx) #### fn [mset\_nx](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.mset_nx) <'a, K, V, RV>( &mut self, items: &'a \[[(K, V)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)\ \], ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Sets multiple keys to their values failing if at least one already exists. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.getset) #### fn [getset](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.getset) <'a, K, V, RV>(&mut self, key: K, value: V) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Set the string value of a key and return its old value. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.getrange) #### fn [getrange](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.getrange) <'a, K, RV>( &mut self, key: K, from: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , to: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get a range of bytes/substring from the value of a key. Negative values provide an offset from the end of the value. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.setrange) #### fn [setrange](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.setrange) <'a, K, V, RV>( &mut self, key: K, offset: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , value: V, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Overwrite the part of the value stored in key at the specified offset. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.del) #### fn [del](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.del) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Delete one or more keys. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.exists) #### fn [exists](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.exists) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Determine if a key exists. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.key_type) #### fn [key\_type](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.key_type) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Determine the type of a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.expire) #### fn [expire](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.expire) <'a, K, RV>(&mut self, key: K, seconds: [i64](https://doc.rust-lang.org/nightly/std/primitive.i64.html) ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Set a key’s time to live in seconds. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.expire_at) #### fn [expire\_at](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.expire_at) <'a, K, RV>(&mut self, key: K, ts: [i64](https://doc.rust-lang.org/nightly/std/primitive.i64.html) ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Set the expiration for a key as a UNIX timestamp. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pexpire) #### fn [pexpire](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.pexpire) <'a, K, RV>(&mut self, key: K, ms: [i64](https://doc.rust-lang.org/nightly/std/primitive.i64.html) ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Set a key’s time to live in milliseconds. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pexpire_at) #### fn [pexpire\_at](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.pexpire_at) <'a, K, RV>(&mut self, key: K, ts: [i64](https://doc.rust-lang.org/nightly/std/primitive.i64.html) ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Set the expiration for a key as a UNIX timestamp in milliseconds. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.persist) #### fn [persist](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.persist) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Remove the expiration from a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.ttl) #### fn [ttl](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.ttl) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get the expiration time of a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pttl) #### fn [pttl](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.pttl) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get the expiration time of a key in milliseconds. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.get_ex) #### fn [get\_ex](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.get_ex) <'a, K, RV>( &mut self, key: K, expire\_at: [Expiry](https://docs.rs/redis/0.25.4/redis/types/enum.Expiry.html "enum redis::types::Expiry") , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get the value of a key and set expiration [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.get_del) #### fn [get\_del](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.get_del) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get the value of a key and delete it [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.rename) #### fn [rename](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.rename) <'a, K, N, RV>(&mut self, key: K, new\_key: N) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , N: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Rename a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.rename_nx) #### fn [rename\_nx](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.rename_nx) <'a, K, N, RV>( &mut self, key: K, new\_key: N, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , N: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Rename a key, only if the new key does not exist. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.unlink) #### fn [unlink](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.unlink) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Unlink one or more keys. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.append) #### fn [append](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.append) <'a, K, V, RV>(&mut self, key: K, value: V) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Append a value to a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.incr) #### fn [incr](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.incr) <'a, K, V, RV>(&mut self, key: K, delta: V) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Increment the numeric value of a key by the given amount. This issues a `INCRBY` or `INCRBYFLOAT` depending on the type. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.decr) #### fn [decr](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.decr) <'a, K, V, RV>(&mut self, key: K, delta: V) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Decrement the numeric value of a key by the given amount. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.setbit) #### fn [setbit](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.setbit) <'a, K, RV>( &mut self, key: K, offset: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) , value: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Sets or clears the bit at offset in the string value stored at key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.getbit) #### fn [getbit](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.getbit) <'a, K, RV>(&mut self, key: K, offset: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Returns the bit value at offset in the string value stored at key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bitcount) #### fn [bitcount](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.bitcount) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Count set bits in a string. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bitcount_range) #### fn [bitcount\_range](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.bitcount_range) <'a, K, RV>( &mut self, key: K, start: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) , end: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Count set bits in a string in a range. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bit_and) #### fn [bit\_and](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.bit_and) <'a, D, S, RV>( &mut self, dstkey: D, srckeys: S, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , S: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Perform a bitwise AND between multiple keys (containing string values) and store the result in the destination key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bit_or) #### fn [bit\_or](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.bit_or) <'a, D, S, RV>( &mut self, dstkey: D, srckeys: S, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , S: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Perform a bitwise OR between multiple keys (containing string values) and store the result in the destination key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bit_xor) #### fn [bit\_xor](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.bit_xor) <'a, D, S, RV>( &mut self, dstkey: D, srckeys: S, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , S: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Perform a bitwise XOR between multiple keys (containing string values) and store the result in the destination key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bit_not) #### fn [bit\_not](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.bit_not) <'a, D, S, RV>( &mut self, dstkey: D, srckey: S, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , S: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Perform a bitwise NOT of the key (containing string values) and store the result in the destination key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.strlen) #### fn [strlen](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.strlen) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get the length of the value stored in a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.hget) #### fn [hget](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.hget) <'a, K, F, RV>(&mut self, key: K, field: F) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , F: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Gets a single (or multiple) fields from a hash. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.hdel) #### fn [hdel](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.hdel) <'a, K, F, RV>(&mut self, key: K, field: F) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , F: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Deletes a single (or multiple) fields from a hash. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.hset) #### fn [hset](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.hset) <'a, K, F, V, RV>( &mut self, key: K, field: F, value: V, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , F: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Sets a single field in a hash. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.hset_nx) #### fn [hset\_nx](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.hset_nx) <'a, K, F, V, RV>( &mut self, key: K, field: F, value: V, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , F: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Sets a single field in a hash if it does not exist. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.hset_multiple) #### fn [hset\_multiple](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.hset_multiple) <'a, K, F, V, RV>( &mut self, key: K, items: &'a \[[(F, V)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)\ \], ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , F: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Sets a multiple fields in a hash. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.hincr) #### fn [hincr](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.hincr) <'a, K, F, D, RV>( &mut self, key: K, field: F, delta: D, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , F: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Increments a value. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.hexists) #### fn [hexists](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.hexists) <'a, K, F, RV>(&mut self, key: K, field: F) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , F: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Checks if a field in a hash exists. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.hkeys) #### fn [hkeys](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.hkeys) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Gets all the keys in a hash. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.hvals) #### fn [hvals](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.hvals) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Gets all the values in a hash. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.hgetall) #### fn [hgetall](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.hgetall) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Gets all the fields and values in a hash. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.hlen) #### fn [hlen](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.hlen) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Gets the length of a hash. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.blmove) #### fn [blmove](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.blmove) <'a, S, D, RV>( &mut self, srckey: S, dstkey: D, src\_dir: [Direction](https://docs.rs/redis/0.25.4/redis/commands/enum.Direction.html "enum redis::commands::Direction") , dst\_dir: [Direction](https://docs.rs/redis/0.25.4/redis/commands/enum.Direction.html "enum redis::commands::Direction") , timeout: [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where S: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Pop an element from a list, push it to another list and return it; or block until one is available [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.blmpop) #### fn [blmpop](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.blmpop) <'a, K, RV>( &mut self, timeout: [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) , numkeys: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) , key: K, dir: [Direction](https://docs.rs/redis/0.25.4/redis/commands/enum.Direction.html "enum redis::commands::Direction") , count: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Pops `count` elements from the first non-empty list key from the list of provided key names; or blocks until one is available. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.blpop) #### fn [blpop](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.blpop) <'a, K, RV>(&mut self, key: K, timeout: [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Remove and get the first element in a list, or block until one is available. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.brpop) #### fn [brpop](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.brpop) <'a, K, RV>(&mut self, key: K, timeout: [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Remove and get the last element in a list, or block until one is available. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.brpoplpush) #### fn [brpoplpush](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.brpoplpush) <'a, S, D, RV>( &mut self, srckey: S, dstkey: D, timeout: [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where S: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Pop a value from a list, push it to another list and return it; or block until one is available. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.lindex) #### fn [lindex](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.lindex) <'a, K, RV>(&mut self, key: K, index: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get an element from a list by its index. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.linsert_before) #### fn [linsert\_before](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.linsert_before) <'a, K, P, V, RV>( &mut self, key: K, pivot: P, value: V, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , P: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Insert an element before another element in a list. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.linsert_after) #### fn [linsert\_after](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.linsert_after) <'a, K, P, V, RV>( &mut self, key: K, pivot: P, value: V, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , P: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Insert an element after another element in a list. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.llen) #### fn [llen](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.llen) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Returns the length of the list stored at key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.lmove) #### fn [lmove](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.lmove) <'a, S, D, RV>( &mut self, srckey: S, dstkey: D, src\_dir: [Direction](https://docs.rs/redis/0.25.4/redis/commands/enum.Direction.html "enum redis::commands::Direction") , dst\_dir: [Direction](https://docs.rs/redis/0.25.4/redis/commands/enum.Direction.html "enum redis::commands::Direction") , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where S: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Pop an element a list, push it to another list and return it [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.lmpop) #### fn [lmpop](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.lmpop) <'a, K, RV>( &mut self, numkeys: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) , key: K, dir: [Direction](https://docs.rs/redis/0.25.4/redis/commands/enum.Direction.html "enum redis::commands::Direction") , count: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Pops `count` elements from the first non-empty list key from the list of provided key names. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.lpop) #### fn [lpop](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.lpop) <'a, K, RV>( &mut self, key: K, count: [Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) \>>, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Removes and returns the up to `count` first elements of the list stored at key. [Read more](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.lpop) [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.lpos) #### fn [lpos](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.lpos) <'a, K, V, RV>( &mut self, key: K, value: V, options: [LposOptions](https://docs.rs/redis/0.25.4/redis/commands/struct.LposOptions.html "struct redis::commands::LposOptions") , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Returns the index of the first matching value of the list stored at key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.lpush) #### fn [lpush](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.lpush) <'a, K, V, RV>(&mut self, key: K, value: V) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Insert all the specified values at the head of the list stored at key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.lpush_exists) #### fn [lpush\_exists](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.lpush_exists) <'a, K, V, RV>( &mut self, key: K, value: V, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Inserts a value at the head of the list stored at key, only if key already exists and holds a list. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.lrange) #### fn [lrange](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.lrange) <'a, K, RV>( &mut self, key: K, start: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , stop: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Returns the specified elements of the list stored at key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.lrem) #### fn [lrem](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.lrem) <'a, K, V, RV>( &mut self, key: K, count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , value: V, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Removes the first count occurrences of elements equal to value from the list stored at key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.ltrim) #### fn [ltrim](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.ltrim) <'a, K, RV>( &mut self, key: K, start: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , stop: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Trim an existing list so that it will contain only the specified range of elements specified. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.lset) #### fn [lset](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.lset) <'a, K, V, RV>( &mut self, key: K, index: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , value: V, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Sets the list element at index to value [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.rpop) #### fn [rpop](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.rpop) <'a, K, RV>( &mut self, key: K, count: [Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <[NonZero](https://doc.rust-lang.org/nightly/core/num/nonzero/struct.NonZero.html "struct core::num::nonzero::NonZero") <[usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) \>>, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Removes and returns the up to `count` last elements of the list stored at key [Read more](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.rpop) [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.rpoplpush) #### fn [rpoplpush](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.rpoplpush) <'a, K, D, RV>( &mut self, key: K, dstkey: D, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Pop a value from a list, push it to another list and return it. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.rpush) #### fn [rpush](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.rpush) <'a, K, V, RV>(&mut self, key: K, value: V) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Insert all the specified values at the tail of the list stored at key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.rpush_exists) #### fn [rpush\_exists](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.rpush_exists) <'a, K, V, RV>( &mut self, key: K, value: V, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , V: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Inserts value at the tail of the list stored at key, only if key already exists and holds a list. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.sadd) #### fn [sadd](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.sadd) <'a, K, M, RV>(&mut self, key: K, member: M) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Add one or more members to a set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.scard) #### fn [scard](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.scard) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get the number of members in a set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.sdiff) #### fn [sdiff](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.sdiff) <'a, K, RV>(&mut self, keys: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Subtract multiple sets. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.sdiffstore) #### fn [sdiffstore](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.sdiffstore) <'a, D, K, RV>( &mut self, dstkey: D, keys: K, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Subtract multiple sets and store the resulting set in a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.sinter) #### fn [sinter](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.sinter) <'a, K, RV>(&mut self, keys: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Intersect multiple sets. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.sinterstore) #### fn [sinterstore](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.sinterstore) <'a, D, K, RV>( &mut self, dstkey: D, keys: K, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Intersect multiple sets and store the resulting set in a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.sismember) #### fn [sismember](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.sismember) <'a, K, M, RV>( &mut self, key: K, member: M, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Determine if a given value is a member of a set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.smismember) #### fn [smismember](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.smismember) <'a, K, M, RV>( &mut self, key: K, members: M, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Determine if given values are members of a set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.smembers) #### fn [smembers](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.smembers) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get all the members in a set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.smove) #### fn [smove](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.smove) <'a, S, D, M, RV>( &mut self, srckey: S, dstkey: D, member: M, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where S: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Move a member from one set to another. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.spop) #### fn [spop](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.spop) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Remove and return a random member from a set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.srandmember) #### fn [srandmember](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.srandmember) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get one random member from a set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.srandmember_multiple) #### fn [srandmember\_multiple](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.srandmember_multiple) <'a, K, RV>( &mut self, key: K, count: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get multiple random members from a set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.srem) #### fn [srem](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.srem) <'a, K, M, RV>(&mut self, key: K, member: M) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Remove one or more members from a set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.sunion) #### fn [sunion](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.sunion) <'a, K, RV>(&mut self, keys: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Add multiple sets. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.sunionstore) #### fn [sunionstore](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.sunionstore) <'a, D, K, RV>( &mut self, dstkey: D, keys: K, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Add multiple sets and store the resulting set in a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zadd) #### fn [zadd](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zadd) <'a, K, S, M, RV>( &mut self, key: K, member: M, score: S, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , S: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Add one member to a sorted set, or update its score if it already exists. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zadd_multiple) #### fn [zadd\_multiple](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zadd_multiple) <'a, K, S, M, RV>( &mut self, key: K, items: &'a \[[(S, M)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)\ \], ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , S: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Add multiple members to a sorted set, or update its score if it already exists. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zcard) #### fn [zcard](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zcard) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get the number of members in a sorted set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zcount) #### fn [zcount](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zcount) <'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Count the members in a sorted set with scores within the given values. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zincr) #### fn [zincr](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zincr) <'a, K, M, D, RV>( &mut self, key: K, member: M, delta: D, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Increments the member in a sorted set at key by delta. If the member does not exist, it is added with delta as its score. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zinterstore) #### fn [zinterstore](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zinterstore) <'a, D, K, RV>( &mut self, dstkey: D, keys: &'a [\[K\]](https://doc.rust-lang.org/nightly/std/primitive.slice.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Intersect multiple sorted sets and store the resulting sorted set in a new key using SUM as aggregation function. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zinterstore_min) #### fn [zinterstore\_min](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zinterstore_min) <'a, D, K, RV>( &mut self, dstkey: D, keys: &'a [\[K\]](https://doc.rust-lang.org/nightly/std/primitive.slice.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Intersect multiple sorted sets and store the resulting sorted set in a new key using MIN as aggregation function. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zinterstore_max) #### fn [zinterstore\_max](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zinterstore_max) <'a, D, K, RV>( &mut self, dstkey: D, keys: &'a [\[K\]](https://doc.rust-lang.org/nightly/std/primitive.slice.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Intersect multiple sorted sets and store the resulting sorted set in a new key using MAX as aggregation function. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zinterstore_weights) #### fn [zinterstore\_weights](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zinterstore_weights) <'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a \[[(K, W)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)\ \], ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , W: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , [`Commands::zinterstore`](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zinterstore "method redis::commands::Commands::zinterstore") , but with the ability to specify a multiplication factor for each sorted set by pairing one with each key in a tuple. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zinterstore_min_weights) #### fn [zinterstore\_min\_weights](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zinterstore_min_weights) <'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a \[[(K, W)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)\ \], ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , W: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , [`Commands::zinterstore_min`](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zinterstore_min "method redis::commands::Commands::zinterstore_min") , but with the ability to specify a multiplication factor for each sorted set by pairing one with each key in a tuple. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zinterstore_max_weights) #### fn [zinterstore\_max\_weights](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zinterstore_max_weights) <'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a \[[(K, W)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)\ \], ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , W: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , [`Commands::zinterstore_max`](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zinterstore_max "method redis::commands::Commands::zinterstore_max") , but with the ability to specify a multiplication factor for each sorted set by pairing one with each key in a tuple. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zlexcount) #### fn [zlexcount](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zlexcount) <'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Count the number of members in a sorted set between a given lexicographical range. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bzpopmax) #### fn [bzpopmax](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.bzpopmax) <'a, K, RV>( &mut self, key: K, timeout: [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Removes and returns the member with the highest score in a sorted set. Blocks until a member is available otherwise. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zpopmax) #### fn [zpopmax](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zpopmax) <'a, K, RV>(&mut self, key: K, count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Removes and returns up to count members with the highest scores in a sorted set [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bzpopmin) #### fn [bzpopmin](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.bzpopmin) <'a, K, RV>( &mut self, key: K, timeout: [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Removes and returns the member with the lowest score in a sorted set. Blocks until a member is available otherwise. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zpopmin) #### fn [zpopmin](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zpopmin) <'a, K, RV>(&mut self, key: K, count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Removes and returns up to count members with the lowest scores in a sorted set [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bzmpop_max) #### fn [bzmpop\_max](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.bzmpop_max) <'a, K, RV>( &mut self, timeout: [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) , keys: &'a [\[K\]](https://doc.rust-lang.org/nightly/std/primitive.slice.html) , count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Removes and returns up to count members with the highest scores, from the first non-empty sorted set in the provided list of key names. Blocks until a member is available otherwise. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zmpop_max) #### fn [zmpop\_max](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zmpop_max) <'a, K, RV>( &mut self, keys: &'a [\[K\]](https://doc.rust-lang.org/nightly/std/primitive.slice.html) , count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Removes and returns up to count members with the highest scores, from the first non-empty sorted set in the provided list of key names. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bzmpop_min) #### fn [bzmpop\_min](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.bzmpop_min) <'a, K, RV>( &mut self, timeout: [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) , keys: &'a [\[K\]](https://doc.rust-lang.org/nightly/std/primitive.slice.html) , count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Removes and returns up to count members with the lowest scores, from the first non-empty sorted set in the provided list of key names. Blocks until a member is available otherwise. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zmpop_min) #### fn [zmpop\_min](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zmpop_min) <'a, K, RV>( &mut self, keys: &'a [\[K\]](https://doc.rust-lang.org/nightly/std/primitive.slice.html) , count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Removes and returns up to count members with the lowest scores, from the first non-empty sorted set in the provided list of key names. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrandmember) #### fn [zrandmember](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrandmember) <'a, K, RV>( &mut self, key: K, count: [Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <[isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) \>, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return up to count random members in a sorted set (or 1 if `count == None`) [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrandmember_withscores) #### fn [zrandmember\_withscores](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrandmember_withscores) <'a, K, RV>( &mut self, key: K, count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return up to count random members in a sorted set with scores [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrange) #### fn [zrange](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrange) <'a, K, RV>( &mut self, key: K, start: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , stop: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by index [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrange_withscores) #### fn [zrange\_withscores](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrange_withscores) <'a, K, RV>( &mut self, key: K, start: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , stop: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by index with scores. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrangebylex) #### fn [zrangebylex](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrangebylex) <'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by lexicographical range. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrangebylex_limit) #### fn [zrangebylex\_limit](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrangebylex_limit) <'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, offset: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by lexicographical range with offset and limit. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrevrangebylex) #### fn [zrevrangebylex](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrevrangebylex) <'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by lexicographical range. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrevrangebylex_limit) #### fn [zrevrangebylex\_limit](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrevrangebylex_limit) <'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, offset: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by lexicographical range with offset and limit. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrangebyscore) #### fn [zrangebyscore](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrangebyscore) <'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by score. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrangebyscore_withscores) #### fn [zrangebyscore\_withscores](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrangebyscore_withscores) <'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by score with scores. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrangebyscore_limit) #### fn [zrangebyscore\_limit](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrangebyscore_limit) <'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, offset: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by score with limit. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrangebyscore_limit_withscores) #### fn [zrangebyscore\_limit\_withscores](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrangebyscore_limit_withscores) <'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, offset: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by score with limit with scores. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrank) #### fn [zrank](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrank) <'a, K, M, RV>(&mut self, key: K, member: M) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Determine the index of a member in a sorted set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrem) #### fn [zrem](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrem) <'a, K, M, RV>(&mut self, key: K, members: M) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Remove one or more members from a sorted set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrembylex) #### fn [zrembylex](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrembylex) <'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Remove all members in a sorted set between the given lexicographical range. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zremrangebyrank) #### fn [zremrangebyrank](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zremrangebyrank) <'a, K, RV>( &mut self, key: K, start: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , stop: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Remove all members in a sorted set within the given indexes. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrembyscore) #### fn [zrembyscore](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrembyscore) <'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Remove all members in a sorted set within the given scores. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrevrange) #### fn [zrevrange](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrevrange) <'a, K, RV>( &mut self, key: K, start: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , stop: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by index, with scores ordered from high to low. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrevrange_withscores) #### fn [zrevrange\_withscores](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrevrange_withscores) <'a, K, RV>( &mut self, key: K, start: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , stop: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by index, with scores ordered from high to low. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrevrangebyscore) #### fn [zrevrangebyscore](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrevrangebyscore) <'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by score. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrevrangebyscore_withscores) #### fn [zrevrangebyscore\_withscores](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrevrangebyscore_withscores) <'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by score with scores. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrevrangebyscore_limit) #### fn [zrevrangebyscore\_limit](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrevrangebyscore_limit) <'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, offset: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by score with limit. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrevrangebyscore_limit_withscores) #### fn [zrevrangebyscore\_limit\_withscores](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrevrangebyscore_limit_withscores) <'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, offset: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , count: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , MM: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return a range of members in a sorted set, by score with limit with scores. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zrevrank) #### fn [zrevrank](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zrevrank) <'a, K, M, RV>( &mut self, key: K, member: M, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Determine the index of a member in a sorted set, with scores ordered from high to low. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zscore) #### fn [zscore](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zscore) <'a, K, M, RV>(&mut self, key: K, member: M) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get the score associated with the given member in a sorted set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zscore_multiple) #### fn [zscore\_multiple](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zscore_multiple) <'a, K, M, RV>( &mut self, key: K, members: &'a [\[M\]](https://doc.rust-lang.org/nightly/std/primitive.slice.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , M: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Get the scores associated with multiple members in a sorted set. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zunionstore) #### fn [zunionstore](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zunionstore) <'a, D, K, RV>( &mut self, dstkey: D, keys: &'a [\[K\]](https://doc.rust-lang.org/nightly/std/primitive.slice.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Unions multiple sorted sets and store the resulting sorted set in a new key using SUM as aggregation function. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zunionstore_min) #### fn [zunionstore\_min](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zunionstore_min) <'a, D, K, RV>( &mut self, dstkey: D, keys: &'a [\[K\]](https://doc.rust-lang.org/nightly/std/primitive.slice.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Unions multiple sorted sets and store the resulting sorted set in a new key using MIN as aggregation function. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zunionstore_max) #### fn [zunionstore\_max](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zunionstore_max) <'a, D, K, RV>( &mut self, dstkey: D, keys: &'a [\[K\]](https://doc.rust-lang.org/nightly/std/primitive.slice.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Unions multiple sorted sets and store the resulting sorted set in a new key using MAX as aggregation function. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zunionstore_weights) #### fn [zunionstore\_weights](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zunionstore_weights) <'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a \[[(K, W)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)\ \], ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , W: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , [`Commands::zunionstore`](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zunionstore "method redis::commands::Commands::zunionstore") , but with the ability to specify a multiplication factor for each sorted set by pairing one with each key in a tuple. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zunionstore_min_weights) #### fn [zunionstore\_min\_weights](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zunionstore_min_weights) <'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a \[[(K, W)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)\ \], ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , W: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , [`Commands::zunionstore_min`](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zunionstore_min "method redis::commands::Commands::zunionstore_min") , but with the ability to specify a multiplication factor for each sorted set by pairing one with each key in a tuple. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zunionstore_max_weights) #### fn [zunionstore\_max\_weights](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zunionstore_max_weights) <'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a \[[(K, W)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)\ \], ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , W: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , [`Commands::zunionstore_max`](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zunionstore_max "method redis::commands::Commands::zunionstore_max") , but with the ability to specify a multiplication factor for each sorted set by pairing one with each key in a tuple. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pfadd) #### fn [pfadd](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.pfadd) <'a, K, E, RV>(&mut self, key: K, element: E) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , E: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Adds the specified elements to the specified HyperLogLog. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pfcount) #### fn [pfcount](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.pfcount) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s). [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pfmerge) #### fn [pfmerge](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.pfmerge) <'a, D, S, RV>( &mut self, dstkey: D, srckeys: S, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where D: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , S: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Merge N different HyperLogLogs into a single one. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.publish) #### fn [publish](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.publish) <'a, K, E, RV>( &mut self, channel: K, message: E, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , E: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Posts a message to the given channel. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.object_encoding) #### fn [object\_encoding](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.object_encoding) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Returns the encoding of a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.object_idletime) #### fn [object\_idletime](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.object_idletime) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Returns the time in seconds since the last access of a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.object_freq) #### fn [object\_freq](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.object_freq) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Returns the logarithmic access frequency counter of a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.object_refcount) #### fn [object\_refcount](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.object_refcount) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Returns the reference count of a key. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.xrevrange_all) #### fn [xrevrange\_all](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.xrevrange_all) <'a, K, RV>(&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , This is the reverse version of `xrange_all`. The same rules apply for `start` and `end` here. [Read more](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.xrevrange_all) [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.scan) #### fn [scan](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.scan) (&mut self) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[Iter](https://docs.rs/redis/0.25.4/redis/cmd/struct.Iter.html "struct redis::cmd::Iter") <'\_, RV>, [RedisError](https://docs.rs/redis/0.25.4/redis/types/struct.RedisError.html "struct redis::types::RedisError") \> where RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Incrementally iterate the keys space. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.scan_match) #### fn [scan\_match](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.scan_match) (&mut self, pattern: P) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[Iter](https://docs.rs/redis/0.25.4/redis/cmd/struct.Iter.html "struct redis::cmd::Iter") <'\_, RV>, [RedisError](https://docs.rs/redis/0.25.4/redis/types/struct.RedisError.html "struct redis::types::RedisError") \> where P: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Incrementally iterate the keys space for keys matching a pattern. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.hscan) #### fn [hscan](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.hscan) (&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[Iter](https://docs.rs/redis/0.25.4/redis/cmd/struct.Iter.html "struct redis::cmd::Iter") <'\_, RV>, [RedisError](https://docs.rs/redis/0.25.4/redis/types/struct.RedisError.html "struct redis::types::RedisError") \> where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Incrementally iterate hash fields and associated values. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.hscan_match) #### fn [hscan\_match](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.hscan_match) ( &mut self, key: K, pattern: P, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[Iter](https://docs.rs/redis/0.25.4/redis/cmd/struct.Iter.html "struct redis::cmd::Iter") <'\_, RV>, [RedisError](https://docs.rs/redis/0.25.4/redis/types/struct.RedisError.html "struct redis::types::RedisError") \> where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , P: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Incrementally iterate hash fields and associated values for field names matching a pattern. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.sscan) #### fn [sscan](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.sscan) (&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[Iter](https://docs.rs/redis/0.25.4/redis/cmd/struct.Iter.html "struct redis::cmd::Iter") <'\_, RV>, [RedisError](https://docs.rs/redis/0.25.4/redis/types/struct.RedisError.html "struct redis::types::RedisError") \> where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Incrementally iterate set elements. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.sscan_match) #### fn [sscan\_match](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.sscan_match) ( &mut self, key: K, pattern: P, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[Iter](https://docs.rs/redis/0.25.4/redis/cmd/struct.Iter.html "struct redis::cmd::Iter") <'\_, RV>, [RedisError](https://docs.rs/redis/0.25.4/redis/types/struct.RedisError.html "struct redis::types::RedisError") \> where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , P: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Incrementally iterate set elements for elements matching a pattern. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zscan) #### fn [zscan](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zscan) (&mut self, key: K) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[Iter](https://docs.rs/redis/0.25.4/redis/cmd/struct.Iter.html "struct redis::cmd::Iter") <'\_, RV>, [RedisError](https://docs.rs/redis/0.25.4/redis/types/struct.RedisError.html "struct redis::types::RedisError") \> where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Incrementally iterate sorted set elements. [Source](https://docs.rs/redis/0.25.4/src/redis/commands/mod.rs.html#131-1968) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.zscan_match) #### fn [zscan\_match](https://docs.rs/redis/0.25.4/redis/commands/trait.Commands.html#method.zscan_match) ( &mut self, key: K, pattern: P, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[Iter](https://docs.rs/redis/0.25.4/redis/cmd/struct.Iter.html "struct redis::cmd::Iter") <'\_, RV>, [RedisError](https://docs.rs/redis/0.25.4/redis/types/struct.RedisError.html "struct redis::types::RedisError") \> where K: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , P: [ToRedisArgs](https://docs.rs/redis/0.25.4/redis/types/trait.ToRedisArgs.html "trait redis::types::ToRedisArgs") , RV: [FromRedisValue](https://docs.rs/redis/0.25.4/redis/types/trait.FromRedisValue.html "trait redis::types::FromRedisValue") , Incrementally iterate sorted set elements for elements matching a pattern. [Source](https://docs.rs/redis/0.25.4/src/redis/connection.rs.html#1273-1276) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-ConnectionLike-for-T) ### impl [ConnectionLike](https://docs.rs/redis/0.25.4/redis/connection/trait.ConnectionLike.html "trait redis::connection::ConnectionLike") for T where C: [ConnectionLike](https://docs.rs/redis/0.25.4/redis/connection/trait.ConnectionLike.html "trait redis::connection::ConnectionLike") , T: [DerefMut](https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html "trait core::ops::deref::DerefMut") , [Source](https://docs.rs/redis/0.25.4/src/redis/connection.rs.html#1278) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.req_packed_command) #### fn [req\_packed\_command](https://docs.rs/redis/0.25.4/redis/connection/trait.ConnectionLike.html#tymethod.req_packed_command) (&mut self, cmd: &\[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \]) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[Value](https://docs.rs/redis/0.25.4/redis/types/enum.Value.html "enum redis::types::Value") , [RedisError](https://docs.rs/redis/0.25.4/redis/types/struct.RedisError.html "struct redis::types::RedisError") \> Sends an already encoded (packed) command into the TCP socket and reads the single response from it. [Source](https://docs.rs/redis/0.25.4/src/redis/connection.rs.html#1282-1287) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.req_packed_commands) #### fn [req\_packed\_commands](https://docs.rs/redis/0.25.4/redis/connection/trait.ConnectionLike.html#tymethod.req_packed_commands) ( &mut self, cmd: &\[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \], offset: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) , count: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[Vec](https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html "struct alloc::vec::Vec") <[Value](https://docs.rs/redis/0.25.4/redis/types/enum.Value.html "enum redis::types::Value") \>, [RedisError](https://docs.rs/redis/0.25.4/redis/types/struct.RedisError.html "struct redis::types::RedisError") \> [Source](https://docs.rs/redis/0.25.4/src/redis/connection.rs.html#1291) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.req_command) #### fn [req\_command](https://docs.rs/redis/0.25.4/redis/connection/trait.ConnectionLike.html#method.req_command) (&mut self, cmd: &[Cmd](https://docs.rs/redis/0.25.4/redis/cmd/struct.Cmd.html "struct redis::cmd::Cmd") ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[Value](https://docs.rs/redis/0.25.4/redis/types/enum.Value.html "enum redis::types::Value") , [RedisError](https://docs.rs/redis/0.25.4/redis/types/struct.RedisError.html "struct redis::types::RedisError") \> Sends a [Cmd](https://docs.rs/redis/0.25.4/redis/cmd/struct.Cmd.html "struct redis::cmd::Cmd") into the TCP socket and reads a single response from it. [Source](https://docs.rs/redis/0.25.4/src/redis/connection.rs.html#1295) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.get_db) #### fn [get\_db](https://docs.rs/redis/0.25.4/redis/connection/trait.ConnectionLike.html#tymethod.get_db) (&self) -> [i64](https://doc.rust-lang.org/nightly/std/primitive.i64.html) Returns the database this connection is bound to. Note that this information might be unreliable because it’s initially cached and also might be incorrect if the connection like object is not actually connected. [Source](https://docs.rs/redis/0.25.4/src/redis/connection.rs.html#1299) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.supports_pipelining) #### fn [supports\_pipelining](https://docs.rs/redis/0.25.4/redis/connection/trait.ConnectionLike.html#method.supports_pipelining) (&self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) [Source](https://docs.rs/redis/0.25.4/src/redis/connection.rs.html#1303) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.check_connection) #### fn [check\_connection](https://docs.rs/redis/0.25.4/redis/connection/trait.ConnectionLike.html#tymethod.check_connection) (&mut self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Check that all connections it has are available (`PING` internally). [Source](https://docs.rs/redis/0.25.4/src/redis/connection.rs.html#1307) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.is_open) #### fn [is\_open](https://docs.rs/redis/0.25.4/redis/connection/trait.ConnectionLike.html#tymethod.is_open) (&self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns the connection status. [Read more](https://docs.rs/redis/0.25.4/redis/connection/trait.ConnectionLike.html#tymethod.is_open) [Source](https://docs.rs/tap/1.0.1/src/tap/conv.rs.html#58) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Conv-for-T) ### impl [Conv](https://docs.rs/tap/1.0.1/tap/conv/trait.Conv.html "trait tap::conv::Conv") for T [Source](https://docs.rs/tap/1.0.1/src/tap/conv.rs.html#49-52) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.conv) #### fn [conv](https://docs.rs/tap/1.0.1/tap/conv/trait.Conv.html#method.conv) (self) -> T where Self: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") , Converts `self` into `T` using `Into`. [Read more](https://docs.rs/tap/1.0.1/tap/conv/trait.Conv.html#method.conv) [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/coproduct.rs.html#1180) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-CoproductSubsetter%3CCNil,+HNil%3E-for-Choices) ### impl [CoproductSubsetter](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/trait.CoproductSubsetter.html "trait frunk_core::coproduct::CoproductSubsetter") <[CNil](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/enum.CNil.html "enum frunk_core::coproduct::CNil") , [HNil](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/struct.HNil.html "struct frunk_core::hlist::HNil") \> for Choices [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/coproduct.rs.html#1181) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.Remainder) #### type [Remainder](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/trait.CoproductSubsetter.html#associatedtype.Remainder) = Choices [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/coproduct.rs.html#1184) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.subset) #### fn [subset](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/trait.CoproductSubsetter.html#tymethod.subset) ( self, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[CNil](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/enum.CNil.html "enum frunk_core::coproduct::CNil") , >::[Remainder](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/trait.CoproductSubsetter.html#associatedtype.Remainder "type frunk_core::coproduct::CoproductSubsetter::Remainder") \> Extract a subset of the possible types in a coproduct (or get the remaining possibilities) [Read more](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/trait.CoproductSubsetter.html#tymethod.subset) [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#114) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-FmtForward-for-T) ### impl [FmtForward](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html "trait wyz::fmt::FmtForward") for T [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#41-42) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.fmt_binary) #### fn [fmt\_binary](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_binary) (self) -> [FmtBinary](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtBinary.html "struct wyz::fmt::FmtBinary") where Self: [Binary](https://doc.rust-lang.org/nightly/core/fmt/trait.Binary.html "trait core::fmt::Binary") , Causes `self` to use its `Binary` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#49-50) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.fmt_display) #### fn [fmt\_display](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_display) (self) -> [FmtDisplay](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtDisplay.html "struct wyz::fmt::FmtDisplay") where Self: [Display](https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html "trait core::fmt::Display") , Causes `self` to use its `Display` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#57-58) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.fmt_lower_exp) #### fn [fmt\_lower\_exp](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_lower_exp) (self) -> [FmtLowerExp](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtLowerExp.html "struct wyz::fmt::FmtLowerExp") where Self: [LowerExp](https://doc.rust-lang.org/nightly/core/fmt/trait.LowerExp.html "trait core::fmt::LowerExp") , Causes `self` to use its `LowerExp` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#65-66) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.fmt_lower_hex) #### fn [fmt\_lower\_hex](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_lower_hex) (self) -> [FmtLowerHex](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtLowerHex.html "struct wyz::fmt::FmtLowerHex") where Self: [LowerHex](https://doc.rust-lang.org/nightly/core/fmt/trait.LowerHex.html "trait core::fmt::LowerHex") , Causes `self` to use its `LowerHex` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#72-73) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.fmt_octal) #### fn [fmt\_octal](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_octal) (self) -> [FmtOctal](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtOctal.html "struct wyz::fmt::FmtOctal") where Self: [Octal](https://doc.rust-lang.org/nightly/core/fmt/trait.Octal.html "trait core::fmt::Octal") , Causes `self` to use its `Octal` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#80-81) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.fmt_pointer) #### fn [fmt\_pointer](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_pointer) (self) -> [FmtPointer](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtPointer.html "struct wyz::fmt::FmtPointer") where Self: [Pointer](https://doc.rust-lang.org/nightly/core/fmt/trait.Pointer.html "trait core::fmt::Pointer") , Causes `self` to use its `Pointer` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#88-89) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.fmt_upper_exp) #### fn [fmt\_upper\_exp](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_upper_exp) (self) -> [FmtUpperExp](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtUpperExp.html "struct wyz::fmt::FmtUpperExp") where Self: [UpperExp](https://doc.rust-lang.org/nightly/core/fmt/trait.UpperExp.html "trait core::fmt::UpperExp") , Causes `self` to use its `UpperExp` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#96-97) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.fmt_upper_hex) #### fn [fmt\_upper\_hex](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_upper_hex) (self) -> [FmtUpperHex](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtUpperHex.html "struct wyz::fmt::FmtUpperHex") where Self: [UpperHex](https://doc.rust-lang.org/nightly/core/fmt/trait.UpperHex.html "trait core::fmt::UpperHex") , Causes `self` to use its `UpperHex` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#108-109) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.fmt_list) #### fn [fmt\_list](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_list) (self) -> [FmtList](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtList.html "struct wyz::fmt::FmtList") where &'a Self: for<'a> [IntoIterator](https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html "trait core::iter::traits::collect::IntoIterator") , Formats each item in a sequence. [Read more](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_list) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-From%3CT%3E-for-T) ### impl [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.from) #### fn [from](https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Into%3CU%3E-for-T) ### impl [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") for T where U: [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.into) #### fn [into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-IntoCollection%3CT%3E-for-T) ### impl IntoCollection for T [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.into_collection) #### fn into\_collection(self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.mapped) #### fn mapped(self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html "trait core::ops::function::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") where F: [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/diesel/2.1.6/src/diesel/expression/mod.rs.html#280) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-IntoSql-for-T) ### impl [IntoSql](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.IntoSql.html "trait rocket_db_pools::diesel::prelude::IntoSql") for T [Source](https://docs.rs/diesel/2.1.6/src/diesel/expression/mod.rs.html#259-262) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.into_sql) #### fn [into\_sql](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.IntoSql.html#method.into_sql) (self) -> Self::[Expression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html#associatedtype.Expression "type diesel::expression::AsExpression::Expression") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") + [AsExpression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html "trait diesel::expression::AsExpression") , T: [SqlType](https://docs.rs/diesel/2.1.6/diesel/sql_types/trait.SqlType.html "trait diesel::sql_types::SqlType") + [TypedExpressionType](https://docs.rs/diesel/2.1.6/diesel/expression/trait.TypedExpressionType.html "trait diesel::expression::TypedExpressionType") , Convert `self` to an expression for Diesel’s query builder. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.IntoSql.html#method.into_sql) [Source](https://docs.rs/diesel/2.1.6/src/diesel/expression/mod.rs.html#271-274) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.as_sql) #### fn [as\_sql](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.IntoSql.html#method.as_sql) <'a, T>(&'a self) -> <&'a Self as [AsExpression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html "trait diesel::expression::AsExpression") >::[Expression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html#associatedtype.Expression "type diesel::expression::AsExpression::Expression") where &'a Self: [AsExpression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html "trait diesel::expression::AsExpression") , T: [SqlType](https://docs.rs/diesel/2.1.6/diesel/sql_types/trait.SqlType.html "trait diesel::sql_types::SqlType") + [TypedExpressionType](https://docs.rs/diesel/2.1.6/diesel/expression/trait.TypedExpressionType.html "trait diesel::expression::TypedExpressionType") , Convert `&self` to an expression for Diesel’s query builder. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.IntoSql.html#method.as_sql) [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/hlist.rs.html#1572-1574) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-LiftInto%3CU,+I%3E-for-T) ### impl [LiftInto](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.LiftInto.html "trait frunk_core::hlist::LiftInto") for T where U: [LiftFrom](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.LiftFrom.html "trait frunk_core::hlist::LiftFrom") , [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/hlist.rs.html#1576) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.lift_into) #### fn [lift\_into](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.LiftInto.html#tymethod.lift_into) (self) -> U Performs the indexed conversion. [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-2) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-3) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-4) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-5) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-6) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-7) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-8) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-9) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-10) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-11) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-12) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-13) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-14) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-15) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-16) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-17) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-18) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-19) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-20) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-21) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-22) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-23) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-24) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-25) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-26) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-27) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-28) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-29) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-30) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-31) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-32) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-33) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-34) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-35) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-36) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-37) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-38) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-39) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-40) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-41) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-42) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-43) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-44) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-45) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-46) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-47) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-48) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-49) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-50) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-51) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-52) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-53) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-54) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-55) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-56) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-57) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-58) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-59) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#example-60) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#234) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Pipe-for-T) ### impl [Pipe](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html "trait tap::pipe::Pipe") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#73-76) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pipe) #### fn [pipe](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (Self) -> R) -> R where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Pipes by value. This is generally the method you want to use. [Read more](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe) [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#97-99) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pipe_ref) #### fn [pipe\_ref](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_ref) <'a, R>(&'a self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&'a Self) -> R) -> R where R: 'a, Borrows `self` and passes that borrow into the pipe function. [Read more](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_ref) [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#122-127) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pipe_ref_mut) #### fn [pipe\_ref\_mut](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_ref_mut) <'a, R>(&'a mut self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&'a mut Self) -> R) -> R where R: 'a, Mutably borrows `self` and passes that borrow into the pipe function. [Read more](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_ref_mut) [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#145-149) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pipe_borrow) #### fn [pipe\_borrow](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_borrow) <'a, B, R>(&'a self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&'a B](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> R) -> R where Self: [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") , B: 'a + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , R: 'a, Borrows `self`, then passes `self.borrow()` into the pipe function. [Read more](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_borrow) [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#169-176) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pipe_borrow_mut) #### fn [pipe\_borrow\_mut](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_borrow_mut) <'a, B, R>( &'a mut self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&'a mut B](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> R, ) -> R where Self: [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") , B: 'a + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , R: 'a, Mutably borrows `self`, then passes `self.borrow_mut()` into the pipe function. [Read more](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_borrow_mut) [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#183-187) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pipe_as_ref) #### fn [pipe\_as\_ref](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_as_ref) <'a, U, R>(&'a self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&'a U](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> R) -> R where Self: [AsRef](https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html "trait core::convert::AsRef") , U: 'a + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , R: 'a, Borrows `self`, then passes `self.as_ref()` into the pipe function. [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#195-202) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pipe_as_mut) #### fn [pipe\_as\_mut](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_as_mut) <'a, U, R>(&'a mut self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&'a mut U](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> R) -> R where Self: [AsMut](https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html "trait core::convert::AsMut") , U: 'a + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , R: 'a, Mutably borrows `self`, then passes `self.as_mut()` into the pipe function. [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#209-213) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pipe_deref) #### fn [pipe\_deref](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_deref) <'a, T, R>(&'a self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&'a T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> R) -> R where Self: [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , T: 'a + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , R: 'a, Borrows `self`, then passes `self.deref()` into the pipe function. [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#221-228) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.pipe_deref_mut) #### fn [pipe\_deref\_mut](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_deref_mut) <'a, T, R>( &'a mut self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&'a mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> R, ) -> R where Self: [DerefMut](https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html "trait core::ops::deref::DerefMut") + [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , T: 'a + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , R: 'a, Mutably borrows `self`, then passes `self.deref_mut()` into the pipe function. [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#194) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Pointable-for-T) ### impl [Pointable](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html "trait crossbeam_epoch::atomic::Pointable") for T [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#195) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedconstant.ALIGN) #### const [ALIGN](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#associatedconstant.ALIGN) : [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) The alignment of pointer. [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#197) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.Init) #### type [Init](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#associatedtype.Init) = T The type for initializers. [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#199) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.init) #### unsafe fn [init](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.init) (init: ::[Init](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#associatedtype.Init "type crossbeam_epoch::atomic::Pointable::Init") ) -> [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) Initializes a with the given initializer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.init) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#203) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.deref-1) #### unsafe fn [deref](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref) <'a>(ptr: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) -> [&'a T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Dereferences the given pointer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#207) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.deref_mut-1) #### unsafe fn [deref\_mut](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref_mut) <'a>(ptr: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) -> [&'a mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably dereferences the given pointer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref_mut) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#211) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.drop) #### unsafe fn [drop](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.drop) (ptr: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) Drops the object pointed to by the given pointer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.drop) [Source](https://doc.rust-lang.org/nightly/src/core/ops/deref.rs.html#378-380) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Receiver-for-P) ### impl [Receiver](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Receiver.html "trait core::ops::deref::Receiver") for P where P: [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/ops/deref.rs.html#382) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.Target-1) #### type [Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Receiver.html#associatedtype.Target) = T 🔬This is a nightly-only experimental API. (`arbitrary_self_types`) The target type on which the method may be called. [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#357) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Rng-for-R) ### impl [Rng](https://rust-random.github.io/rand/rand/rng/trait.Rng.html "trait rand::rng::Rng") for R where R: [RngCore](https://rust-random.github.io/rand/rand_core/trait.RngCore.html "trait rand_core::RngCore") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#95-97) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.random) #### fn [random](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random) (&mut self) -> T where [StandardUniform](https://rust-random.github.io/rand/rand/distr/struct.StandardUniform.html "struct rand::distr::StandardUniform") : [Distribution](https://rust-random.github.io/rand/rand/distr/distribution/trait.Distribution.html "trait rand::distr::distribution::Distribution") , Return a random value via the [`StandardUniform`](https://rust-random.github.io/rand/rand/distr/struct.StandardUniform.html "struct rand::distr::StandardUniform") distribution. [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#120-123) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.random_iter) #### fn [random\_iter](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_iter) (self) -> [Iter](https://rust-random.github.io/rand/rand/distr/distribution/struct.Iter.html "struct rand::distr::distribution::Iter") <[StandardUniform](https://rust-random.github.io/rand/rand/distr/struct.StandardUniform.html "struct rand::distr::StandardUniform") , Self, T> where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [StandardUniform](https://rust-random.github.io/rand/rand/distr/struct.StandardUniform.html "struct rand::distr::StandardUniform") : [Distribution](https://rust-random.github.io/rand/rand/distr/distribution/trait.Distribution.html "trait rand::distr::distribution::Distribution") , Return an iterator over [`random`](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random "method rand::rng::Rng::random::random") variates [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_iter) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#161-164) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.random_range) #### fn [random\_range](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_range) (&mut self, range: R) -> T where T: [SampleUniform](https://rust-random.github.io/rand/rand/distr/uniform/trait.SampleUniform.html "trait rand::distr::uniform::SampleUniform") , R: [SampleRange](https://rust-random.github.io/rand/rand/distr/uniform/trait.SampleRange.html "trait rand::distr::uniform::SampleRange") , Generate a random value in the given range. [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_range) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#191) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.random_bool) #### fn [random\_bool](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_bool) (&mut self, p: [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Return a bool with a probability `p` of being true. [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_bool) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#225) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.random_ratio) #### fn [random\_ratio](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_ratio) (&mut self, numerator: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , denominator: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Return a bool with a probability of `numerator/denominator` of being true. [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_ratio) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#249) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.sample) #### fn [sample](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.sample) (&mut self, distr: D) -> T where D: [Distribution](https://rust-random.github.io/rand/rand/distr/distribution/trait.Distribution.html "trait rand::distr::distribution::Distribution") , Sample a new value, using the given distribution. [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.sample) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#286-289) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.sample_iter) #### fn [sample\_iter](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.sample_iter) (self, distr: D) -> [Iter](https://rust-random.github.io/rand/rand/distr/distribution/struct.Iter.html "struct rand::distr::distribution::Iter") where D: [Distribution](https://rust-random.github.io/rand/rand/distr/distribution/trait.Distribution.html "trait rand::distr::distribution::Distribution") , Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create an iterator that generates values using the given distribution. [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.sample_iter) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#314) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.fill) #### fn [fill](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.fill) (&mut self, dest: [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) where T: [Fill](https://rust-random.github.io/rand/rand/rng/trait.Fill.html "trait rand::rng::Fill") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Fill any type implementing [`Fill`](https://rust-random.github.io/rand/rand/rng/trait.Fill.html "trait rand::rng::Fill") with random data [Read more](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.fill) [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#324-326) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.gen) #### fn [gen](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.gen) (&mut self) -> T where [StandardUniform](https://rust-random.github.io/rand/rand/distr/struct.StandardUniform.html "struct rand::distr::StandardUniform") : [Distribution](https://rust-random.github.io/rand/rand/distr/distribution/trait.Distribution.html "trait rand::distr::distribution::Distribution") , 👎Deprecated since 0.9.0: Renamed to `random` to avoid conflict with the new `gen` keyword in Rust 2024. Alias for [`Rng::random`](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random "method rand::rng::Rng::random") . [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#334-337) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.gen_range) #### fn [gen\_range](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.gen_range) (&mut self, range: R) -> T where T: [SampleUniform](https://rust-random.github.io/rand/rand/distr/uniform/trait.SampleUniform.html "trait rand::distr::uniform::SampleUniform") , R: [SampleRange](https://rust-random.github.io/rand/rand/distr/uniform/trait.SampleRange.html "trait rand::distr::uniform::SampleRange") , 👎Deprecated since 0.9.0: Renamed to `random_range` Alias for [`Rng::random_range`](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_range "method rand::rng::Rng::random_range") . [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#345) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.gen_bool) #### fn [gen\_bool](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.gen_bool) (&mut self, p: [f64](https://doc.rust-lang.org/nightly/std/primitive.f64.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) 👎Deprecated since 0.9.0: Renamed to `random_bool` Alias for [`Rng::random_bool`](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_bool "method rand::rng::Rng::random_bool") . [Source](https://rust-random.github.io/rand/src/rand/rng.rs.html#352) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.gen_ratio) #### fn [gen\_ratio](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.gen_ratio) (&mut self, numerator: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , denominator: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) 👎Deprecated since 0.9.0: Renamed to `random_ratio` Alias for [`Rng::random_ratio`](https://rust-random.github.io/rand/rand/rng/trait.Rng.html#method.random_ratio "method rand::rng::Rng::random_ratio") . [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#158-160) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-RngCore-for-T) ### impl [RngCore](https://rust-random.github.io/rand/rand_core/trait.RngCore.html "trait rand_core::RngCore") for T where T: [DerefMut](https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html "trait core::ops::deref::DerefMut") , ::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") : [RngCore](https://rust-random.github.io/rand/rand_core/trait.RngCore.html "trait rand_core::RngCore") , [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#163) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.next_u32) #### fn [next\_u32](https://rust-random.github.io/rand/rand_core/trait.RngCore.html#tymethod.next_u32) (&mut self) -> [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) Return the next random `u32`. [Read more](https://rust-random.github.io/rand/rand_core/trait.RngCore.html#tymethod.next_u32) [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#168) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.next_u64) #### fn [next\_u64](https://rust-random.github.io/rand/rand_core/trait.RngCore.html#tymethod.next_u64) (&mut self) -> [u64](https://doc.rust-lang.org/nightly/std/primitive.u64.html) Return the next random `u64`. [Read more](https://rust-random.github.io/rand/rand_core/trait.RngCore.html#tymethod.next_u64) [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#173) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.fill_bytes) #### fn [fill\_bytes](https://rust-random.github.io/rand/rand_core/trait.RngCore.html#tymethod.fill_bytes) (&mut self, dst: &mut \[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \]) Fill `dest` with random data. [Read more](https://rust-random.github.io/rand/rand_core/trait.RngCore.html#tymethod.fill_bytes) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#640) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-RunQueryDsl%3CConn%3E-for-T) ### impl [RunQueryDsl](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html "trait rocket_db_pools::diesel::prelude::RunQueryDsl") for T [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#219-222) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.execute) #### fn [execute](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.execute) <'conn, 'query>( self, conn: [&'conn mut Conn](https://doc.rust-lang.org/nightly/std/primitive.reference.html) , ) -> ::[ExecuteFuture](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.ExecuteFuture "type rocket_db_pools::diesel::prelude::AsyncConnection::ExecuteFuture") <'conn, 'query> where Conn: [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , Self: [ExecuteDsl](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.ExecuteDsl.html "trait diesel_async::run_query_dsl::methods::ExecuteDsl") + 'query, Executes the given command, returning the number of rows affected. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.execute) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#331-338) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.load) #### fn [load](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.load) <'query, 'conn, U>( self, conn: [&'conn mut Conn](https://doc.rust-lang.org/nightly/std/primitive.reference.html) , ) -> [AndThen](https://docs.rs/futures-util/0.3.31/futures_util/future/try_future/struct.AndThen.html "struct futures_util::future::try_future::AndThen") , [TryCollect](https://docs.rs/futures-util/0.3.31/futures_util/stream/try_stream/try_collect/struct.TryCollect.html "struct futures_util::stream::try_stream::try_collect::TryCollect") , [Vec](https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html "struct alloc::vec::Vec") >, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (Self::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>) -> [TryCollect](https://docs.rs/futures-util/0.3.31/futures_util/stream/try_stream/try_collect/struct.TryCollect.html "struct futures_util::stream::try_stream::try_collect::TryCollect") , [Vec](https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html "struct alloc::vec::Vec") >> where U: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , Conn: [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") , Self: [LoadQuery](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html "trait diesel_async::run_query_dsl::methods::LoadQuery") <'query, Conn, U> + 'query, Executes the given query, returning a [`Vec`](https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html "struct alloc::vec::Vec") with the returned rows. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.load) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#473-477) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.load_stream) #### fn [load\_stream](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.load_stream) <'conn, 'query, U>( self, conn: [&'conn mut Conn](https://doc.rust-lang.org/nightly/std/primitive.reference.html) , ) -> Self::[LoadFuture](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.LoadFuture "type diesel_async::run_query_dsl::methods::LoadQuery::LoadFuture") <'conn> where Conn: [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") , U: 'conn, Self: [LoadQuery](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html "trait diesel_async::run_query_dsl::methods::LoadQuery") <'query, Conn, U> + 'query, Executes the given query, returning a [`Stream`](https://docs.rs/futures-core/0.3.31/futures_core/stream/trait.Stream.html "trait futures_core::stream::Stream") with the returned rows. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.load_stream) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#532-539) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.get_result) #### fn [get\_result](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.get_result) <'query, 'conn, U>( self, conn: [&'conn mut Conn](https://doc.rust-lang.org/nightly/std/primitive.reference.html) , ) -> [AndThen](https://docs.rs/futures-util/0.3.31/futures_util/future/try_future/struct.AndThen.html "struct futures_util::future::try_future::AndThen") , [Map](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.Map.html "struct futures_util::future::future::Map") <[StreamFuture](https://docs.rs/futures-util/0.3.31/futures_util/stream/stream/into_future/struct.StreamFuture.html "struct futures_util::stream::stream::into_future::StreamFuture") <[Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") >>>, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (([Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <[Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >, [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") >>)) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (Self::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>) -> [Map](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.Map.html "struct futures_util::future::future::Map") <[StreamFuture](https://docs.rs/futures-util/0.3.31/futures_util/stream/stream/into_future/struct.StreamFuture.html "struct futures_util::stream::stream::into_future::StreamFuture") <[Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") >>>, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (([Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <[Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >, [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") >>)) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >> where U: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'conn, Conn: [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") , Self: [LoadQuery](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html "trait diesel_async::run_query_dsl::methods::LoadQuery") <'query, Conn, U> + 'query, Runs the command, and returns the affected row. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.get_result) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#572-579) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.get_results) #### fn [get\_results](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.get_results) <'query, 'conn, U>( self, conn: [&'conn mut Conn](https://doc.rust-lang.org/nightly/std/primitive.reference.html) , ) -> [AndThen](https://docs.rs/futures-util/0.3.31/futures_util/future/try_future/struct.AndThen.html "struct futures_util::future::try_future::AndThen") , [TryCollect](https://docs.rs/futures-util/0.3.31/futures_util/stream/try_stream/try_collect/struct.TryCollect.html "struct futures_util::stream::try_stream::try_collect::TryCollect") , [Vec](https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html "struct alloc::vec::Vec") >, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (Self::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>) -> [TryCollect](https://docs.rs/futures-util/0.3.31/futures_util/stream/try_stream/try_collect/struct.TryCollect.html "struct futures_util::stream::try_stream::try_collect::TryCollect") , [Vec](https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html "struct alloc::vec::Vec") >> where U: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , Conn: [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") , Self: [LoadQuery](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html "trait diesel_async::run_query_dsl::methods::LoadQuery") <'query, Conn, U> + 'query, Runs the command, returning an `Vec` with the affected rows. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.get_results) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#626-634) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.first) #### fn [first](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.first) <'query, 'conn, U>( self, conn: [&'conn mut Conn](https://doc.rust-lang.org/nightly/std/primitive.reference.html) , ) -> [AndThen](https://docs.rs/futures-util/0.3.31/futures_util/future/try_future/struct.AndThen.html "struct futures_util::future::try_future::AndThen") <>::[LoadFuture](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.LoadFuture "type diesel_async::run_query_dsl::methods::LoadQuery::LoadFuture") <'conn>, [Map](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.Map.html "struct futures_util::future::future::Map") <[StreamFuture](https://docs.rs/futures-util/0.3.31/futures_util/stream/stream/into_future/struct.StreamFuture.html "struct futures_util::stream::stream::into_future::StreamFuture") <[Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") <>::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>>>>, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (([Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <[Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >, [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") <>::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>>>)) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (>::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>) -> [Map](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.Map.html "struct futures_util::future::future::Map") <[StreamFuture](https://docs.rs/futures-util/0.3.31/futures_util/stream/stream/into_future/struct.StreamFuture.html "struct futures_util::stream::stream::into_future::StreamFuture") <[Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") <>::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>>>>, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (([Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <[Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >, [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") <>::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>>>)) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >> where U: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'conn, Conn: [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") , Self: [LimitDsl](https://docs.rs/diesel/2.1.6/diesel/query_dsl/limit_dsl/trait.LimitDsl.html "trait diesel::query_dsl::limit_dsl::LimitDsl") , Self::[Output](https://docs.rs/diesel/2.1.6/diesel/query_dsl/limit_dsl/trait.LimitDsl.html#associatedtype.Output "type diesel::query_dsl::limit_dsl::LimitDsl::Output") : [LoadQuery](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html "trait diesel_async::run_query_dsl::methods::LoadQuery") <'query, Conn, U> + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'query, Attempts to load a single record. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.first) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/hlist.rs.html#991) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Sculptor%3CHNil,+HNil%3E-for-Source) ### impl [Sculptor](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.Sculptor.html "trait frunk_core::hlist::Sculptor") <[HNil](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/struct.HNil.html "struct frunk_core::hlist::HNil") , [HNil](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/struct.HNil.html "struct frunk_core::hlist::HNil") \> for Source [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/hlist.rs.html#992) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.Remainder-1) #### type [Remainder](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.Sculptor.html#associatedtype.Remainder) = Source [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/hlist.rs.html#995) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.sculpt) #### fn [sculpt](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.Sculptor.html#tymethod.sculpt) (self) -> ([HNil](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/struct.HNil.html "struct frunk_core::hlist::HNil") , >::[Remainder](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.Sculptor.html#associatedtype.Remainder "type frunk_core::hlist::Sculptor::Remainder") ) Consumes the current HList and returns an HList with the requested shape. [Read more](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.Sculptor.html#tymethod.sculpt) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#329) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Tap-for-T) ### impl [Tap](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html "trait tap::tap::Tap") for T [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#78) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap) #### fn [tap](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&Self)) -> Self Immutable access to a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_mut) #### fn [tap\_mut](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_mut) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&mut Self)) -> Self Mutable access to a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_mut) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#129-132) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_borrow) #### fn [tap\_borrow](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_borrow) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&B](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") , B: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Immutable access to the `Borrow` of a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_borrow) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#146-149) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_borrow_mut) #### fn [tap\_borrow\_mut](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_borrow_mut) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&mut B](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") , B: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Mutable access to the `BorrowMut` of a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_borrow_mut) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#163-166) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_ref) #### fn [tap\_ref](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_ref) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&R](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [AsRef](https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html "trait core::convert::AsRef") , R: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Immutable access to the `AsRef` view of a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_ref) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#180-183) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_ref_mut) #### fn [tap\_ref\_mut](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_ref_mut) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&mut R](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [AsMut](https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html "trait core::convert::AsMut") , R: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Mutable access to the `AsMut` view of a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_ref_mut) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#197-200) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_deref) #### fn [tap\_deref](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_deref) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Immutable access to the `Deref::Target` of a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_deref) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#214-217) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_deref_mut) #### fn [tap\_deref\_mut](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_deref_mut) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [DerefMut](https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html "trait core::ops::deref::DerefMut") + [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Mutable access to the `Deref::Target` of a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_deref_mut) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#227) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_dbg) #### fn [tap\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&Self)) -> Self Calls `.tap()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#237) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_mut_dbg) #### fn [tap\_mut\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_mut_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&mut Self)) -> Self Calls `.tap_mut()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#247-250) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_borrow_dbg) #### fn [tap\_borrow\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_borrow_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&B](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") , B: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Calls `.tap_borrow()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#261-264) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_borrow_mut_dbg) #### fn [tap\_borrow\_mut\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_borrow_mut_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&mut B](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") , B: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Calls `.tap_borrow_mut()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#275-278) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_ref_dbg) #### fn [tap\_ref\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_ref_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&R](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [AsRef](https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html "trait core::convert::AsRef") , R: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Calls `.tap_ref()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#289-292) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_ref_mut_dbg) #### fn [tap\_ref\_mut\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_ref_mut_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&mut R](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [AsMut](https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html "trait core::convert::AsMut") , R: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Calls `.tap_ref_mut()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#303-306) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_deref_dbg) #### fn [tap\_deref\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_deref_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Calls `.tap_deref()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#317-320) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.tap_deref_mut_dbg) #### fn [tap\_deref\_mut\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_deref_mut_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [DerefMut](https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html "trait core::ops::deref::DerefMut") + [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Calls `.tap_deref_mut()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/conv.rs.html#87) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-TryConv-for-T) ### impl [TryConv](https://docs.rs/tap/1.0.1/tap/conv/trait.TryConv.html "trait tap::conv::TryConv") for T [Source](https://docs.rs/tap/1.0.1/src/tap/conv.rs.html#78-81) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.try_conv) #### fn [try\_conv](https://docs.rs/tap/1.0.1/tap/conv/trait.TryConv.html#method.try_conv) (self) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where Self: [TryInto](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html "trait core::convert::TryInto") , Attempts to convert `self` into `T` using `TryInto`. [Read more](https://docs.rs/tap/1.0.1/tap/conv/trait.TryConv.html#method.try_conv) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") for T where U: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.Error-2) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.try_from) #### fn [try\_from](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html "trait core::convert::TryInto") for T where U: [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.Error-1) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.try_into) #### fn [try\_into](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#257) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-TryRngCore-for-R) ### impl [TryRngCore](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html "trait rand_core::TryRngCore") for R where R: [RngCore](https://rust-random.github.io/rand/rand_core/trait.RngCore.html "trait rand_core::RngCore") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#258) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#associatedtype.Error-3) #### type [Error](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#associatedtype.Error) = [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") The type returned in the event of a RNG error. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#261) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.try_next_u32) #### fn [try\_next\_u32](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#tymethod.try_next_u32) (&mut self) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ::[Error](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#associatedtype.Error "type rand_core::TryRngCore::Error") \> Return the next random `u32`. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#266) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.try_next_u64) #### fn [try\_next\_u64](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#tymethod.try_next_u64) (&mut self) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[u64](https://doc.rust-lang.org/nightly/std/primitive.u64.html) , ::[Error](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#associatedtype.Error "type rand_core::TryRngCore::Error") \> Return the next random `u64`. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#271) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.try_fill_bytes) #### fn [try\_fill\_bytes](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#tymethod.try_fill_bytes) ( &mut self, dst: &mut \[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \], ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[()](https://doc.rust-lang.org/nightly/std/primitive.unit.html) , ::[Error](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#associatedtype.Error "type rand_core::TryRngCore::Error") \> Fill `dest` entirely with random data. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#232-234) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.unwrap_err) #### fn [unwrap\_err](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#method.unwrap_err) (self) -> [UnwrapErr](https://rust-random.github.io/rand/rand_core/struct.UnwrapErr.html "struct rand_core::UnwrapErr") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Wrap RNG with the [`UnwrapErr`](https://rust-random.github.io/rand/rand_core/struct.UnwrapErr.html "struct rand_core::UnwrapErr") wrapper. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#240) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.unwrap_mut) #### fn [unwrap\_mut](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#method.unwrap_mut) (&mut self) -> [UnwrapMut](https://rust-random.github.io/rand/rand_core/struct.UnwrapMut.html "struct rand_core::UnwrapMut") <'\_, Self> Wrap RNG with the [`UnwrapMut`](https://rust-random.github.io/rand/rand_core/struct.UnwrapMut.html "struct rand_core::UnwrapMut") wrapper. [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#246-248) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.read_adapter) #### fn [read\_adapter](https://rust-random.github.io/rand/rand_core/trait.TryRngCore.html#method.read_adapter) (&mut self) -> [RngReadAdapter](https://rust-random.github.io/rand/rand_core/struct.RngReadAdapter.html "struct rand_core::RngReadAdapter") <'\_, Self> where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Convert an [`RngCore`](https://rust-random.github.io/rand/rand_core/trait.RngCore.html "trait rand_core::RngCore") to a [`RngReadAdapter`](https://rust-random.github.io/rand/rand_core/struct.RngReadAdapter.html "struct rand_core::RngReadAdapter") . [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#277-281) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-UpdateAndFetchResults%3CChanges,+Output%3E-for-Conn) ### impl [UpdateAndFetchResults](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/trait.UpdateAndFetchResults.html "trait diesel_async::run_query_dsl::UpdateAndFetchResults") for Conn where Conn: [DerefMut](https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html "trait core::ops::deref::DerefMut") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , Changes: [Identifiable](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.Identifiable.html "trait rocket_db_pools::diesel::prelude::Identifiable") + [HasTable](https://docs.rs/diesel/2.1.6/diesel/associations/trait.HasTable.html "trait diesel::associations::HasTable") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , ::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") : [UpdateAndFetchResults](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/trait.UpdateAndFetchResults.html "trait diesel_async::run_query_dsl::UpdateAndFetchResults") , [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pooled_connection/mod.rs.html#276) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.update_and_fetch) #### fn [update\_and\_fetch](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/trait.UpdateAndFetchResults.html#tymethod.update_and_fetch) <'life0, 'async\_trait>( &'life0 mut self, changeset: Changes, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where 'life0: 'async\_trait, Changes: 'async\_trait, Conn: 'async\_trait, See the traits documentation. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#206) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-CryptoRng-for-T) ### impl [CryptoRng](https://rust-random.github.io/rand/rand_core/trait.CryptoRng.html "trait rand_core::CryptoRng") for T where T: [DerefMut](https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html "trait core::ops::deref::DerefMut") , ::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") : [CryptoRng](https://rust-random.github.io/rand/rand_core/trait.CryptoRng.html "trait rand_core::CryptoRng") , [Source](https://docs.rs/time/0.3.44/src/time/formatting/formattable.rs.html#33) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Formattable-for-T) ### impl [Formattable](https://docs.rs/time/0.3.44/time/formatting/formattable/trait.Formattable.html "trait time::formatting::formattable::Formattable") for T where T: [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , ::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") : [Formattable](https://docs.rs/time/0.3.44/time/formatting/formattable/trait.Formattable.html "trait time::formatting::formattable::Formattable") , [Source](https://docs.rs/time/0.3.44/src/time/parsing/parsable.rs.html#30) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-Parsable-for-T) ### impl [Parsable](https://docs.rs/time/0.3.44/time/parsing/parsable/trait.Parsable.html "trait time::parsing::parsable::Parsable") for T where T: [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , ::[Target](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target "type core::ops::deref::Deref::Target") : [Parsable](https://docs.rs/time/0.3.44/time/parsing/parsable/trait.Parsable.html "trait time::parsing::parsable::Parsable") , [Source](https://rust-random.github.io/rand/src/rand_core/lib.rs.html#293) [§](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Connection#impl-TryCryptoRng-for-R) ### impl [TryCryptoRng](https://rust-random.github.io/rand/rand_core/trait.TryCryptoRng.html "trait rand_core::TryCryptoRng") for R where R: [CryptoRng](https://rust-random.github.io/rand/rand_core/trait.CryptoRng.html "trait rand_core::CryptoRng") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , --- # WebSocket in rocket_ws - Rust [WebSocket](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#) -------------------------------------------------------------------- [rocket\_ws](https://api.rocket.rs/v0.5/rocket_ws/index.html) Struct WebSocket Copy item path =============================== [Source](https://api.rocket.rs/v0.5/src/rocket_ws/websocket.rs.html#34-37) pub struct WebSocket { /* private fields */ } Expand description A request guard identifying WebSocket requests. Converts into a [`Channel`](https://api.rocket.rs/v0.5/rocket_ws/struct.Channel.html "struct rocket_ws::Channel") or [`MessageStream`](https://api.rocket.rs/v0.5/rocket_ws/stream/struct.MessageStream.html "struct rocket_ws::stream::MessageStream") . For example usage, see the [crate docs](https://api.rocket.rs/v0.5/rocket_ws/index.html#usage "mod rocket_ws") . ### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#details) Details This is the entrypoint to the library. Every WebSocket response _must_ initiate via the `WebSocket` request guard. The guard identifies valid WebSocket connection requests and, if the request is valid, succeeds to be converted into a streaming WebSocket response via [`Stream!`](https://api.rocket.rs/v0.5/rocket_ws/macro.Stream.html "macro rocket_ws::Stream") , [`WebSocket::channel()`](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html#method.channel "method rocket_ws::WebSocket::channel") , or [`WebSocket::stream()`](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html#method.stream "method rocket_ws::WebSocket::stream") . The connection can be configured via [`WebSocket::config()`](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html#method.config "method rocket_ws::WebSocket::config") ; see [`Config`](https://api.rocket.rs/v0.5/rocket_ws/struct.Config.html "struct rocket_ws::Config") for details on configuring a connection. #### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#forwarding) Forwarding If the incoming request is not a valid WebSocket request, the guard forwards with a status of `BadRequest`. The guard never fails. Implementations[§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#implementations) ------------------------------------------------------------------------------------------ [Source](https://api.rocket.rs/v0.5/src/rocket_ws/websocket.rs.html#39-195) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-WebSocket) ### impl [WebSocket](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html "struct rocket_ws::WebSocket") [Source](https://api.rocket.rs/v0.5/src/rocket_ws/websocket.rs.html#66-69) #### pub fn [config](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.config) (self, config: [Config](https://api.rocket.rs/v0.5/rocket_ws/struct.Config.html "struct rocket_ws::Config") ) -> Self Change the default connection configuration to `config`. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example) Example #[get("/echo")] fn echo_stream(ws: ws::WebSocket) -> ws::Stream!['static] { let ws = ws.config(ws::Config { max_send_queue: Some(5), ..Default::default() }); ws::Stream! { ws => for await message in ws { yield message?; } } } [Source](https://api.rocket.rs/v0.5/src/rocket_ws/websocket.rs.html#117-121) #### pub fn [channel](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.channel) <'r, F>(self, handler: F) -> [Channel](https://api.rocket.rs/v0.5/rocket_ws/struct.Channel.html "struct rocket_ws::Channel") <'r> where F: [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([DuplexStream](https://api.rocket.rs/v0.5/rocket_ws/stream/struct.DuplexStream.html "struct rocket_ws::stream::DuplexStream") ) -> [BoxFuture](https://docs.rs/futures-core/0.3.31/futures_core/future/type.BoxFuture.html "type futures_core::future::BoxFuture") <'r, [Result](https://api.rocket.rs/v0.5/rocket_ws/result/type.Result.html "type rocket_ws::result::Result") <[()](https://doc.rust-lang.org/nightly/std/primitive.unit.html) \>> + 'r + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , Create a read/write channel to the client and call `handler` with it. This method takes a `FnOnce`, `handler`, that consumes a read/write WebSocket channel, [`DuplexStream`](https://api.rocket.rs/v0.5/rocket_ws/stream/struct.DuplexStream.html "struct rocket_ws::stream::DuplexStream") to the client. See [`DuplexStream`](https://api.rocket.rs/v0.5/rocket_ws/stream/struct.DuplexStream.html "struct rocket_ws::stream::DuplexStream") for details on how to make use of the channel. The `handler` must return a `Box`ed and `Pin`ned future: calling [`Box::pin()`](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html#method.pin "associated function alloc::boxed::Box::pin") with a future does just this as is the preferred mechanism to create a `Box>`. The future must return a [`Result<()>`](https://api.rocket.rs/v0.5/rocket_ws/result/type.Result.html "type rocket_ws::result::Result") . The WebSocket connection is closed successfully if the future returns `Ok` and with an error if the future returns `Err`. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#lifetimes) Lifetimes The `Channel` may borrow from the request. If it does, the lifetime should be specified as something other than `'static`. Otherwise, the `'static` lifetime should be used. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-1) Example use rocket::futures::{SinkExt, StreamExt}; #[get("/hello/")] fn hello(ws: ws::WebSocket, name: &str) -> ws::Channel<'_> { ws.channel(move |mut stream| Box::pin(async move { let message = format!("Hello, {}!", name); let _ = stream.send(message.into()).await; Ok(()) })) } #[get("/echo")] fn echo(ws: ws::WebSocket) -> ws::Channel<'static> { ws.channel(move |mut stream| Box::pin(async move { while let Some(message) = stream.next().await { let _ = stream.send(message?).await; } Ok(()) })) } [Source](https://api.rocket.rs/v0.5/src/rocket_ws/websocket.rs.html#157-162) #### pub fn [stream](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.stream) <'r, F, S>(self, stream: F) -> [MessageStream](https://api.rocket.rs/v0.5/rocket_ws/stream/struct.MessageStream.html "struct rocket_ws::stream::MessageStream") <'r, S> where F: [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([SplitStream](https://docs.rs/futures-util/0.3.31/futures_util/stream/stream/split/struct.SplitStream.html "struct futures_util::stream::stream::split::SplitStream") <[DuplexStream](https://api.rocket.rs/v0.5/rocket_ws/stream/struct.DuplexStream.html "struct rocket_ws::stream::DuplexStream") \>) -> S + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'r, S: [Stream](https://docs.rs/futures-core/0.3.31/futures_core/stream/trait.Stream.html "trait futures_core::stream::Stream") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'r, Create a stream that consumes client [`Message`](https://api.rocket.rs/v0.5/rocket_ws/enum.Message.html "enum rocket_ws::Message") s and emits its own. This method takes a `FnOnce` `stream` that consumes a read-only stream and returns a stream of [`Message`](https://api.rocket.rs/v0.5/rocket_ws/enum.Message.html "enum rocket_ws::Message") s. While the returned stream can be constructed in any manner, the [`Stream!`](https://api.rocket.rs/v0.5/rocket_ws/macro.Stream.html "macro rocket_ws::Stream") macro is the preferred method. In any case, the stream must be `Send`. The returned stream must emit items of type `Result`. Items that are `Ok(Message)` are sent to the client while items of type `Err(Error)` result in the connection being closed and the remainder of the stream discarded. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-2) Example // Use `Stream!`, which internally calls `WebSocket::stream()`. #[get("/echo?stream")] fn echo_stream(ws: ws::WebSocket) -> ws::Stream!['static] { ws::Stream! { ws => for await message in ws { yield message?; } } } // Use a raw stream. #[get("/echo?compose")] fn echo_compose(ws: ws::WebSocket) -> ws::Stream!['static] { ws.stream(|io| io) } [Source](https://api.rocket.rs/v0.5/src/rocket_ws/websocket.rs.html#191-193) #### pub fn [accept\_key](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.accept_key) (&self) -> &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) Returns the server’s fully computed and encoded WebSocket handshake accept key. > The server takes the value of the `Sec-WebSocket-Key` sent in the handshake request, appends `258EAFA5-E914-47DA-95CA-C5AB0DC85B11`, SHA-1 of the new value, and is then base64 encoded. > > – [`Sec-WebSocket-Accept`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-WebSocket-Accept) This is the value returned via the [`Sec-WebSocket-Accept`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-WebSocket-Accept) header during the acceptance response. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-3) Example #[get("/echo")] fn echo_stream(ws: ws::WebSocket) -> ws::Stream!['static] { let accept_key = ws.accept_key(); ws.stream(|io| io) } Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#trait-implementations) ------------------------------------------------------------------------------------------------------ [Source](https://api.rocket.rs/v0.5/src/rocket_ws/websocket.rs.html#220-241) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-FromRequest%3C'r%3E-for-WebSocket) ### impl<'r> [FromRequest](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html "trait rocket::request::from_request::FromRequest") <'r> for [WebSocket](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html "struct rocket_ws::WebSocket") [Source](https://api.rocket.rs/v0.5/src/rocket_ws/websocket.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html#associatedtype.Error) = [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") The associated error to be returned if derivation fails. [Source](https://api.rocket.rs/v0.5/src/rocket_ws/websocket.rs.html#223-240) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.from_request) #### fn [from\_request](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request) <'life0, 'async\_trait>( req: &'r [Request](https://api.rocket.rs/v0.5/rocket/request/request/struct.Request.html "struct rocket::request::request::Request") <'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'r: 'async\_trait, 'life0: 'async\_trait, Derives an instance of `Self` from the incoming request metadata. [Read more](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request) Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#synthetic-implementations) --------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-Freeze-for-WebSocket) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [WebSocket](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html "struct rocket_ws::WebSocket") [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-RefUnwindSafe-for-WebSocket) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [WebSocket](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html "struct rocket_ws::WebSocket") [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-Send-for-WebSocket) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [WebSocket](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html "struct rocket_ws::WebSocket") [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-Sync-for-WebSocket) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [WebSocket](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html "struct rocket_ws::WebSocket") [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-Unpin-for-WebSocket) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [WebSocket](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html "struct rocket_ws::WebSocket") [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-UnwindSafe-for-WebSocket) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [WebSocket](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket.html "struct rocket_ws::WebSocket") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#blanket-implementations) ---------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html "trait asn1_rs::traits::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.explicit) #### fn [explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Explicit.html "enum asn1_rs::asn1_types::tagged::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html "trait asn1_rs::traits::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.implicit) #### fn [implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Implicit.html "enum asn1_rs::asn1_types::tagged::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-From%3CT%3E-for-T) ### impl [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.from) #### fn [from](https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-Into%3CU%3E-for-T) ### impl [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") for T where U: [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.into) #### fn [into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-IntoCollection%3CT%3E-for-T) ### impl IntoCollection for T [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.into_collection) #### fn into\_collection(self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.mapped) #### fn mapped(self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html "trait core::ops::function::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") where F: [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-4) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-5) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-6) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-7) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-8) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-9) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-10) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-11) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-12) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-13) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-14) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-15) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-16) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-17) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-18) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-19) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-20) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-21) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-22) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-23) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-24) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-25) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-26) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-27) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-28) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-29) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-30) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-31) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-32) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-33) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-34) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-35) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-36) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-37) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-38) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-39) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-40) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-41) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-42) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-43) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-44) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-45) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-46) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-47) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-48) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-49) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-50) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-51) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-52) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-53) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-54) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-55) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-56) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-57) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-58) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-59) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-60) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-61) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#example-62) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") for T where U: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#associatedtype.Error-2) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.try_from) #### fn [try\_from](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html "trait core::convert::TryInto") for T where U: [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#associatedtype.Error-1) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.try_into) #### fn [try\_into](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # launch in rocket - Rust [launch](https://api.rocket.rs/v0.5/rocket/attr.launch?search=#) ----------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro launch Copy item path ===================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#478) #[launch] Expand description Generates a `main` function that launches a returned `Rocket`. When applied to a function that returns a `Rocket` instance, `#[launch]` automatically initializes an `async` runtime and launches the function’s returned instance: use rocket::{Rocket, Build}; #[launch] fn rocket() -> Rocket { rocket::build() } This generates code equivalent to the following: #[rocket::main] async fn main() { // Recall that an uninspected `Error` will cause a pretty-printed panic, // so rest assured errors do not go undetected when using `#[launch]`. let _ = rocket().launch().await; } To avoid needing to import _any_ items in the common case, the `launch` attribute will infer a return type written as `_` as `Rocket`: #[launch] fn rocket() -> _ { rocket::build() } The attributed function may be `async`: #[launch] async fn rocket() -> _ { some_async_work().await; rocket::build() } --- # Config in rocket_sync_db_pools - Rust [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#) ------------------------------------------------------------------------- [rocket\_sync\_db\_pools](https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html) Struct Config Copy item path ============================ [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#33-42) pub struct Config { pub url: String, pub pool_size: u32, pub timeout: u8, } Expand description A base `Config` for any `Poolable` type. For the following configuration: [global.databases.my_database] url = "postgres://root:root@localhost/my_database" pool_size = 10 timeout = 5 …`Config::from("my_database", rocket)` would return the following struct: Config { url: "postgres://root:root@localhost/my_database".into(), pool_size: 10, timeout: 5 }; If you want to implement your own custom database adapter (or other database-like struct that can be pooled by `r2d2`) and need some more configurations options, you may need to define a custom `Config` struct. Note, however, that the configuration values in `Config` are required. Fields[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#fields) -------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#structfield.url) `url: [String](https://doc.rust-lang.org/nightly/alloc/string/struct.String.html "struct alloc::string::String") ` Connection URL specified in the Rocket configuration. [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#structfield.pool_size) `pool_size: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ` Initial pool size. Defaults to the number of Rocket workers \* 4. [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#structfield.timeout) `timeout: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ` How long to wait, in seconds, for a new connection before timing out. Defaults to `5`. Implementations[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#implementations) -------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#44-119) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Config) ### impl [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#85-87) #### pub fn [from](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.from) (db\_name: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Build](https://api.rocket.rs/v0.5/rocket/phase/enum.Build.html "enum rocket::phase::Build") \>) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") , [Error](https://docs.rs/figment/0.10.19/figment/error/struct.Error.html "struct figment::error::Error") \> Retrieves the database configuration for the database named `name`. This function is primarily used by the generated code from the `#[database]` attribute. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example) Example // Assume that these are the contents of `Rocket.toml`: [default.databases] my_db = { url = "db/db.sqlite", pool_size = 25 } my_other_db = { url = "mysql://root:root@localhost/database" } use rocket::{Rocket, Build}; use rocket_sync_db_pools::Config; fn pool(rocket: &Rocket) { let config = Config::from("my_db", rocket).unwrap(); assert_eq!(config.url, "db/db.sqlite"); assert_eq!(config.pool_size, 25); let config = Config::from("my_other_db", rocket).unwrap(); assert_eq!(config.url, "mysql://root:root@localhost/database"); let workers = rocket.figment().extract_inner::(rocket::Config::WORKERS); assert_eq!(config.pool_size, (workers.unwrap() * 4)); let config = Config::from("unknown_db", rocket); assert!(config.is_err()) } [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#103-118) #### pub fn [figment](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.figment) (db\_name: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , rocket: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Build](https://api.rocket.rs/v0.5/rocket/phase/enum.Build.html "enum rocket::phase::Build") \>) -> [Figment](https://docs.rs/figment/0.10.19/figment/figment/struct.Figment.html "struct figment::figment::Figment") Returns a `Figment` focused on the configuration for the database with name `db_name`. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-1) Example use rocket::{Rocket, Build}; use rocket_sync_db_pools::Config; fn pool(rocket: &Rocket) { let my_db_figment = Config::figment("my_db", rocket); let mysql_prod_figment = Config::figment("mysql_prod", rocket); } Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#trait-implementations) -------------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#32) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Clone-for-Config) ### impl [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") for [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#32) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.clone) #### fn [clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) (&self) -> [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#245-247) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.clone_from) #### fn [clone\_from](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) (&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#32) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Debug-for-Config) ### impl [Debug](https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html "trait core::fmt::Debug") for [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#32) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.fmt) #### fn [fmt](https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html "struct core::fmt::Formatter") <'\_>) -> [Result](https://doc.rust-lang.org/nightly/core/fmt/type.Result.html "type core::fmt::Result") Formats the value using the given formatter. [Read more](https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#32) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Deserialize%3C'de%3E-for-Config) ### impl<'de> [Deserialize](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserialize.html "trait serde_core::de::Deserialize") <'de> for [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#32) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.deserialize) #### fn [deserialize](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserialize.html#tymethod.deserialize) <\_\_D>(\_\_deserializer: \_\_D) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where \_\_D: [Deserializer](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserializer.html "trait serde_core::de::Deserializer") <'de>, Deserialize this value from the given Serde deserializer. [Read more](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserialize.html#tymethod.deserialize) [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#32) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-PartialEq-for-Config) ### impl [PartialEq](https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html "trait core::cmp::PartialEq") for [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#32) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.eq) #### fn [eq](https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq) (&self, other: &[Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `self` and `other` values to be equal, and is used by `==`. 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#264) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.ne) #### fn [ne](https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne) (&self, other: [&Rhs](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#32) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Serialize-for-Config) ### impl [Serialize](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serialize.html "trait serde_core::ser::Serialize") for [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#32) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.serialize) #### fn [serialize](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serialize.html#tymethod.serialize) <\_\_S>(&self, \_\_serializer: \_\_S) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <\_\_S::[Ok](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serializer.html#associatedtype.Ok "type serde_core::ser::Serializer::Ok") , \_\_S::[Error](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serializer.html#associatedtype.Error "type serde_core::ser::Serializer::Error") \> where \_\_S: [Serializer](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serializer.html "trait serde_core::ser::Serializer") , Serialize this value into the given Serde serializer. [Read more](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serialize.html#tymethod.serialize) [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/config.rs.html#32) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-StructuralPartialEq-for-Config) ### impl [StructuralPartialEq](https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html "trait core::marker::StructuralPartialEq") for [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#synthetic-implementations) ----------------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Freeze-for-Config) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-RefUnwindSafe-for-Config) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Send-for-Config) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Sync-for-Config) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Unpin-for-Config) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-UnwindSafe-for-Config) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Config](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config.html "struct rocket_sync_db_pools::Config") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#blanket-implementations) ------------------------------------------------------------------------------------------------------------------ [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html "trait asn1_rs::traits::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.explicit) #### fn [explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Explicit.html "enum asn1_rs::asn1_types::tagged::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html "trait asn1_rs::traits::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.implicit) #### fn [implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Implicit.html "enum asn1_rs::asn1_types::tagged::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#547) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-CloneToUninit-for-T) ### impl [CloneToUninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html "trait core::clone::CloneToUninit") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#549) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.clone_to_uninit) #### unsafe fn [clone\_to\_uninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) (&self, dest: [\*mut](https://doc.rust-lang.org/nightly/std/primitive.pointer.html) [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) 🔬This is a nightly-only experimental API. (`clone_to_uninit`) Performs copy-assignment from `self` to `dest`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-From%3CT%3E-for-T) ### impl [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.from-1) #### fn [from](https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Into%3CU%3E-for-T) ### impl [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") for T where U: [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.into) #### fn [into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-IntoCollection%3CT%3E-for-T) ### impl IntoCollection for T [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.into_collection) #### fn into\_collection(self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.mapped) #### fn mapped(self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html "trait core::ops::function::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") where F: [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/diesel/2.1.6/src/diesel/expression/mod.rs.html#280) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-IntoSql-for-T) ### impl [IntoSql](https://docs.rs/diesel/2.1.6/diesel/expression/trait.IntoSql.html "trait diesel::expression::IntoSql") for T [Source](https://docs.rs/diesel/2.1.6/src/diesel/expression/mod.rs.html#259-262) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.into_sql) #### fn [into\_sql](https://docs.rs/diesel/2.1.6/diesel/expression/trait.IntoSql.html#method.into_sql) (self) -> Self::[Expression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html#associatedtype.Expression "type diesel::expression::AsExpression::Expression") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") + [AsExpression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html "trait diesel::expression::AsExpression") , T: [SqlType](https://docs.rs/diesel/2.1.6/diesel/sql_types/trait.SqlType.html "trait diesel::sql_types::SqlType") + [TypedExpressionType](https://docs.rs/diesel/2.1.6/diesel/expression/trait.TypedExpressionType.html "trait diesel::expression::TypedExpressionType") , Convert `self` to an expression for Diesel’s query builder. [Read more](https://docs.rs/diesel/2.1.6/diesel/expression/trait.IntoSql.html#method.into_sql) [Source](https://docs.rs/diesel/2.1.6/src/diesel/expression/mod.rs.html#271-274) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.as_sql) #### fn [as\_sql](https://docs.rs/diesel/2.1.6/diesel/expression/trait.IntoSql.html#method.as_sql) <'a, T>(&'a self) -> <&'a Self as [AsExpression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html "trait diesel::expression::AsExpression") >::[Expression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html#associatedtype.Expression "type diesel::expression::AsExpression::Expression") where &'a Self: [AsExpression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html "trait diesel::expression::AsExpression") , T: [SqlType](https://docs.rs/diesel/2.1.6/diesel/sql_types/trait.SqlType.html "trait diesel::sql_types::SqlType") + [TypedExpressionType](https://docs.rs/diesel/2.1.6/diesel/expression/trait.TypedExpressionType.html "trait diesel::expression::TypedExpressionType") , Convert `&self` to an expression for Diesel’s query builder. [Read more](https://docs.rs/diesel/2.1.6/diesel/expression/trait.IntoSql.html#method.as_sql) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-2) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-3) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-4) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-5) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-6) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-7) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-8) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-9) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-10) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-11) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-12) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-13) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-14) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-15) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-16) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-17) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-18) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-19) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-20) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-21) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-22) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-23) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-24) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-25) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-26) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-27) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-28) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-29) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-30) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-31) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-32) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-33) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-34) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-35) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-36) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-37) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-38) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-39) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-40) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-41) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-42) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-43) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-44) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-45) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-46) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-47) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-48) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-49) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-50) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-51) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-52) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-53) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-54) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-55) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-56) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-57) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-58) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-59) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#example-60) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-ToOwned-for-T) ### impl [ToOwned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html "trait alloc::borrow::ToOwned") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#associatedtype.Owned) #### type [Owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned) = T The resulting type after obtaining ownership. [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#90) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.to_owned) #### fn [to\_owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) (&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#94) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.clone_into) #### fn [clone\_into](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) (&self, target: [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) Uses borrowed data to replace owned data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") for T where U: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#associatedtype.Error-1) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.try_from) #### fn [try\_from](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html "trait core::convert::TryInto") for T where U: [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#associatedtype.Error) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.try_into) #### fn [try\_into](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/mod.rs.html#633) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/struct.Config#impl-DeserializeOwned-for-T) ### impl [DeserializeOwned](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.DeserializeOwned.html "trait serde_core::de::DeserializeOwned") for T where T: for<'de> [Deserialize](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserialize.html "trait serde_core::de::Deserialize") <'de>, --- # SecretKey in rocket::config - Rust [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#) ------------------------------------------------------------------------ [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[config](https://api.rocket.rs/v0.5/rocket/config/index.html) Struct SecretKey Copy item path =============================== [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#78-81) pub struct SecretKey { /* private fields */ } Available on **crate feature `secrets`** only. Expand description A cryptographically secure secret key. A `SecretKey` is primarily used by [private cookies](https://rocket.rs/v0.5/guide/requests/#private-cookies) . See the [configuration guide](https://rocket.rs/v0.5/guide/configuration/#secret-key) for further details. It can be configured from 256-bit random material or a 512-bit master key, each as either a base64-encoded string or raw bytes. use rocket::config::Config; // NOTE: Don't (!) use this key! Generate your own and keep it private! // e.g. via `head -c64 /dev/urandom | base64` let figment = Config::figment() .merge(("secret_key", "hPrYyЭRiMyµ5sBB1π+CMæ1køFsåqKvBiQJxBVHQk=")); let config = Config::from(figment); assert!(!config.secret_key.is_zero()); When configured in the debug profile with the `secrets` feature enabled, a key set as `0` is automatically regenerated at launch time from the OS’s random source if available. use rocket::config::Config; use rocket::local::blocking::Client; let figment = Config::figment() .merge(("secret_key", vec![0u8; 64])) .select("debug"); let rocket = rocket::custom(figment); let client = Client::tracked(rocket).expect("okay in debug"); assert!(!client.rocket().config().secret_key.is_zero()); When running in any other profile with the `secrets` feature enabled, providing a key of `0` or not provided a key at all results in an error at launch-time: use rocket::config::Config; use rocket::figment::Profile; use rocket::local::blocking::Client; use rocket::error::ErrorKind; let profile = Profile::const_new("staging"); let figment = Config::figment() .merge(("secret_key", vec![0u8; 64])) .select(profile.clone()); let rocket = rocket::custom(figment); let error = Client::tracked(rocket).expect_err("error in non-debug"); assert!(matches!(error.kind(), ErrorKind::InsecureSecretKey(profile))); Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#implementations) ---------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#83-181) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-SecretKey) ### impl [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#104-106) #### pub fn [from](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.from) (master: &\[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \]) -> [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") Creates a `SecretKey` from a 512-bit `master` key. For security, `master` _must_ be cryptographically random. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#panics) Panics Panics if `master` < 64 bytes. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example) Example use rocket::config::SecretKey; let key = SecretKey::from(&master); [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#123-125) #### pub fn [derive\_from](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.derive_from) (material: &\[[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html)\ \]) -> [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") Derives a `SecretKey` from 256 bits of cryptographically random `material`. For security, `material` _must_ be cryptographically random. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#panics-1) Panics Panics if `material` < 32 bytes. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-1) Example use rocket::config::SecretKey; let key = SecretKey::derive_from(&material); [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#137-139) #### pub fn [generate](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.generate) () -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") \> Attempts to generate a `SecretKey` from randomness retrieved from the OS. If randomness from the OS isn’t available, returns `None`. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-2) Example use rocket::config::SecretKey; let key = SecretKey::generate(); [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#152-154) #### pub fn [is\_zero](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.is_zero) (&self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if `self` is the `0`\-key. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-3) Example use rocket::config::SecretKey; let master = vec![0u8; 64]; let key = SecretKey::from(&master); assert!(key.is_zero()); [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#171-173) #### pub fn [is\_provided](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.is_provided) (&self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if `self` was not automatically generated and is not zero. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-4) Example use rocket::config::SecretKey; let master = vec![0u8; 64]; let key = SecretKey::generate().unwrap(); assert!(!key.is_provided()); let master = vec![0u8; 64]; let key = SecretKey::from(&master); assert!(!key.is_provided()); Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#trait-implementations) ---------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#76) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Clone-for-SecretKey) ### impl [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") for [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#76) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.clone) #### fn [clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) (&self) -> [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#245-247) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.clone_from) #### fn [clone\_from](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) (&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#267-271) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Debug-for-SecretKey) ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") for [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#268-270) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.fmt-1) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#199-252) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Deserialize%3C'de%3E-for-SecretKey) ### impl<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de> for [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#200-251) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.deserialize) #### fn [deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html#tymethod.deserialize) >(de: D) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") Deserialize this value from the given Serde deserializer. [Read more](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html#tymethod.deserialize) [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#254-265) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Display-for-SecretKey) ### impl [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") for [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#255-264) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.fmt) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#191-197) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-FromRequest%3C'r%3E-for-%26SecretKey) ### impl<'r> [FromRequest](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html "trait rocket::request::FromRequest") <'r> for &'r [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#192) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The associated error to be returned if derivation fails. [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#194-196) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.from_request) #### fn [from\_request](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#tymethod.from_request) <'life0, 'async\_trait>( req: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'r: 'async\_trait, 'life0: 'async\_trait, Derives an instance of `Self` from the incoming request metadata. [Read more](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#tymethod.from_request) [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#183-188) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-PartialEq-for-SecretKey) ### impl [PartialEq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::cmp::PartialEq") for [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") [Source](https://api.rocket.rs/v0.5/src/rocket/config/secret_key.rs.html#184-187) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.eq) #### fn [eq](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html#tymethod.eq) (&self, other: &Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `self` and `other` values to be equal, and is used by `==`. 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#264) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.ne) #### fn [ne](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/cmp/trait.PartialEq.html#method.ne) (&self, other: [&Rhs](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#synthetic-implementations) ------------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Freeze-for-SecretKey) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-RefUnwindSafe-for-SecretKey) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Send-for-SecretKey) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Sync-for-SecretKey) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Unpin-for-SecretKey) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-UnwindSafe-for-SecretKey) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [SecretKey](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html "struct rocket::config::SecretKey") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#blanket-implementations) -------------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#547) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-CloneToUninit-for-T) ### impl [CloneToUninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html "trait core::clone::CloneToUninit") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#549) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.clone_to_uninit) #### unsafe fn [clone\_to\_uninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) (&self, dest: [\*mut](https://doc.rust-lang.org/nightly/std/primitive.pointer.html) [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) 🔬This is a nightly-only experimental API. (`clone_to_uninit`) Performs copy-assignment from `self` to `dest`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.from-1) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-5) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-6) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-7) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-8) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-9) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-10) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-11) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-12) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-13) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-14) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-15) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-16) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-17) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-18) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-19) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-20) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-21) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-22) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-23) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-24) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-25) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-26) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-27) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-28) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-29) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-30) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-31) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-32) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-33) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-34) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-35) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-36) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-37) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-38) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-39) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-40) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-41) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-42) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-43) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-44) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-45) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-46) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-47) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-48) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-49) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-50) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-51) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-52) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-53) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-54) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-55) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-56) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-57) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-58) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-59) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-60) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-61) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-62) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#example-63) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-ToOwned-for-T) ### impl [ToOwned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html "trait alloc::borrow::ToOwned") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#associatedtype.Owned) #### type [Owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned) = T The resulting type after obtaining ownership. [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#90) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.to_owned) #### fn [to\_owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) (&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#94) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.clone_into) #### fn [clone\_into](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) (&self, target: [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) Uses borrowed data to replace owned data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2861) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-ToString-for-T) ### impl [ToString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::string::ToString") for T where T: [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2863) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.to_string) #### fn [to\_string](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string) (&self) -> [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") Converts the given value to a `String`. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#associatedtype.Error-2) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) [Source](https://docs.rs/serde_core/1.0.228/src/serde_core/de/mod.rs.html#633) [§](https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey#impl-DeserializeOwned-for-T) ### impl [DeserializeOwned](https://api.rocket.rs/v0.5/rocket/serde/trait.DeserializeOwned.html "trait rocket::serde::DeserializeOwned") for T where T: for<'de> [Deserialize](https://api.rocket.rs/v0.5/rocket/serde/trait.Deserialize.html "trait rocket::serde::Deserialize") <'de>, --- # main in rocket - Rust [main](https://api.rocket.rs/v0.5/rocket/attr.main?search=#) ------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro main Copy item path =================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#419) #[main] Expand description Retrofits `async fn` support in `main` functions. A `main` `async fn` function decorated with `#[rocket::main]` is transformed into a regular `main` function that internally initializes a Rocket-specific tokio runtime and runs the attributed `async fn` inside of it: #[rocket::main] async fn main() -> Result<(), rocket::Error> { let _rocket = rocket::build() .ignite().await? .launch().await?; Ok(()) } It should be used only when the return values of `ignite()` or `launch()` are to be inspected: #[rocket::main] async fn main() -> Result<(), rocket::Error> { let rocket = rocket::build().ignite().await?; println!("Hello, Rocket: {:?}", rocket); let rocket = rocket.launch().await?; println!("Welcome back, Rocket: {:?}", rocket); Ok(()) } For all other cases, use [`#[launch]`](https://api.rocket.rs/v0.5/rocket/launch) instead. The function attributed with `#[rocket::main]` _must_ be `async` and _must_ be called `main`. Violation of either results in a compile-time error. --- # XssFilter in rocket::shield - Rust [XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#) ---------------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[shield](https://api.rocket.rs/v0.5/rocket/shield/index.html) Enum XssFilter Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket/shield/policy.rs.html#388-399) pub enum XssFilter { Disable, Enable, EnableBlock, } Expand description The [X-XSS-Protection](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection) header: filters some forms of reflected [XSS](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting) attacks. Modern browsers do not support or enforce this header. Variants[§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#variants) ------------------------------------------------------------------------------ [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#variant.Disable) ### Disable Disables XSS filtering. [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#variant.Enable) ### Enable Enables XSS filtering. If XSS is detected, the browser will sanitize before rendering the page (_Shield default_). [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#variant.EnableBlock) ### EnableBlock Enables XSS filtering. If XSS is detected, the browser will not render the page. Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#trait-implementations) -------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/shield/policy.rs.html#402-406) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-Default-for-XssFilter) ### impl [Default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html "trait core::default::Default") for [XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html "enum rocket::shield::XssFilter") Defaults to [`XssFilter::Enable`](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html#variant.Enable "variant rocket::shield::XssFilter::Enable") . [Source](https://api.rocket.rs/v0.5/src/rocket/shield/policy.rs.html#403-405) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.default) #### fn [default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default) () -> [XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html "enum rocket::shield::XssFilter") Returns the “default value” for a type. [Read more](https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default) [Source](https://api.rocket.rs/v0.5/src/rocket/shield/policy.rs.html#408-418) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-From%3C%26XssFilter%3E-for-Header%3C'static%3E) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") <&[XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html "enum rocket::shield::XssFilter") \> for [Header](https://api.rocket.rs/v0.5/rocket/http/struct.Header.html "struct rocket::http::Header") <'static> [Source](https://api.rocket.rs/v0.5/src/rocket/shield/policy.rs.html#409-417) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (filter: &[XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html "enum rocket::shield::XssFilter") ) -> Self Converts to this type from the input type. [Source](https://api.rocket.rs/v0.5/src/rocket/shield/policy.rs.html#96) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-Policy-for-XssFilter) ### impl [Policy](https://api.rocket.rs/v0.5/rocket/shield/trait.Policy.html "trait rocket::shield::Policy") for [XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html "enum rocket::shield::XssFilter") [Source](https://api.rocket.rs/v0.5/src/rocket/shield/policy.rs.html#96) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#associatedconstant.NAME) #### const [NAME](https://api.rocket.rs/v0.5/rocket/shield/trait.Policy.html#associatedconstant.NAME) : &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) = "X-XSS-Protection" The actual name of the HTTP header. [Read more](https://api.rocket.rs/v0.5/rocket/shield/trait.Policy.html#associatedconstant.NAME) [Source](https://api.rocket.rs/v0.5/src/rocket/shield/policy.rs.html#96) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.header) #### fn [header](https://api.rocket.rs/v0.5/rocket/shield/trait.Policy.html#tymethod.header) (&self) -> [Header](https://api.rocket.rs/v0.5/rocket/http/struct.Header.html "struct rocket::http::Header") <'static> Returns the [`Header`](https://api.rocket.rs/v0.5/rocket/http/struct.Header.html) to attach to all outgoing responses. [Read more](https://api.rocket.rs/v0.5/rocket/shield/trait.Policy.html#tymethod.header) Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#synthetic-implementations) ----------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-Freeze-for-XssFilter) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html "enum rocket::shield::XssFilter") [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-RefUnwindSafe-for-XssFilter) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html "enum rocket::shield::XssFilter") [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-Send-for-XssFilter) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html "enum rocket::shield::XssFilter") [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-Sync-for-XssFilter) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html "enum rocket::shield::XssFilter") [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-Unpin-for-XssFilter) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html "enum rocket::shield::XssFilter") [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-UnwindSafe-for-XssFilter) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [XssFilter](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter.html "enum rocket::shield::XssFilter") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#blanket-implementations) ------------------------------------------------------------------------------------------------------------ [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.from-1) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-1) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-2) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-3) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-4) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-5) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-6) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-7) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-8) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-9) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-10) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-11) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-12) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-13) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-14) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-15) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-16) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-17) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-18) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-19) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-20) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-21) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-22) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-23) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-24) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-25) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-26) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-27) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-28) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-29) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-30) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-31) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-32) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-33) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-34) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-35) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-36) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-37) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-38) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-39) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-40) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-41) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-42) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-43) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-44) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-45) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-46) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-47) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-48) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-49) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-50) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-51) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-52) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-53) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-54) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-55) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-56) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-57) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#example-58) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/shield/enum.XssFilter#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # async_test in rocket - Rust [async\_test](https://api.rocket.rs/v0.5/rocket/attr.async_test?search=#) -------------------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro async\_test Copy item path ========================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#377) #[async_test] Expand description Retrofits supports for `async fn` in unit tests. Simply decorate a test `async fn` with `#[async_test]` instead of `#[test]`: #[cfg(test)] mod tests { #[async_test] async fn test() { /* .. */ } } The attribute rewrites the function to execute inside of a Rocket-compatible async runtime. --- # FromForm in rocket - Rust [FromForm](https://api.rocket.rs/v0.5/rocket/derive.FromForm?search=#) ----------------------------------------------------------------------- [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Derive Macro FromForm Copy item path ==================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#746) #[derive(FromForm)] { // Attributes available to this derive: #[form] #[field] } Expand description Derive for the [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) trait. The [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) derive can be applied to structures with named or unnamed fields: use rocket::form::FromForm; #[derive(FromForm)] struct MyStruct<'r> { field: usize, #[field(name = "renamed_field")] #[field(name = uncased("RenamedField"))] other: &'r str, #[field(validate = range(1..), default = 3)] r#type: usize, #[field(default = None)] is_nice: bool, } #[derive(FromForm)] #[field(validate = len(6..))] #[field(validate = neq("password"))] struct Password<'r>(&'r str); Each field type is required to implement [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) . The derive generates an implementation of the [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) trait. **Named Fields** If the structure has named fields, the implementation parses a form whose field names match the field names of the structure on which the derive was applied. Each field’s value is parsed with the [`FromForm`](https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html) implementation of the field’s type. The `FromForm` implementation succeeds only when all fields parse successfully or return a default. Errors are collected into a [`form::Errors`](https://api.rocket.rs/v0.5/rocket/form/struct.Errors.html) and returned if non-empty after parsing all fields. **Unnamed Fields** If the structure is a tuple struct, it must have exactly one field. The implementation parses a form exactly when the internal field parses a form _and_ any `#[field]` validations succeed. ### [§](https://api.rocket.rs/v0.5/rocket/derive.FromForm?search=#syntax) Syntax The derive accepts one field attribute: `field`, and one container attribute, `form`, with the following syntax: field := name? default? validate* name := 'name' '=' name_val ','? name_val := '"' FIELD_NAME '"' | 'uncased(' '"' FIELD_NAME '"' ') default := 'default' '=' EXPR ','? | 'default_with' '=' EXPR ','? validate := 'validate' '=' EXPR ','? FIELD_NAME := valid field name, according to the HTML5 spec EXPR := valid expression, as defined by Rust `#[field]` can be applied any number of times on a field. `default` and `default_with` are mutually exclusive: at most _one_ of `default` or `default_with` can be present per field. #[derive(FromForm)] struct MyStruct { #[field(name = uncased("number"))] #[field(default = 42)] field: usize, #[field(name = "renamed_field")] #[field(name = uncased("anotherName"))] #[field(validate = eq("banana"))] #[field(validate = neq("orange"))] other: String } For tuples structs, the `field` attribute can be applied to the structure itself: #[derive(FromForm)] #[field(default = 42, validate = eq(42))] struct Meaning(usize); ### [§](https://api.rocket.rs/v0.5/rocket/derive.FromForm?search=#field-attribute-parameters) Field Attribute Parameters * **`name`** A `name` attribute changes the name to match against when parsing the form field. The value is either an exact string to match against (`"foo"`), or `uncased("foo")`, which causes the match to be case-insensitive but case-preserving. When more than one `name` attribute is applied, the field will match against _any_ of the names. * **`validate = expr`** The validation `expr` is run if the field type parses successfully. The expression must return a value of type `Result<(), form::Errors>`. On `Err`, the errors are added to the thus-far collected errors. If more than one `validate` attribute is applied, _all_ validations are run. * **`default = expr`** If `expr` is not literally `None`, the parameter sets the default value of the field to be `expr.into()`. If `expr` _is_ `None`, the parameter _unsets_ the default value of the field, if any. The expression is only evaluated if the attributed field is missing in the incoming form. Except when `expr` is `None`, `expr` must be of type `T: Into` where `F` is the field’s type. * **`default_with = expr`** The parameter sets the default value of the field to be exactly `expr` which must be of type `Option` where `F` is the field’s type. If the expression evaluates to `None`, there is no default. Otherwise the value wrapped in `Some` is used. The expression is only evaluated if the attributed field is missing in the incoming form. use std::num::NonZeroUsize; #[derive(FromForm)] struct MyForm { // `NonZeroUsize::new()` return an `Option`. #[field(default_with = NonZeroUsize::new(42))] num: NonZeroUsize, } [§](https://api.rocket.rs/v0.5/rocket/derive.FromForm?search=#generics) Generics -------------------------------------------------------------------------------- The derive accepts any number of type generics and at most one lifetime generic. If a type generic is present, the generated implementation will require a bound of `FromForm<'r>` for the field type containing the generic. For example, for a struct `struct Foo(Json)`, the bound `Json: FromForm<'r>` will be added to the generated implementation. use rocket::form::FromForm; use rocket::serde::json::Json; // The bounds `A: FromForm<'r>`, `B: FromForm<'r>` will be required. #[derive(FromForm)] struct FancyForm { first: A, second: B, }; // The bound `Json: FromForm<'r>` will be required. #[derive(FromForm)] struct JsonToken { token: Json, id: usize, } If a lifetime generic is present, it is replaced with `'r` in the generated implementation `impl FromForm<'r>`: // Generates `impl<'r> FromForm<'r> for MyWrapper<'r>`. #[derive(FromForm)] struct MyWrapper<'a>(&'a str); Both type generics and one lifetime generic may be used: use rocket::form::{self, FromForm}; // The bound `form::Result<'r, T>: FromForm<'r>` will be required. #[derive(FromForm)] struct SomeResult<'o, T>(form::Result<'o, T>); The special bounds on `Json` and `Result` are required due to incomplete and incorrect support for lifetime generics in `async` blocks in Rust. See [rust-lang/#64552](https://github.com/rust-lang/rust/issues/64552) for further details. --- # LoadedEntry in rocket::mtls::oid - Rust [LoadedEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#) ------------------------------------------------------------------------------ [rocket](https://api.rocket.rs/v0.5/rocket/index.html) ::[mtls](https://api.rocket.rs/v0.5/rocket/mtls/index.html) ::[oid](https://api.rocket.rs/v0.5/rocket/mtls/oid/index.html) Struct LoadedEntry Copy item path ================================= [Source](https://docs.rs/oid-registry/0.4.0/src/oid_registry/load.rs.html#8) pub struct LoadedEntry { pub name: String, pub oid: String, pub sn: String, pub description: String, } Available on **crate feature `mtls`** only. Expand description Temporary structure, created when reading a file containing OID declarations Fields[§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#fields) -------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#structfield.name) `name: [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") ` Name of the global constant for this entry. If `name` is “”, then no global constant is defined [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#structfield.oid) `oid: [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") ` Textual representation of OID (ex: 2.5.4.3) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#structfield.sn) `sn: [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") ` A short name to describe OID. Should be unique (no check is done) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#structfield.description) `description: [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") ` A description for this entry Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#trait-implementations) -------------------------------------------------------------------------------------------------------------- [Source](https://docs.rs/oid-registry/0.4.0/src/oid_registry/load.rs.html#7) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-Debug-for-LoadedEntry) ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") for [LoadedEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry.html "struct rocket::mtls::oid::LoadedEntry") [Source](https://docs.rs/oid-registry/0.4.0/src/oid_registry/load.rs.html#7) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.fmt) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[()](https://doc.rust-lang.org/nightly/std/primitive.unit.html) , [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Error.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Error") \> Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#synthetic-implementations) ----------------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-Freeze-for-LoadedEntry) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [LoadedEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry.html "struct rocket::mtls::oid::LoadedEntry") [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-RefUnwindSafe-for-LoadedEntry) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [LoadedEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry.html "struct rocket::mtls::oid::LoadedEntry") [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-Send-for-LoadedEntry) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [LoadedEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry.html "struct rocket::mtls::oid::LoadedEntry") [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-Sync-for-LoadedEntry) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [LoadedEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry.html "struct rocket::mtls::oid::LoadedEntry") [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-Unpin-for-LoadedEntry) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [LoadedEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry.html "struct rocket::mtls::oid::LoadedEntry") [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-UnwindSafe-for-LoadedEntry) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [LoadedEntry](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry.html "struct rocket::mtls::oid::LoadedEntry") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#blanket-implementations) ------------------------------------------------------------------------------------------------------------------ [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-1) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-2) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-3) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-4) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-5) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-6) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-7) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-8) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-9) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-10) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-11) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-12) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-13) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-14) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-15) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-16) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-17) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-18) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-19) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-20) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-21) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-22) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-23) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-24) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-25) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-26) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-27) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-28) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-29) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-30) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-31) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-32) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-33) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-34) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-35) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-36) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-37) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-38) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-39) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-40) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-41) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-42) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-43) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-44) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-45) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-46) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-47) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-48) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-49) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-50) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-51) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-52) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-53) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-54) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-55) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-56) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-57) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#example-58) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/mtls/oid/struct.LoadedEntry#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # AsyncPgConnection in rocket_db_pools::diesel - Rust [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#) ------------------------------------------------------------------------------------------------- [rocket\_db\_pools](https://api.rocket.rs/v0.5/rocket_db_pools/index.html) ::[diesel](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/index.html) Struct AsyncPgConnection Copy item path ======================================= [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#100) pub struct AsyncPgConnection { /* private fields */ } Expand description A connection to a PostgreSQL database. Connection URLs should be in the form `postgres://[user[:password]@]host/database_name` Checkout the documentation of the [tokio\_postgres](https://docs.rs/tokio-postgres/0.7.6/tokio_postgres/config/struct.Config.html#url) crate for details about the format This connection supports _pipelined_ requests. Pipelining can improve performance in use cases in which multiple, independent queries need to be executed. In a traditional workflow, each query is sent to the server after the previous query completes. In contrast, pipelining allows the client to send all of the queries to the server up front, minimizing time spent by one side waiting for the other to finish sending data: Sequential Pipelined | Client | Server | | Client | Server | |----------------|-----------------| |----------------|-----------------| | send query 1 | | | send query 1 | | | | process query 1 | | send query 2 | process query 1 | | receive rows 1 | | | send query 3 | process query 2 | | send query 2 | | | receive rows 1 | process query 3 | | | process query 2 | | receive rows 2 | | | receive rows 2 | | | receive rows 3 | | | send query 3 | | | | process query 3 | | receive rows 3 | | In both cases, the PostgreSQL server is executing the queries **sequentially** - pipelining just allows both sides of the connection to work concurrently when possible. Pipelining happens automatically when futures are polled concurrently (for example, by using the futures `join` combinator): use diesel_async::RunQueryDsl; let q1 = diesel::select(1_i32.into_sql::()); let q2 = diesel::select(2_i32.into_sql::()); // construct multiple futures for different queries let f1 = q1.get_result::(conn); let f2 = q2.get_result::(conn); // wait on both results let res = futures_util::try_join!(f1, f2)?; assert_eq!(res.0, 1); assert_eq!(res.1, 2); Implementations[§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#implementations) --------------------------------------------------------------------------------------------------------------- [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#240) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-AsyncPgConnection) ### impl [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#267) #### pub fn [build\_transaction](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.build_transaction) (&mut self) -> [TransactionBuilder](https://docs.rs/diesel-async/0.4.1/diesel_async/pg/transaction_builder/struct.TransactionBuilder.html "struct diesel_async::pg::transaction_builder::TransactionBuilder") <'\_, [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") \> Build a transaction, specifying additional details such as isolation level See [`TransactionBuilder`](https://docs.rs/diesel-async/0.4.1/diesel_async/pg/transaction_builder/struct.TransactionBuilder.html "struct diesel_async::pg::transaction_builder::TransactionBuilder") for more examples. conn.build_transaction() .read_only() .serializable() .deferrable() .run(|conn| async move { Ok(()) }.scope_boxed()) .await [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#272) #### pub async fn [try\_from](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.try_from) ( conn: [Client](https://docs.rs/tokio-postgres/0.7.15/tokio_postgres/client/struct.Client.html "struct tokio_postgres::client::Client") , ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") , [ConnectionError](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/enum.ConnectionError.html "enum rocket_db_pools::diesel::prelude::ConnectionError") \> Construct a new `AsyncPgConnection` instance from an existing [`tokio_postgres::Client`](https://docs.rs/tokio-postgres/0.7.15/tokio_postgres/client/struct.Client.html "struct tokio_postgres::client::Client") [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#286) #### pub fn [cancel\_token](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.cancel_token) (&self) -> [CancelToken](https://docs.rs/tokio-postgres/0.7.15/tokio_postgres/cancel_token/struct.CancelToken.html "struct tokio_postgres::cancel_token::CancelToken") Constructs a cancellation token that can later be used to request cancellation of a query running on the connection associated with this client. Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#trait-implementations) --------------------------------------------------------------------------------------------------------------------------- [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#115) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-AsyncConnection-for-AsyncPgConnection) ### impl [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") for [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#associatedtype.LoadFuture) #### type [LoadFuture](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.LoadFuture) <'conn, 'query> = [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") ::[Stream](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.Stream "type rocket_db_pools::diesel::prelude::AsyncConnection::Stream") <'conn, 'query>, [Error](https://docs.rs/diesel/2.1.6/diesel/result/enum.Error.html "enum diesel::result::Error") \>> + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'query>> The future returned by `AsyncConnection::load` [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#117) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#associatedtype.ExecuteFuture) #### type [ExecuteFuture](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.ExecuteFuture) <'conn, 'query> = [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'query>> The future returned by `AsyncConnection::execute` [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#118) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#associatedtype.Stream) #### type [Stream](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.Stream) <'conn, 'query> = [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") \>> The inner stream returned by `AsyncConnection::load` [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#119) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#associatedtype.Row) #### type [Row](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.Row) <'conn, 'query> = PgRow The row type used by the stream returned by `AsyncConnection::load` [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#120) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#associatedtype.Backend) #### type [Backend](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.Backend) = [Pg](https://docs.rs/diesel/2.1.6/diesel/pg/backend/struct.Pg.html "struct diesel::pg::backend::Pg") The backend this type connects to [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#114) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.establish) #### fn [establish](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#tymethod.establish) <'life0, 'async\_trait>( database\_url: &'life0 [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where 'life0: 'async\_trait, [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") : 'async\_trait, Establishes a new connection to the database [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#tymethod.establish) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/lib.rs.html#127) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.transaction) #### fn [transaction](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#method.transaction) <'a, 'life0, 'async\_trait, R, E, F>( &'life0 mut self, callback: F, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where 'a: 'async\_trait, 'life0: 'async\_trait, F: for<'r> [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&'r mut Self) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") , Output = [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'r>> + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a + 'async\_trait, E: [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") <[Error](https://docs.rs/diesel/2.1.6/diesel/result/enum.Error.html "enum diesel::result::Error") \> + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a + 'async\_trait, R: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a + 'async\_trait, Self: 'async\_trait, Executes the given function inside of a database transaction [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#method.transaction) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/lib.rs.html#127) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.begin_test_transaction) #### fn [begin\_test\_transaction](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#method.begin_test_transaction) <'life0, 'async\_trait>( &'life0 mut self, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where 'life0: 'async\_trait, Self: 'async\_trait, Creates a transaction that will never be committed. This is useful for tests. Panics if called while inside of a transaction or if called with a connection containing a broken transaction [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/lib.rs.html#127) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.test_transaction) #### fn [test\_transaction](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#method.test_transaction) <'a, 'async\_trait, R, E, F>( &'a mut self, f: F, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where 'a: 'async\_trait, F: for<'r> [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&'r mut Self) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") , Output = [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'r>> + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a + 'async\_trait, E: [Debug](https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html "trait core::fmt::Debug") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a + 'async\_trait, R: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'a + 'async\_trait, Self: 'a + 'async\_trait, Executes the given function inside a transaction, but does not commit it. Panics if the given function returns an error. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#method.test_transaction) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#108) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-SimpleAsyncConnection-for-AsyncPgConnection) ### impl [SimpleAsyncConnection](https://docs.rs/diesel-async/0.4.1/diesel_async/trait.SimpleAsyncConnection.html "trait diesel_async::SimpleAsyncConnection") for [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/pg/mod.rs.html#107) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.batch_execute) #### fn [batch\_execute](https://docs.rs/diesel-async/0.4.1/diesel_async/trait.SimpleAsyncConnection.html#tymethod.batch_execute) <'life0, 'life1, 'async\_trait>( &'life0 mut self, query: &'life1 [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where 'life0: 'async\_trait, 'life1: 'async\_trait, [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") : 'async\_trait, Execute multiple SQL statements within the same string. [Read more](https://docs.rs/diesel-async/0.4.1/diesel_async/trait.SimpleAsyncConnection.html#tymethod.batch_execute) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#767-780) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-UpdateAndFetchResults%3CChanges,+Output%3E-for-AsyncPgConnection) ### impl<'b, Changes, Output, Tab, V> [UpdateAndFetchResults](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/trait.UpdateAndFetchResults.html "trait diesel_async::run_query_dsl::UpdateAndFetchResults") for [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") where Output: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , Changes: [Copy](https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html "trait core::marker::Copy") + [AsChangeset](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsChangeset.html "trait rocket_db_pools::diesel::prelude::AsChangeset") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + [Identifiable](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.Identifiable.html "trait rocket_db_pools::diesel::prelude::Identifiable") , Tab: [Table](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.Table.html "trait rocket_db_pools::diesel::prelude::Table") + [FindDsl](https://docs.rs/diesel/2.1.6/diesel/query_dsl/filter_dsl/trait.FindDsl.html "trait diesel::query_dsl::filter_dsl::FindDsl") <::[Id](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.Identifiable.html#associatedtype.Id "type rocket_db_pools::diesel::prelude::Identifiable::Id") \> + 'b, ::[Id](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.Identifiable.html#associatedtype.Id "type rocket_db_pools::diesel::prelude::Identifiable::Id") \>>::[Output](https://docs.rs/diesel/2.1.6/diesel/query_dsl/filter_dsl/trait.FindDsl.html#associatedtype.Output "type diesel::query_dsl::filter_dsl::FindDsl::Output") : [IntoUpdateTarget](https://docs.rs/diesel/2.1.6/diesel/query_builder/update_statement/target/trait.IntoUpdateTarget.html "trait diesel::query_builder::update_statement::target::IntoUpdateTarget")
    , [UpdateStatement](https://docs.rs/diesel/2.1.6/diesel/query_builder/update_statement/struct.UpdateStatement.html "struct diesel::query_builder::update_statement::UpdateStatement") ::[Changeset](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsChangeset.html#associatedtype.Changeset "type rocket_db_pools::diesel::prelude::AsChangeset::Changeset") \>: [AsQuery](https://docs.rs/diesel/2.1.6/diesel/query_builder/trait.AsQuery.html "trait diesel::query_builder::AsQuery") , [UpdateStatement](https://docs.rs/diesel/2.1.6/diesel/query_builder/update_statement/struct.UpdateStatement.html "struct diesel::query_builder::update_statement::UpdateStatement") <::[Table](https://docs.rs/diesel/2.1.6/diesel/associations/trait.HasTable.html#associatedtype.Table "type diesel::associations::HasTable::Table") , ::[WhereClause](https://docs.rs/diesel/2.1.6/diesel/query_builder/update_statement/target/trait.IntoUpdateTarget.html#associatedtype.WhereClause "type diesel::query_builder::update_statement::target::IntoUpdateTarget::WhereClause") , ::[Changeset](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsChangeset.html#associatedtype.Changeset "type rocket_db_pools::diesel::prelude::AsChangeset::Changeset") \>: [LoadQuery](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html "trait diesel_async::run_query_dsl::methods::LoadQuery") <'b, [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") , Output>, V: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'b, ::[Changeset](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsChangeset.html#associatedtype.Changeset "type rocket_db_pools::diesel::prelude::AsChangeset::Changeset") : [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'b, ::[FromClause](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.QuerySource.html#associatedtype.FromClause "type rocket_db_pools::diesel::prelude::QuerySource::FromClause") : [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#766) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.update_and_fetch) #### fn [update\_and\_fetch](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/trait.UpdateAndFetchResults.html#tymethod.update_and_fetch) <'life0, 'async\_trait>( &'life0 mut self, changeset: Changes, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where 'life0: 'async\_trait, Changes: 'async\_trait, ::[Changeset](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsChangeset.html#associatedtype.Changeset "type rocket_db_pools::diesel::prelude::AsChangeset::Changeset") : 'async\_trait, [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") : 'async\_trait, See the traits documentation. Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#synthetic-implementations) ------------------------------------------------------------------------------------------------------------------------------------ [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Freeze-for-AsyncPgConnection) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-RefUnwindSafe-for-AsyncPgConnection) ### impl ![RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Send-for-AsyncPgConnection) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Sync-for-AsyncPgConnection) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Unpin-for-AsyncPgConnection) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-UnwindSafe-for-AsyncPgConnection) ### impl ![UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [AsyncPgConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection.html "struct rocket_db_pools::diesel::AsyncPgConnection") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#blanket-implementations) ------------------------------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html "trait asn1_rs::traits::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.explicit) #### fn [explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Explicit.html "enum asn1_rs::asn1_types::tagged::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html "trait asn1_rs::traits::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.implicit) #### fn [implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Implicit.html "enum asn1_rs::asn1_types::tagged::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://docs.rs/tap/1.0.1/src/tap/conv.rs.html#58) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Conv-for-T) ### impl [Conv](https://docs.rs/tap/1.0.1/tap/conv/trait.Conv.html "trait tap::conv::Conv") for T [Source](https://docs.rs/tap/1.0.1/src/tap/conv.rs.html#49-52) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.conv) #### fn [conv](https://docs.rs/tap/1.0.1/tap/conv/trait.Conv.html#method.conv) (self) -> T where Self: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") , Converts `self` into `T` using `Into`. [Read more](https://docs.rs/tap/1.0.1/tap/conv/trait.Conv.html#method.conv) [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/coproduct.rs.html#1180) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-CoproductSubsetter%3CCNil,+HNil%3E-for-Choices) ### impl [CoproductSubsetter](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/trait.CoproductSubsetter.html "trait frunk_core::coproduct::CoproductSubsetter") <[CNil](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/enum.CNil.html "enum frunk_core::coproduct::CNil") , [HNil](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/struct.HNil.html "struct frunk_core::hlist::HNil") \> for Choices [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/coproduct.rs.html#1181) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#associatedtype.Remainder) #### type [Remainder](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/trait.CoproductSubsetter.html#associatedtype.Remainder) = Choices [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/coproduct.rs.html#1184) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.subset) #### fn [subset](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/trait.CoproductSubsetter.html#tymethod.subset) ( self, ) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") <[CNil](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/enum.CNil.html "enum frunk_core::coproduct::CNil") , >::[Remainder](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/trait.CoproductSubsetter.html#associatedtype.Remainder "type frunk_core::coproduct::CoproductSubsetter::Remainder") \> Extract a subset of the possible types in a coproduct (or get the remaining possibilities) [Read more](https://docs.rs/frunk_core/0.4.4/frunk_core/coproduct/trait.CoproductSubsetter.html#tymethod.subset) [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#114) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-FmtForward-for-T) ### impl [FmtForward](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html "trait wyz::fmt::FmtForward") for T [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#41-42) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.fmt_binary) #### fn [fmt\_binary](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_binary) (self) -> [FmtBinary](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtBinary.html "struct wyz::fmt::FmtBinary") where Self: [Binary](https://doc.rust-lang.org/nightly/core/fmt/trait.Binary.html "trait core::fmt::Binary") , Causes `self` to use its `Binary` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#49-50) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.fmt_display) #### fn [fmt\_display](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_display) (self) -> [FmtDisplay](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtDisplay.html "struct wyz::fmt::FmtDisplay") where Self: [Display](https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html "trait core::fmt::Display") , Causes `self` to use its `Display` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#57-58) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.fmt_lower_exp) #### fn [fmt\_lower\_exp](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_lower_exp) (self) -> [FmtLowerExp](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtLowerExp.html "struct wyz::fmt::FmtLowerExp") where Self: [LowerExp](https://doc.rust-lang.org/nightly/core/fmt/trait.LowerExp.html "trait core::fmt::LowerExp") , Causes `self` to use its `LowerExp` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#65-66) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.fmt_lower_hex) #### fn [fmt\_lower\_hex](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_lower_hex) (self) -> [FmtLowerHex](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtLowerHex.html "struct wyz::fmt::FmtLowerHex") where Self: [LowerHex](https://doc.rust-lang.org/nightly/core/fmt/trait.LowerHex.html "trait core::fmt::LowerHex") , Causes `self` to use its `LowerHex` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#72-73) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.fmt_octal) #### fn [fmt\_octal](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_octal) (self) -> [FmtOctal](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtOctal.html "struct wyz::fmt::FmtOctal") where Self: [Octal](https://doc.rust-lang.org/nightly/core/fmt/trait.Octal.html "trait core::fmt::Octal") , Causes `self` to use its `Octal` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#80-81) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.fmt_pointer) #### fn [fmt\_pointer](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_pointer) (self) -> [FmtPointer](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtPointer.html "struct wyz::fmt::FmtPointer") where Self: [Pointer](https://doc.rust-lang.org/nightly/core/fmt/trait.Pointer.html "trait core::fmt::Pointer") , Causes `self` to use its `Pointer` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#88-89) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.fmt_upper_exp) #### fn [fmt\_upper\_exp](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_upper_exp) (self) -> [FmtUpperExp](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtUpperExp.html "struct wyz::fmt::FmtUpperExp") where Self: [UpperExp](https://doc.rust-lang.org/nightly/core/fmt/trait.UpperExp.html "trait core::fmt::UpperExp") , Causes `self` to use its `UpperExp` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#96-97) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.fmt_upper_hex) #### fn [fmt\_upper\_hex](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_upper_hex) (self) -> [FmtUpperHex](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtUpperHex.html "struct wyz::fmt::FmtUpperHex") where Self: [UpperHex](https://doc.rust-lang.org/nightly/core/fmt/trait.UpperHex.html "trait core::fmt::UpperHex") , Causes `self` to use its `UpperHex` implementation when `Debug`\-formatted. [Source](https://docs.rs/wyz/0.5.1/src/wyz/fmt.rs.html#108-109) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.fmt_list) #### fn [fmt\_list](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_list) (self) -> [FmtList](https://docs.rs/wyz/0.5.1/wyz/fmt/struct.FmtList.html "struct wyz::fmt::FmtList") where &'a Self: for<'a> [IntoIterator](https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html "trait core::iter::traits::collect::IntoIterator") , Formats each item in a sequence. [Read more](https://docs.rs/wyz/0.5.1/wyz/fmt/trait.FmtForward.html#method.fmt_list) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-From%3CT%3E-for-T) ### impl [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.from) #### fn [from](https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Into%3CU%3E-for-T) ### impl [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") for T where U: [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.into) #### fn [into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-IntoCollection%3CT%3E-for-T) ### impl IntoCollection for T [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.into_collection) #### fn into\_collection(self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.mapped) #### fn mapped(self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html "trait core::ops::function::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") where F: [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/diesel/2.1.6/src/diesel/expression/mod.rs.html#280) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-IntoSql-for-T) ### impl [IntoSql](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.IntoSql.html "trait rocket_db_pools::diesel::prelude::IntoSql") for T [Source](https://docs.rs/diesel/2.1.6/src/diesel/expression/mod.rs.html#259-262) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.into_sql) #### fn [into\_sql](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.IntoSql.html#method.into_sql) (self) -> Self::[Expression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html#associatedtype.Expression "type diesel::expression::AsExpression::Expression") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") + [AsExpression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html "trait diesel::expression::AsExpression") , T: [SqlType](https://docs.rs/diesel/2.1.6/diesel/sql_types/trait.SqlType.html "trait diesel::sql_types::SqlType") + [TypedExpressionType](https://docs.rs/diesel/2.1.6/diesel/expression/trait.TypedExpressionType.html "trait diesel::expression::TypedExpressionType") , Convert `self` to an expression for Diesel’s query builder. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.IntoSql.html#method.into_sql) [Source](https://docs.rs/diesel/2.1.6/src/diesel/expression/mod.rs.html#271-274) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.as_sql) #### fn [as\_sql](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.IntoSql.html#method.as_sql) <'a, T>(&'a self) -> <&'a Self as [AsExpression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html "trait diesel::expression::AsExpression") >::[Expression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html#associatedtype.Expression "type diesel::expression::AsExpression::Expression") where &'a Self: [AsExpression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html "trait diesel::expression::AsExpression") , T: [SqlType](https://docs.rs/diesel/2.1.6/diesel/sql_types/trait.SqlType.html "trait diesel::sql_types::SqlType") + [TypedExpressionType](https://docs.rs/diesel/2.1.6/diesel/expression/trait.TypedExpressionType.html "trait diesel::expression::TypedExpressionType") , Convert `&self` to an expression for Diesel’s query builder. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.IntoSql.html#method.as_sql) [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/hlist.rs.html#1572-1574) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-LiftInto%3CU,+I%3E-for-T) ### impl [LiftInto](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.LiftInto.html "trait frunk_core::hlist::LiftInto") for T where U: [LiftFrom](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.LiftFrom.html "trait frunk_core::hlist::LiftFrom") , [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/hlist.rs.html#1576) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.lift_into) #### fn [lift\_into](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.LiftInto.html#tymethod.lift_into) (self) -> U Performs the indexed conversion. [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-1) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-2) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-3) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-4) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-5) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-6) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-7) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-8) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-9) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-10) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-11) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-12) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-13) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-14) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-15) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-16) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-17) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-18) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-19) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-20) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-21) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-22) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-23) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-24) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-25) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-26) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-27) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-28) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-29) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-30) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-31) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-32) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-33) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-34) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-35) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-36) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-37) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-38) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-39) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-40) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-41) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-42) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-43) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-44) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-45) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-46) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-47) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-48) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-49) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-50) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-51) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-52) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-53) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-54) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-55) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-56) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-57) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#example-58) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#234) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Pipe-for-T) ### impl [Pipe](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html "trait tap::pipe::Pipe") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#73-76) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.pipe) #### fn [pipe](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (Self) -> R) -> R where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Pipes by value. This is generally the method you want to use. [Read more](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe) [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#97-99) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.pipe_ref) #### fn [pipe\_ref](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_ref) <'a, R>(&'a self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&'a Self) -> R) -> R where R: 'a, Borrows `self` and passes that borrow into the pipe function. [Read more](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_ref) [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#122-127) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.pipe_ref_mut) #### fn [pipe\_ref\_mut](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_ref_mut) <'a, R>(&'a mut self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&'a mut Self) -> R) -> R where R: 'a, Mutably borrows `self` and passes that borrow into the pipe function. [Read more](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_ref_mut) [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#145-149) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.pipe_borrow) #### fn [pipe\_borrow](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_borrow) <'a, B, R>(&'a self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&'a B](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> R) -> R where Self: [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") , B: 'a + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , R: 'a, Borrows `self`, then passes `self.borrow()` into the pipe function. [Read more](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_borrow) [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#169-176) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.pipe_borrow_mut) #### fn [pipe\_borrow\_mut](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_borrow_mut) <'a, B, R>( &'a mut self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&'a mut B](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> R, ) -> R where Self: [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") , B: 'a + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , R: 'a, Mutably borrows `self`, then passes `self.borrow_mut()` into the pipe function. [Read more](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_borrow_mut) [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#183-187) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.pipe_as_ref) #### fn [pipe\_as\_ref](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_as_ref) <'a, U, R>(&'a self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&'a U](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> R) -> R where Self: [AsRef](https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html "trait core::convert::AsRef") , U: 'a + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , R: 'a, Borrows `self`, then passes `self.as_ref()` into the pipe function. [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#195-202) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.pipe_as_mut) #### fn [pipe\_as\_mut](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_as_mut) <'a, U, R>(&'a mut self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&'a mut U](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> R) -> R where Self: [AsMut](https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html "trait core::convert::AsMut") , U: 'a + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , R: 'a, Mutably borrows `self`, then passes `self.as_mut()` into the pipe function. [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#209-213) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.pipe_deref) #### fn [pipe\_deref](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_deref) <'a, T, R>(&'a self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&'a T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> R) -> R where Self: [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , T: 'a + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , R: 'a, Borrows `self`, then passes `self.deref()` into the pipe function. [Source](https://docs.rs/tap/1.0.1/src/tap/pipe.rs.html#221-228) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.pipe_deref_mut) #### fn [pipe\_deref\_mut](https://docs.rs/tap/1.0.1/tap/pipe/trait.Pipe.html#method.pipe_deref_mut) <'a, T, R>( &'a mut self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&'a mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) -> R, ) -> R where Self: [DerefMut](https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html "trait core::ops::deref::DerefMut") + [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , T: 'a + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , R: 'a, Mutably borrows `self`, then passes `self.deref_mut()` into the pipe function. [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#194) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Pointable-for-T) ### impl [Pointable](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html "trait crossbeam_epoch::atomic::Pointable") for T [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#195) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#associatedconstant.ALIGN) #### const [ALIGN](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#associatedconstant.ALIGN) : [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) The alignment of pointer. [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#197) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#associatedtype.Init) #### type [Init](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#associatedtype.Init) = T The type for initializers. [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#199) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.init) #### unsafe fn [init](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.init) (init: ::[Init](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#associatedtype.Init "type crossbeam_epoch::atomic::Pointable::Init") ) -> [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) Initializes a with the given initializer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.init) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#203) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.deref) #### unsafe fn [deref](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref) <'a>(ptr: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) -> [&'a T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Dereferences the given pointer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#207) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.deref_mut) #### unsafe fn [deref\_mut](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref_mut) <'a>(ptr: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) -> [&'a mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably dereferences the given pointer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref_mut) [Source](https://docs.rs/crossbeam-epoch/0.9.18/src/crossbeam_epoch/atomic.rs.html#211) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.drop) #### unsafe fn [drop](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.drop) (ptr: [usize](https://doc.rust-lang.org/nightly/std/primitive.usize.html) ) Drops the object pointed to by the given pointer. [Read more](https://docs.rs/crossbeam-epoch/0.9.18/crossbeam_epoch/atomic/trait.Pointable.html#tymethod.drop) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#640) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-RunQueryDsl%3CConn%3E-for-T) ### impl [RunQueryDsl](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html "trait rocket_db_pools::diesel::prelude::RunQueryDsl") for T [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#219-222) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.execute) #### fn [execute](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.execute) <'conn, 'query>( self, conn: [&'conn mut Conn](https://doc.rust-lang.org/nightly/std/primitive.reference.html) , ) -> ::[ExecuteFuture](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html#associatedtype.ExecuteFuture "type rocket_db_pools::diesel::prelude::AsyncConnection::ExecuteFuture") <'conn, 'query> where Conn: [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , Self: [ExecuteDsl](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.ExecuteDsl.html "trait diesel_async::run_query_dsl::methods::ExecuteDsl") + 'query, Executes the given command, returning the number of rows affected. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.execute) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#331-338) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.load) #### fn [load](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.load) <'query, 'conn, U>( self, conn: [&'conn mut Conn](https://doc.rust-lang.org/nightly/std/primitive.reference.html) , ) -> [AndThen](https://docs.rs/futures-util/0.3.31/futures_util/future/try_future/struct.AndThen.html "struct futures_util::future::try_future::AndThen") , [TryCollect](https://docs.rs/futures-util/0.3.31/futures_util/stream/try_stream/try_collect/struct.TryCollect.html "struct futures_util::stream::try_stream::try_collect::TryCollect") , [Vec](https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html "struct alloc::vec::Vec") >, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (Self::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>) -> [TryCollect](https://docs.rs/futures-util/0.3.31/futures_util/stream/try_stream/try_collect/struct.TryCollect.html "struct futures_util::stream::try_stream::try_collect::TryCollect") , [Vec](https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html "struct alloc::vec::Vec") >> where U: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , Conn: [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") , Self: [LoadQuery](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html "trait diesel_async::run_query_dsl::methods::LoadQuery") <'query, Conn, U> + 'query, Executes the given query, returning a [`Vec`](https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html "struct alloc::vec::Vec") with the returned rows. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.load) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#473-477) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.load_stream) #### fn [load\_stream](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.load_stream) <'conn, 'query, U>( self, conn: [&'conn mut Conn](https://doc.rust-lang.org/nightly/std/primitive.reference.html) , ) -> Self::[LoadFuture](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.LoadFuture "type diesel_async::run_query_dsl::methods::LoadQuery::LoadFuture") <'conn> where Conn: [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") , U: 'conn, Self: [LoadQuery](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html "trait diesel_async::run_query_dsl::methods::LoadQuery") <'query, Conn, U> + 'query, Executes the given query, returning a [`Stream`](https://docs.rs/futures-core/0.3.31/futures_core/stream/trait.Stream.html "trait futures_core::stream::Stream") with the returned rows. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.load_stream) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#532-539) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.get_result) #### fn [get\_result](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.get_result) <'query, 'conn, U>( self, conn: [&'conn mut Conn](https://doc.rust-lang.org/nightly/std/primitive.reference.html) , ) -> [AndThen](https://docs.rs/futures-util/0.3.31/futures_util/future/try_future/struct.AndThen.html "struct futures_util::future::try_future::AndThen") , [Map](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.Map.html "struct futures_util::future::future::Map") <[StreamFuture](https://docs.rs/futures-util/0.3.31/futures_util/stream/stream/into_future/struct.StreamFuture.html "struct futures_util::stream::stream::into_future::StreamFuture") <[Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") >>>, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (([Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <[Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >, [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") >>)) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (Self::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>) -> [Map](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.Map.html "struct futures_util::future::future::Map") <[StreamFuture](https://docs.rs/futures-util/0.3.31/futures_util/stream/stream/into_future/struct.StreamFuture.html "struct futures_util::stream::stream::into_future::StreamFuture") <[Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") >>>, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (([Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <[Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >, [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") >>)) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >> where U: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'conn, Conn: [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") , Self: [LoadQuery](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html "trait diesel_async::run_query_dsl::methods::LoadQuery") <'query, Conn, U> + 'query, Runs the command, and returns the affected row. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.get_result) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#572-579) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.get_results) #### fn [get\_results](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.get_results) <'query, 'conn, U>( self, conn: [&'conn mut Conn](https://doc.rust-lang.org/nightly/std/primitive.reference.html) , ) -> [AndThen](https://docs.rs/futures-util/0.3.31/futures_util/future/try_future/struct.AndThen.html "struct futures_util::future::try_future::AndThen") , [TryCollect](https://docs.rs/futures-util/0.3.31/futures_util/stream/try_stream/try_collect/struct.TryCollect.html "struct futures_util::stream::try_stream::try_collect::TryCollect") , [Vec](https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html "struct alloc::vec::Vec") >, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (Self::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>) -> [TryCollect](https://docs.rs/futures-util/0.3.31/futures_util/stream/try_stream/try_collect/struct.TryCollect.html "struct futures_util::stream::try_stream::try_collect::TryCollect") , [Vec](https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html "struct alloc::vec::Vec") >> where U: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") , Conn: [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") , Self: [LoadQuery](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html "trait diesel_async::run_query_dsl::methods::LoadQuery") <'query, Conn, U> + 'query, Runs the command, returning an `Vec` with the affected rows. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.get_results) [Source](https://docs.rs/diesel-async/0.4.1/src/diesel_async/run_query_dsl/mod.rs.html#626-634) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.first) #### fn [first](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.first) <'query, 'conn, U>( self, conn: [&'conn mut Conn](https://doc.rust-lang.org/nightly/std/primitive.reference.html) , ) -> [AndThen](https://docs.rs/futures-util/0.3.31/futures_util/future/try_future/struct.AndThen.html "struct futures_util::future::try_future::AndThen") <>::[LoadFuture](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.LoadFuture "type diesel_async::run_query_dsl::methods::LoadQuery::LoadFuture") <'conn>, [Map](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.Map.html "struct futures_util::future::future::Map") <[StreamFuture](https://docs.rs/futures-util/0.3.31/futures_util/stream/stream/into_future/struct.StreamFuture.html "struct futures_util::stream::stream::into_future::StreamFuture") <[Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") <>::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>>>>, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (([Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <[Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >, [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") <>::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>>>)) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (>::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>) -> [Map](https://docs.rs/futures-util/0.3.31/futures_util/future/future/struct.Map.html "struct futures_util::future::future::Map") <[StreamFuture](https://docs.rs/futures-util/0.3.31/futures_util/stream/stream/into_future/struct.StreamFuture.html "struct futures_util::stream::stream::into_future::StreamFuture") <[Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") <>::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>>>>, [fn](https://doc.rust-lang.org/nightly/std/primitive.fn.html) (([Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") <[Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >, [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") <>::[Stream](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html#associatedtype.Stream "type diesel_async::run_query_dsl::methods::LoadQuery::Stream") <'conn>>>)) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >> where U: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'conn, Conn: [AsyncConnection](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.AsyncConnection.html "trait rocket_db_pools::diesel::prelude::AsyncConnection") , Self: [LimitDsl](https://docs.rs/diesel/2.1.6/diesel/query_dsl/limit_dsl/trait.LimitDsl.html "trait diesel::query_dsl::limit_dsl::LimitDsl") , Self::[Output](https://docs.rs/diesel/2.1.6/diesel/query_dsl/limit_dsl/trait.LimitDsl.html#associatedtype.Output "type diesel::query_dsl::limit_dsl::LimitDsl::Output") : [LoadQuery](https://docs.rs/diesel-async/0.4.1/diesel_async/run_query_dsl/methods/trait.LoadQuery.html "trait diesel_async::run_query_dsl::methods::LoadQuery") <'query, Conn, U> + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'query, Attempts to load a single record. [Read more](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/prelude/trait.RunQueryDsl.html#method.first) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/hlist.rs.html#991) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Sculptor%3CHNil,+HNil%3E-for-Source) ### impl [Sculptor](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.Sculptor.html "trait frunk_core::hlist::Sculptor") <[HNil](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/struct.HNil.html "struct frunk_core::hlist::HNil") , [HNil](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/struct.HNil.html "struct frunk_core::hlist::HNil") \> for Source [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/hlist.rs.html#992) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#associatedtype.Remainder-1) #### type [Remainder](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.Sculptor.html#associatedtype.Remainder) = Source [Source](https://docs.rs/frunk_core/0.4.4/src/frunk_core/hlist.rs.html#995) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.sculpt) #### fn [sculpt](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.Sculptor.html#tymethod.sculpt) (self) -> ([HNil](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/struct.HNil.html "struct frunk_core::hlist::HNil") , >::[Remainder](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.Sculptor.html#associatedtype.Remainder "type frunk_core::hlist::Sculptor::Remainder") ) Consumes the current HList and returns an HList with the requested shape. [Read more](https://docs.rs/frunk_core/0.4.4/frunk_core/hlist/trait.Sculptor.html#tymethod.sculpt) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#329) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-Tap-for-T) ### impl [Tap](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html "trait tap::tap::Tap") for T [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#78) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap) #### fn [tap](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&Self)) -> Self Immutable access to a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#116) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_mut) #### fn [tap\_mut](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_mut) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&mut Self)) -> Self Mutable access to a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_mut) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#129-132) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_borrow) #### fn [tap\_borrow](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_borrow) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&B](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") , B: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Immutable access to the `Borrow` of a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_borrow) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#146-149) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_borrow_mut) #### fn [tap\_borrow\_mut](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_borrow_mut) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&mut B](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") , B: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Mutable access to the `BorrowMut` of a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_borrow_mut) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#163-166) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_ref) #### fn [tap\_ref](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_ref) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&R](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [AsRef](https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html "trait core::convert::AsRef") , R: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Immutable access to the `AsRef` view of a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_ref) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#180-183) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_ref_mut) #### fn [tap\_ref\_mut](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_ref_mut) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&mut R](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [AsMut](https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html "trait core::convert::AsMut") , R: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Mutable access to the `AsMut` view of a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_ref_mut) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#197-200) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_deref) #### fn [tap\_deref](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_deref) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Immutable access to the `Deref::Target` of a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_deref) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#214-217) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_deref_mut) #### fn [tap\_deref\_mut](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_deref_mut) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [DerefMut](https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html "trait core::ops::deref::DerefMut") + [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Mutable access to the `Deref::Target` of a value. [Read more](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_deref_mut) [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#227) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_dbg) #### fn [tap\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&Self)) -> Self Calls `.tap()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#237) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_mut_dbg) #### fn [tap\_mut\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_mut_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&mut Self)) -> Self Calls `.tap_mut()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#247-250) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_borrow_dbg) #### fn [tap\_borrow\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_borrow_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&B](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") , B: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Calls `.tap_borrow()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#261-264) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_borrow_mut_dbg) #### fn [tap\_borrow\_mut\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_borrow_mut_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&mut B](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") , B: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Calls `.tap_borrow_mut()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#275-278) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_ref_dbg) #### fn [tap\_ref\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_ref_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&R](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [AsRef](https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html "trait core::convert::AsRef") , R: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Calls `.tap_ref()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#289-292) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_ref_mut_dbg) #### fn [tap\_ref\_mut\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_ref_mut_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&mut R](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [AsMut](https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html "trait core::convert::AsMut") , R: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Calls `.tap_ref_mut()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#303-306) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_deref_dbg) #### fn [tap\_deref\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_deref_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Calls `.tap_deref()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/tap.rs.html#317-320) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.tap_deref_mut_dbg) #### fn [tap\_deref\_mut\_dbg](https://docs.rs/tap/1.0.1/tap/tap/trait.Tap.html#method.tap_deref_mut_dbg) (self, func: impl [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") ([&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) )) -> Self where Self: [DerefMut](https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html "trait core::ops::deref::DerefMut") + [Deref](https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html "trait core::ops::deref::Deref") , T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Calls `.tap_deref_mut()` only in debug builds, and is erased in release builds. [Source](https://docs.rs/tap/1.0.1/src/tap/conv.rs.html#87) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-TryConv-for-T) ### impl [TryConv](https://docs.rs/tap/1.0.1/tap/conv/trait.TryConv.html "trait tap::conv::TryConv") for T [Source](https://docs.rs/tap/1.0.1/src/tap/conv.rs.html#78-81) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.try_conv) #### fn [try\_conv](https://docs.rs/tap/1.0.1/tap/conv/trait.TryConv.html#method.try_conv) (self) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") where Self: [TryInto](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html "trait core::convert::TryInto") , Attempts to convert `self` into `T` using `TryInto`. [Read more](https://docs.rs/tap/1.0.1/tap/conv/trait.TryConv.html#method.try_conv) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") for T where U: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#associatedtype.Error-1) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.try_from-1) #### fn [try\_from](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html "trait core::convert::TryInto") for T where U: [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#associatedtype.Error) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.try_into) #### fn [try\_into](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket_db_pools/diesel/struct.AsyncPgConnection#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) ---

    ) -> [Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html "enum core::option::Option") Retrieves a connection of type `Self` from the `rocket` instance. Returns `Some` as long as `Self::fairing()` has been attached and there is a connection available within at most `timeout` seconds. Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#trait-implementations) ------------------------------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/lib.rs.html#548-588) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-FromRequest%3C'r%3E-for-ExampleDb) ### impl<'r> [FromRequest](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html "trait rocket::request::from_request::FromRequest") <'r> for [ExampleDb](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html "struct rocket_sync_db_pools::example::ExampleDb") Retrieves a connection from the database pool or fails with a `Status::ServiceUnavailable` if doing so times out. [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/lib.rs.html#549) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html#associatedtype.Error) = [()](https://doc.rust-lang.org/nightly/std/primitive.unit.html) The associated error to be returned if derivation fails. [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/lib.rs.html#558-587) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.from_request) #### fn [from\_request](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request) <'life0, 'async\_trait>( \_\_r: &'r [Request](https://api.rocket.rs/v0.5/rocket/request/request/struct.Request.html "struct rocket::request::request::Request") <'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html "struct alloc::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'r: 'async\_trait, 'life0: 'async\_trait, Derives an instance of `Self` from the incoming request metadata. [Read more](https://api.rocket.rs/v0.5/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request) [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/lib.rs.html#589-595) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-Sentinel-for-ExampleDb) ### impl [Sentinel](https://api.rocket.rs/v0.5/rocket/sentinel/trait.Sentinel.html "trait rocket::sentinel::Sentinel") for [ExampleDb](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html "struct rocket_sync_db_pools::example::ExampleDb") [Source](https://api.rocket.rs/v0.5/src/rocket_sync_db_pools/lib.rs.html#590-594) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.abort) #### fn [abort](https://api.rocket.rs/v0.5/rocket/sentinel/trait.Sentinel.html#tymethod.abort) (\_\_r: &[Rocket](https://api.rocket.rs/v0.5/rocket/rkt/struct.Rocket.html "struct rocket::rkt::Rocket") <[Ignite](https://api.rocket.rs/v0.5/rocket/phase/enum.Ignite.html "enum rocket::phase::Ignite") \>) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) Returns `true` if launch should be aborted and `false` otherwise. Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#synthetic-implementations) ---------------------------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-Freeze-for-ExampleDb) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [ExampleDb](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html "struct rocket_sync_db_pools::example::ExampleDb") [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-RefUnwindSafe-for-ExampleDb) ### impl ![RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [ExampleDb](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html "struct rocket_sync_db_pools::example::ExampleDb") [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-Send-for-ExampleDb) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [ExampleDb](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html "struct rocket_sync_db_pools::example::ExampleDb") [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-Sync-for-ExampleDb) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [ExampleDb](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html "struct rocket_sync_db_pools::example::ExampleDb") [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-Unpin-for-ExampleDb) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [ExampleDb](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html "struct rocket_sync_db_pools::example::ExampleDb") [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-UnwindSafe-for-ExampleDb) ### impl ![UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [ExampleDb](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html "struct rocket_sync_db_pools::example::ExampleDb") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#blanket-implementations) ----------------------------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html "trait asn1_rs::traits::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.explicit) #### fn [explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Explicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Explicit.html "enum asn1_rs::asn1_types::tagged::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html "trait asn1_rs::traits::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.implicit) #### fn [implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/traits/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://docs.rs/asn1-rs/0.3.1/asn1_rs/class/enum.Class.html "enum asn1_rs::class::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/parser/struct.TaggedParser.html "struct asn1_rs::asn1_types::tagged::parser::TaggedParser") <'a, [Implicit](https://docs.rs/asn1-rs/0.3.1/asn1_rs/asn1_types/tagged/enum.Implicit.html "enum asn1_rs::asn1_types::tagged::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-From%3CT%3E-for-T) ### impl [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.from) #### fn [from](https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-Into%3CU%3E-for-T) ### impl [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") for T where U: [From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.into) #### fn [into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://doc.rust-lang.org/nightly/core/convert/trait.From.html "trait core::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-IntoCollection%3CT%3E-for-T) ### impl IntoCollection for T [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.into_collection) #### fn into\_collection(self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.mapped) #### fn mapped(self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html "trait core::ops::function::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") where F: [FnOnce](https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html "trait core::ops::function::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/diesel/2.1.6/src/diesel/expression/mod.rs.html#280) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-IntoSql-for-T) ### impl [IntoSql](https://docs.rs/diesel/2.1.6/diesel/expression/trait.IntoSql.html "trait diesel::expression::IntoSql") for T [Source](https://docs.rs/diesel/2.1.6/src/diesel/expression/mod.rs.html#259-262) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.into_sql) #### fn [into\_sql](https://docs.rs/diesel/2.1.6/diesel/expression/trait.IntoSql.html#method.into_sql) (self) -> Self::[Expression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html#associatedtype.Expression "type diesel::expression::AsExpression::Expression") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") + [AsExpression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html "trait diesel::expression::AsExpression") , T: [SqlType](https://docs.rs/diesel/2.1.6/diesel/sql_types/trait.SqlType.html "trait diesel::sql_types::SqlType") + [TypedExpressionType](https://docs.rs/diesel/2.1.6/diesel/expression/trait.TypedExpressionType.html "trait diesel::expression::TypedExpressionType") , Convert `self` to an expression for Diesel’s query builder. [Read more](https://docs.rs/diesel/2.1.6/diesel/expression/trait.IntoSql.html#method.into_sql) [Source](https://docs.rs/diesel/2.1.6/src/diesel/expression/mod.rs.html#271-274) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.as_sql) #### fn [as\_sql](https://docs.rs/diesel/2.1.6/diesel/expression/trait.IntoSql.html#method.as_sql) <'a, T>(&'a self) -> <&'a Self as [AsExpression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html "trait diesel::expression::AsExpression") >::[Expression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html#associatedtype.Expression "type diesel::expression::AsExpression::Expression") where &'a Self: [AsExpression](https://docs.rs/diesel/2.1.6/diesel/expression/trait.AsExpression.html "trait diesel::expression::AsExpression") , T: [SqlType](https://docs.rs/diesel/2.1.6/diesel/sql_types/trait.SqlType.html "trait diesel::sql_types::SqlType") + [TypedExpressionType](https://docs.rs/diesel/2.1.6/diesel/expression/trait.TypedExpressionType.html "trait diesel::expression::TypedExpressionType") , Convert `&self` to an expression for Diesel’s query builder. [Read more](https://docs.rs/diesel/2.1.6/diesel/expression/trait.IntoSql.html#method.as_sql) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-3) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-4) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-5) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-6) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-7) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-8) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-9) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-10) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-11) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-12) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-13) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-14) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-15) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-16) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-17) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-18) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-19) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-20) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-21) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-22) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-23) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-24) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-25) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-26) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-27) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-28) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-29) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-30) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-31) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-32) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-33) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-34) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-35) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-36) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-37) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-38) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-39) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-40) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-41) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-42) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-43) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-44) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-45) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-46) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-47) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-48) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-49) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-50) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-51) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-52) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-53) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-54) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-55) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-56) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-57) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-58) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-59) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-60) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#example-61) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") for T where U: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#associatedtype.Error-2) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html "enum core::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.try_from) #### fn [try\_from](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html "trait core::convert::TryInto") for T where U: [TryFrom](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html "trait core::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#associatedtype.Error-1) #### type [Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.try_into) #### fn [try\_into](https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://doc.rust-lang.org/nightly/core/result/enum.Result.html "enum core::result::Result") >::[Error](https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error "type core::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") where S: [Into](https://doc.rust-lang.org/nightly/core/convert/trait.Into.html "trait core::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # Database in rocket_db_pools - Rust [Database](https://api.rocket.rs/v0.5/rocket_db_pools/trait.Database#) ----------------------------------------------------------------------- [rocket\_db\_pools](https://api.rocket.rs/v0.5/rocket_db_pools/index.html) Trait Database Copy item path ============================= [Source](https://api.rocket.rs/v0.5/src/rocket_db_pools/database.rs.html#36-131) pub trait Database: From + DerefMut + Send + Sync + 'static { type Pool: Pool; const NAME: &'static str; // Provided methods fn init() -> Initializer { ... } fn fetch(rocket: &Rocket

    ) -> Result, Error> { rocket::execute(rocket.launch()) } Do async work to build an instance of Rocket, launch, and wait for shutdown: use rocket::fairing::AdHoc; // This line can also be inside of the `async` block. let rocket = rocket::build(); rocket::execute(async move { let rocket = rocket.ignite().await?; let config = rocket.config(); rocket.launch().await }); --- # async_test in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [async\_test](https://api.rocket.rs/v0.5/rocket/attr.async_test.html#) ----------------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Attribute Macro async\_test Copy item path ========================================== [Source](https://api.rocket.rs/v0.5/src/rocket_codegen/lib.rs.html#377) [Search](https://api.rocket.rs/v0.5/rocket/attr.async_test?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary #[async_test] Expand description Retrofits supports for `async fn` in unit tests. Simply decorate a test `async fn` with `#[async_test]` instead of `#[test]`: #[cfg(test)] mod tests { #[async_test] async fn test() { /* .. */ } } The attribute rewrites the function to execute inside of a Rocket-compatible async runtime. --- # Build in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Build](https://api.rocket.rs/v0.5/rocket/enum.Build.html#) ------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Enum Build Copy item path ========================= [Source](https://api.rocket.rs/v0.5/src/rocket/phase.rs.html#75-117) [Search](https://api.rocket.rs/v0.5/rocket/enum.Build?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub enum Build {} Expand description The initial launch [`Phase`](https://api.rocket.rs/v0.5/rocket/trait.Phase.html "trait rocket::Phase") . See [Rocket#build](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#build "struct rocket::Rocket") for phase details. An instance of `Rocket` in this phase is typed as [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") : a transient, in-progress build. Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#trait-implementations) -------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/phase.rs.html#75-117) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-Phase-for-Build) ### impl [Phase](https://api.rocket.rs/v0.5/rocket/trait.Phase.html "trait rocket::Phase") for [Build](https://api.rocket.rs/v0.5/rocket/enum.Build.html "enum rocket::Build") Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#synthetic-implementations) ----------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-Freeze-for-Build) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Build](https://api.rocket.rs/v0.5/rocket/enum.Build.html "enum rocket::Build") [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-RefUnwindSafe-for-Build) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Build](https://api.rocket.rs/v0.5/rocket/enum.Build.html "enum rocket::Build") [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-Send-for-Build) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Build](https://api.rocket.rs/v0.5/rocket/enum.Build.html "enum rocket::Build") [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-Sync-for-Build) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Build](https://api.rocket.rs/v0.5/rocket/enum.Build.html "enum rocket::Build") [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-Unpin-for-Build) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Build](https://api.rocket.rs/v0.5/rocket/enum.Build.html "enum rocket::Build") [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-UnwindSafe-for-Build) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Build](https://api.rocket.rs/v0.5/rocket/enum.Build.html "enum rocket::Build") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#blanket-implementations) ------------------------------------------------------------------------------------------------------ [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Build.html#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Build.html#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Build.html#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Build.html#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-1) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-2) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-3) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-4) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-5) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-6) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-7) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-8) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-9) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-10) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-11) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-12) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-13) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-14) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-15) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-16) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-17) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-18) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-19) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-20) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-21) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-22) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-23) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-24) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-25) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-26) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-27) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-28) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-29) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-30) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-31) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-32) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-33) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-34) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-35) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-36) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-37) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-38) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-39) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-40) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-41) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-42) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-43) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-44) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-45) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-46) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-47) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-48) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-49) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-50) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-51) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-52) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-53) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-54) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-55) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-56) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-57) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#example-58) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Build.html#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/enum.Build.html#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Build.html#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # Orbit in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Orbit](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#) ------------------------------------------------------------ [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Enum Orbit Copy item path ========================= [Source](https://api.rocket.rs/v0.5/src/rocket/phase.rs.html#75-117) [Search](https://api.rocket.rs/v0.5/rocket/enum.Orbit?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub enum Orbit {} Expand description The final launch [`Phase`](https://api.rocket.rs/v0.5/rocket/trait.Phase.html "trait rocket::Phase") . See [Rocket#orbit](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#orbit "struct rocket::Rocket") for details. An instance of `Rocket` in this phase is typed as [`Rocket`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") and represents a running application. Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#trait-implementations) -------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/phase.rs.html#75-117) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-Phase-for-Orbit) ### impl [Phase](https://api.rocket.rs/v0.5/rocket/trait.Phase.html "trait rocket::Phase") for [Orbit](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html "enum rocket::Orbit") Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#synthetic-implementations) ----------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-Freeze-for-Orbit) ### impl [Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Orbit](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html "enum rocket::Orbit") [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-RefUnwindSafe-for-Orbit) ### impl [RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Orbit](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html "enum rocket::Orbit") [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-Send-for-Orbit) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Orbit](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html "enum rocket::Orbit") [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-Sync-for-Orbit) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Orbit](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html "enum rocket::Orbit") [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-Unpin-for-Orbit) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Orbit](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html "enum rocket::Orbit") [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-UnwindSafe-for-Orbit) ### impl [UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Orbit](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html "enum rocket::Orbit") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#blanket-implementations) ------------------------------------------------------------------------------------------------------ [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-1) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-2) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-3) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-4) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-5) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-6) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-7) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-8) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-9) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-10) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-11) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-12) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-13) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-14) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-15) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-16) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-17) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-18) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-19) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-20) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-21) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-22) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-23) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-24) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-25) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-26) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-27) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-28) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-29) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-30) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-31) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-32) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-33) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-34) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-35) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-36) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-37) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-38) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-39) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-40) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-41) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-42) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-43) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-44) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-45) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-46) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-47) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-48) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-49) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-50) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-51) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-52) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-53) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-54) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-55) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-56) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-57) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#example-58) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # Error in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html#) -------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Struct Error Copy item path =========================== [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#62-65) [Search](https://api.rocket.rs/v0.5/rocket/struct.Error?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub struct Error { /* private fields */ } Expand description An error that occurs during launch. An `Error` is returned by [`launch()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.launch "method rocket::Rocket::launch") when launching an application fails or, more rarely, when the runtime fails after launching. [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#panics) Panics ---------------------------------------------------------------------- A value of this type panics if it is dropped without first being inspected. An _inspection_ occurs when any method is called. For instance, if `println!("Error: {}", e)` is called, where `e: Error`, the `Display::fmt` method being called by `println!` results in `e` being marked as inspected; a subsequent `drop` of the value will _not_ result in a panic. The following snippet illustrates this: if let Err(error) = rocket::build().launch().await { // This println "inspects" the error. println!("Launch failed! Error: {}", error); // This call to drop (explicit here for demonstration) will do nothing. drop(error); } When a value of this type panics, the corresponding error message is pretty printed to the console. The following illustrates this: let error = rocket::build().launch().await; // This call to drop (explicit here for demonstration) will result in // `error` being pretty-printed to the console along with a `panic!`. drop(error); [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#usage) Usage -------------------------------------------------------------------- An `Error` value should usually be allowed to `drop` without inspection. There are at least two exceptions: 1. If you are writing a library or high-level application on-top of Rocket, you likely want to inspect the value before it drops to avoid a Rocket-specific `panic!`. This typically means simply printing the value. 2. You want to display your own error messages. Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#implementations) ---------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#107-235) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Error) ### impl [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#148-151) #### pub fn [kind](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.kind) (&self) -> &[ErrorKind](https://api.rocket.rs/v0.5/rocket/error/enum.ErrorKind.html "enum rocket::error::ErrorKind") Retrieve the `kind` of the launch error. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example) Example use rocket::error::ErrorKind; if let Err(error) = rocket::build().launch().await { match error.kind() { ErrorKind::Io(e) => println!("found an i/o launch error: {}", e), e => println!("something else happened: {}", e) } } [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#168-234) #### pub fn [pretty\_print](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.pretty_print) (&self) -> &'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) Prints the error with color (if enabled) and detail. Returns a string that indicates the abort condition such as “aborting due to i/o error”. This function is called on `Drop` to display the error message. By contrast, the `Display` implementation prints a succinct version of the error, without detail. if let Err(error) = rocket::build().launch().await { let abort = error.pretty_print(); panic!("{}", abort); } Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#trait-implementations) ---------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#256-262) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Debug-for-Error) ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") for [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#258-261) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.fmt) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#264-270) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Display-for-Error) ### impl [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") for [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#266-269) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.fmt-1) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#272-281) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Drop-for-Error) ### impl [Drop](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Drop.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::Drop") for [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#273-280) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.drop) #### fn [drop](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Drop.html#tymethod.drop) (&mut self) Executes the destructor for this type. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.Drop.html#tymethod.drop) [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#237) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Error-for-Error) ### impl [Error](https://doc.rust-lang.org/nightly/core/error/trait.Error.html "trait core::error::Error") for [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") 1.30.0 · [Source](https://doc.rust-lang.org/nightly/src/core/error.rs.html#111) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.source) #### fn [source](https://doc.rust-lang.org/nightly/core/error/trait.Error.html#method.source) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <&(dyn [Error](https://doc.rust-lang.org/nightly/core/error/trait.Error.html "trait core::error::Error") + 'static)> Returns the lower-level source of this error, if any. [Read more](https://doc.rust-lang.org/nightly/core/error/trait.Error.html#method.source) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/error.rs.html#137) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.description) #### fn [description](https://doc.rust-lang.org/nightly/core/error/trait.Error.html#method.description) (&self) -> &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](https://doc.rust-lang.org/nightly/core/error/trait.Error.html#method.description) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/error.rs.html#147) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.cause) #### fn [cause](https://doc.rust-lang.org/nightly/core/error/trait.Error.html#method.cause) (&self) -> [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <&dyn [Error](https://doc.rust-lang.org/nightly/core/error/trait.Error.html "trait core::error::Error") \> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [Source](https://doc.rust-lang.org/nightly/src/core/error.rs.html#210) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.provide) #### fn [provide](https://doc.rust-lang.org/nightly/core/error/trait.Error.html#method.provide) <'a>(&'a self, request: &mut [Request](https://doc.rust-lang.org/nightly/core/error/struct.Request.html "struct core::error::Request") <'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access`) Provides type-based access to context intended for error reports. [Read more](https://doc.rust-lang.org/nightly/core/error/trait.Error.html#method.provide) [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#101-105) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-From%3CErrorKind%3E-for-Error) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") <[ErrorKind](https://api.rocket.rs/v0.5/rocket/error/enum.ErrorKind.html "enum rocket::error::ErrorKind") \> for [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") [Source](https://api.rocket.rs/v0.5/src/rocket/error.rs.html#102-104) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (kind: [ErrorKind](https://api.rocket.rs/v0.5/rocket/error/enum.ErrorKind.html "enum rocket::error::ErrorKind") ) -> Self Converts to this type from the input type. Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#synthetic-implementations) ------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Freeze-for-Error) ### impl ![Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-RefUnwindSafe-for-Error) ### impl ![RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Send-for-Error) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Sync-for-Error) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Unpin-for-Error) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-UnwindSafe-for-Error) ### impl ![UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#blanket-implementations) -------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.from-1) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Error.html#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Error.html#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Error.html#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Error.html#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-1) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-2) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-3) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-4) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-5) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-6) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-7) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-8) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-9) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-10) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-11) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-12) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-13) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-14) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-15) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-16) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-17) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-18) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-19) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-20) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-21) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-22) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-23) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-24) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-25) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-26) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-27) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-28) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-29) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-30) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-31) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-32) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-33) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-34) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-35) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-36) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-37) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-38) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-39) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-40) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-41) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-42) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-43) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-44) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-45) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-46) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-47) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-48) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-49) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-50) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-51) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-52) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-53) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-54) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-55) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-56) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-57) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-58) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#example-59) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.new) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2861) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-ToString-for-T) ### impl [ToString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::string::ToString") for T where T: [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2863) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.to_string) #### fn [to\_string](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string) (&self) -> [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") Converts the given value to a `String`. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Error.html#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Error.html#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # Route in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html#) -------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Struct Route Copy item path =========================== [Source](https://api.rocket.rs/v0.5/src/rocket/route/route.rs.html#178-193) [Search](https://api.rocket.rs/v0.5/rocket/struct.Route?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub struct Route { pub name: Option>, pub method: Method, pub handler: Box, pub uri: RouteUri<'static>, pub rank: isize, pub format: Option, /* private fields */ } Expand description A request handling route. A route consists of exactly the information in its fields. While a `Route` can be instantiated directly, doing so should be a rare or nonexistent event. Instead, a Rocket application should use Rocket’s [`#[route]`](https://api.rocket.rs/v0.5/rocket/attr.route.html "attr rocket::route") series of attributes to generate a `Route`. #[get("/route/?query", rank = 2, format = "json")] fn route_name(path: PathBuf) { /* handler procedure */ } use rocket::http::{Method, MediaType}; let route = routes![route_name].remove(0); assert_eq!(route.name.unwrap(), "route_name"); assert_eq!(route.method, Method::Get); assert_eq!(route.uri, "/route/?query"); assert_eq!(route.rank, 2); assert_eq!(route.format.unwrap(), MediaType::JSON); Note that the `rank` and `format` attribute parameters are optional. See [`#[route]`](https://api.rocket.rs/v0.5/rocket/attr.route.html "attr rocket::route") for details on macro usage. Note also that a route’s mounted _base_ becomes part of its URI; see [`RouteUri`](https://api.rocket.rs/v0.5/rocket/route/struct.RouteUri.html "struct rocket::route::RouteUri") for details. [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#routing) Routing ------------------------------------------------------------------------ A request _matches_ a route _iff_: * The route’s method matches that of the incoming request. * The route’s format (if any) matches that of the incoming request. * If route specifies a format, it only matches requests for that format. * If route doesn’t specify a format, it matches requests for any format. * A route’s `format` matches against the `Accept` header in the request when the route’s method [`supports_payload()`](https://api.rocket.rs/v0.5/rocket/http/enum.Method.html#method.supports_payload "method rocket::http::Method::supports_payload") and `Content-Type` header otherwise. * Non-specific `Accept` header components (`*`) match anything. * All static components in the route’s path match the corresponding components in the same position in the incoming request. * All static components in the route’s query string are also in the request query string, though in any position. If there is no query in the route, requests with and without queries match. Rocket routes requests to matching routes. [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#collisions) Collisions ------------------------------------------------------------------------------ Two routes are said to _collide_ if there exists a request that matches both routes. Colliding routes present a routing ambiguity and are thus disallowed by Rocket. Because routes can be constructed dynamically, collision checking is done at [`ignite`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.ignite "method rocket::Rocket::ignite") time, after it becomes statically impossible to add any more routes to an instance of `Rocket`. Note that because query parsing is always lenient – extra and missing query parameters are allowed – queries do not directly impact whether two routes collide. ### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#resolving-collisions) Resolving Collisions Collisions are resolved through _ranking_. Routes with lower ranks have higher precedence during routing than routes with higher ranks. Thus, routes are attempted in ascending rank order. If a higher precedence route returns an `Outcome` of `Forward`, the next highest precedence route is attempted, and so on, until a route returns `Success` or `Error`, or there are no more routes to try. When all routes have been attempted, Rocket issues a `404` error, handled by the appropriate [`Catcher`](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher") . ### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#default-ranking) Default Ranking Most collisions are automatically resolved by Rocket’s _default rank_. The default rank prefers static components over dynamic components in both paths and queries: the _more_ static a route’s path and query are, the lower its rank and thus the higher its precedence. There are three “colors” to paths and queries: 1. `static` - all components are static 2. `partial` - at least one, but not all, components are dynamic 3. `wild` - all components are dynamic Static paths carry more weight than static queries. The same is true for partial and wild paths. This results in the following default ranking table: | path | query | rank | | --- | --- | --- | | static | static | \-12 | | static | partial | \-11 | | static | wild | \-10 | | static | none | \-9 | | partial | static | \-8 | | partial | partial | \-7 | | partial | wild | \-6 | | partial | none | \-5 | | wild | static | \-4 | | wild | partial | \-3 | | wild | wild | \-2 | | wild | none | \-1 | Recall that _lower_ ranks have _higher_ precedence. #### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example) Example use rocket::Route; use rocket::http::Method; macro_rules! assert_rank { ($($uri:expr => $rank:expr,)*) => {$( let route = Route::new(Method::Get, $uri, rocket::route::dummy_handler); assert_eq!(route.rank, $rank); )*} } assert_rank! { "/?foo" => -12, // static path, static query "/foo/bar?a=b&bob" => -12, // static path, static query "/?a=b&bob" => -12, // static path, static query "/?a&" => -11, // static path, partial query "/foo?a&" => -11, // static path, partial query "/?a&" => -11, // static path, partial query "/?" => -10, // static path, wild query "/foo?" => -10, // static path, wild query "/foo?&" => -10, // static path, wild query "/" => -9, // static path, no query "/foo/bar" => -9, // static path, no query "/a/?foo" => -8, // partial path, static query "/a/?foo" => -8, // partial path, static query "//b?foo" => -8, // partial path, static query "/a/?&c" => -7, // partial path, partial query "/a/?a&" => -7, // partial path, partial query "/a/?" => -6, // partial path, wild query "/a/?&" => -6, // partial path, wild query "/a/?" => -6, // partial path, wild query "/a/" => -5, // partial path, no query "//b" => -5, // partial path, no query "/a/" => -5, // partial path, no query "//?foo&bar" => -4, // wild path, static query "//?foo" => -4, // wild path, static query "/?cat" => -4, // wild path, static query "//?&bar" => -3, // wild path, partial query "//?a&" => -3, // wild path, partial query "/?cat&" => -3, // wild path, partial query "//?" => -2, // wild path, wild query "//?" => -2, // wild path, wild query "/?&" => -2, // wild path, wild query "//" => -1, // wild path, no query "//" => -1, // wild path, no query "/" => -1, // wild path, no query } Fields[§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#fields) ---------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#structfield.name) `name: [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[Cow](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html "enum alloc::borrow::Cow") <'static, [str](https://doc.rust-lang.org/nightly/std/primitive.str.html) >>` The name of this route, if one was given. [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#structfield.method) `method: [Method](https://api.rocket.rs/v0.5/rocket/http/enum.Method.html "enum rocket::http::Method") ` The method this route matches against. [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#structfield.handler) `handler: [Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") ` The function that should be called when the route matches. [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#structfield.uri) `uri: [RouteUri](https://api.rocket.rs/v0.5/rocket/route/struct.RouteUri.html "struct rocket::route::RouteUri") <'static>` The route URI. [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#structfield.rank) `rank: [isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) ` The rank of this route. Lower ranks have higher priorities. [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#structfield.format) `format: [Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[MediaType](https://api.rocket.rs/v0.5/rocket/http/struct.MediaType.html "struct rocket::http::MediaType") >` The media type this route matches against, if any. Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#implementations) ---------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/route/route.rs.html#195-293) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Route) ### impl [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") [Source](https://api.rocket.rs/v0.5/src/rocket/route/route.rs.html#217-219) #### pub fn [new](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.new) (method: [Method](https://api.rocket.rs/v0.5/rocket/http/enum.Method.html "enum rocket::http::Method") , uri: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , handler: H) -> [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") Creates a new route with the given method, path, and handler with a base of `/` and a computed [default rank](https://api.rocket.rs/v0.5/rocket/struct.Route.html#default-ranking) . ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#panics) Panics Panics if `path` is not a valid Rocket route URI. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-1) Example use rocket::Route; use rocket::http::Method; // this is a rank 1 route matching requests to `GET /` let index = Route::new(Method::Get, "/", handler); assert_eq!(index.rank, -9); assert_eq!(index.method, Method::Get); assert_eq!(index.uri, "/"); [Source](https://api.rocket.rs/v0.5/src/rocket/route/route.rs.html#247-259) #### pub fn [ranked](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.ranked) (rank: R, method: [Method](https://api.rocket.rs/v0.5/rocket/http/enum.Method.html "enum rocket::http::Method") , uri: &[str](https://doc.rust-lang.org/nightly/std/primitive.str.html) , handler: H) -> [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") where H: [Handler](https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html "trait rocket::route::Handler") + 'static, R: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Option](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/option/enum.Option.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::option::Option") <[isize](https://doc.rust-lang.org/nightly/std/primitive.isize.html) \>>, Creates a new route with the given rank, method, path, and handler with a base of `/`. If `rank` is `None`, the computed [default rank](https://api.rocket.rs/v0.5/rocket/struct.Route.html#default-ranking) is used. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#panics-1) Panics Panics if `path` is not a valid Rocket route URI. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-2) Example use rocket::Route; use rocket::http::Method; let foo = Route::ranked(1, Method::Post, "/foo?bar", handler); assert_eq!(foo.rank, 1); assert_eq!(foo.method, Method::Post); assert_eq!(foo.uri, "/foo?bar"); let foo = Route::ranked(None, Method::Post, "/foo?bar", handler); assert_eq!(foo.rank, -12); assert_eq!(foo.method, Method::Post); assert_eq!(foo.uri, "/foo?bar"); [Source](https://api.rocket.rs/v0.5/src/rocket/route/route.rs.html#286-292) #### pub fn [map\_base](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.map_base) <'a, F>(self, mapper: F) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") > where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") ([Origin](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html "struct rocket::http::uri::Origin") <'a>) -> [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") , Maps the `base` of this route using `mapper`, returning a new `Route` with the returned base. `mapper` is called with the current base. The returned `String` is used as the new base if it is a valid URI. If the returned base URI contains a query, it is ignored. Returns an error if the base produced by `mapper` is not a valid origin URI. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-3) Example use rocket::Route; use rocket::http::{Method, uri::Origin}; let index = Route::new(Method::Get, "/foo/bar", handler); assert_eq!(index.uri.base(), "/"); assert_eq!(index.uri.unmounted_origin.path(), "/foo/bar"); assert_eq!(index.uri.path(), "/foo/bar"); let index = index.map_base(|base| format!("{}{}", "/boo", base)).unwrap(); assert_eq!(index.uri.base(), "/boo"); assert_eq!(index.uri.unmounted_origin.path(), "/foo/bar"); assert_eq!(index.uri.path(), "/boo/foo/bar"); Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#trait-implementations) ---------------------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/route/route.rs.html#177) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Clone-for-Route) ### impl [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") for [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") [Source](https://api.rocket.rs/v0.5/src/rocket/route/route.rs.html#177) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.clone) #### fn [clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) (&self) -> [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone) 1.0.0 · [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#245-247) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.clone_from) #### fn [clone\_from](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) (&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from) [Source](https://api.rocket.rs/v0.5/src/rocket/route/route.rs.html#320-330) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Debug-for-Route) ### impl [Debug](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Debug") for [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") [Source](https://api.rocket.rs/v0.5/src/rocket/route/route.rs.html#321-329) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.fmt-1) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Debug.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/route/route.rs.html#295-318) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Display-for-Route) ### impl [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") for [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") [Source](https://api.rocket.rs/v0.5/src/rocket/route/route.rs.html#296-317) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.fmt) #### fn [fmt](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt) (&self, f: &mut [Formatter](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/struct.Formatter.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Formatter") <'\_>) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/type.Result.html "type rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Result") Formats the value using the given formatter. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html#tymethod.fmt) [Source](https://api.rocket.rs/v0.5/src/rocket/request/from_request.rs.html#417-426) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-FromRequest%3C'r%3E-for-%26Route) ### impl<'r> [FromRequest](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html "trait rocket::request::FromRequest") <'r> for &'r [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") [Source](https://api.rocket.rs/v0.5/src/rocket/request/from_request.rs.html#418) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#associatedtype.Error) #### type [Error](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The associated error to be returned if derivation fails. [Source](https://api.rocket.rs/v0.5/src/rocket/request/from_request.rs.html#420-425) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.from_request) #### fn [from\_request](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#tymethod.from_request) <'life0, 'async\_trait>( request: &'r [Request](https://api.rocket.rs/v0.5/rocket/struct.Request.html "struct rocket::Request") <'life0>, ) -> [Pin](https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html "struct core::pin::Pin") <[Box](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/boxed/struct.Box.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::boxed::Box") > + [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + 'async\_trait>> where Self: 'async\_trait, 'r: 'async\_trait, 'life0: 'async\_trait, Derives an instance of `Self` from the incoming request metadata. [Read more](https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html#tymethod.from_request) Auto Trait Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#synthetic-implementations) ------------------------------------------------------------------------------------------------------------- [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Freeze-for-Route) ### impl ![Freeze](https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html "trait core::marker::Freeze") for [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-RefUnwindSafe-for-Route) ### impl ![RefUnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html "trait core::panic::unwind_safe::RefUnwindSafe") for [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Send-for-Route) ### impl [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") for [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Sync-for-Route) ### impl [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") for [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Unpin-for-Route) ### impl [Unpin](https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html "trait core::marker::Unpin") for [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-UnwindSafe-for-Route) ### impl ![UnwindSafe](https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html "trait core::panic::unwind_safe::UnwindSafe") for [Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") Blanket Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#blanket-implementations) -------------------------------------------------------------------------------------------------------- [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#138) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Any-for-T) ### impl [Any](https://doc.rust-lang.org/nightly/core/any/trait.Any.html "trait core::any::Any") for T where T: 'static + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/any.rs.html#139) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.type_id) #### fn [type\_id](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) (&self) -> [TypeId](https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html "struct core::any::TypeId") Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id) [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#300) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-AsTaggedExplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedExplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedExplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#295) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.explicit) #### fn [explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedExplicit.html#method.explicit) (self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Explicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Explicit.html "enum rocket::mtls::oid::asn1_rs::Explicit") , Self> [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#323) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-AsTaggedImplicit%3C'a%3E-for-T) ### impl<'a, T> [AsTaggedImplicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html "trait rocket::mtls::oid::asn1_rs::AsTaggedImplicit") <'a> for T where T: 'a, [Source](https://docs.rs/asn1-rs/0.3.1/src/asn1_rs/traits.rs.html#313-318) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.implicit) #### fn [implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/trait.AsTaggedImplicit.html#method.implicit) ( self, class: [Class](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Class.html "enum rocket::mtls::oid::asn1_rs::Class") , constructed: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , tag: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html) , ) -> [TaggedParser](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/struct.TaggedParser.html "struct rocket::mtls::oid::asn1_rs::TaggedParser") <'a, [Implicit](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/enum.Implicit.html "enum rocket::mtls::oid::asn1_rs::Implicit") , Self> [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Borrow%3CT%3E-for-T) ### impl [Borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html "trait core::borrow::Borrow") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.borrow) #### fn [borrow](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) (&self) -> [&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow) [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-BorrowMut%3CT%3E-for-T) ### impl [BorrowMut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html "trait core::borrow::BorrowMut") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.borrow_mut) #### fn [borrow\_mut](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) (&mut self) -> [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut) [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#547) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-CloneToUninit-for-T) ### impl [CloneToUninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html "trait core::clone::CloneToUninit") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/core/clone.rs.html#549) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.clone_to_uninit) #### unsafe fn [clone\_to\_uninit](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) (&self, dest: [\*mut](https://doc.rust-lang.org/nightly/std/primitive.pointer.html) [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) 🔬This is a nightly-only experimental API. (`clone_to_uninit`) Performs copy-assignment from `self` to `dest`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-From%3CT%3E-for-T) ### impl [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for T [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.from) #### fn [from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html#tymethod.from) (t: T) -> T Returns the argument unchanged. [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#325) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Instrument-for-T) ### impl [Instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html "trait tracing::instrument::Instrument") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#86) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.instrument) #### fn [instrument](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) (self, span: [Span](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") ) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Route.html#) Instruments this type with the provided [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.instrument) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#128) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.in_current_span) #### fn [in\_current\_span](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) (self) -> [Instrumented](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.Instrumented.html "struct tracing::instrument::Instrumented") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Route.html#) Instruments this type with the [current](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html#method.current "associated function tracing::span::Span::current") [`Span`](https://docs.rs/tracing/0.1.44/tracing/span/struct.Span.html "struct tracing::span::Span") , returning an `Instrumented` wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.Instrument.html#method.in_current_span) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Into%3CU%3E-for-T) ### impl [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") for T where U: [From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.into) #### fn [into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html#tymethod.into) (self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.From.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::From") for U` chooses to do. [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-IntoCollection%3CT%3E-for-T) ### impl [IntoCollection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html "trait rocket::http::ext::IntoCollection") for T [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.into_collection) #### fn [into\_collection](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.into_collection) (self) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , Converts `self` into a collection. [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.mapped) #### fn [mapped](https://api.rocket.rs/v0.5/rocket/http/ext/trait.IntoCollection.html#tymethod.mapped) (self, f: F) -> [SmallVec](https://docs.rs/smallvec/1.15.1/smallvec/struct.SmallVec.html "struct smallvec::SmallVec") where F: [FnMut](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnMut.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnMut") (T) -> U, A: [Array](https://docs.rs/smallvec/1.15.1/smallvec/trait.Array.html "trait smallvec::Array") , [Source](https://docs.rs/either/1/src/either/into_either.rs.html#64) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-IntoEither-for-T) ### impl [IntoEither](https://docs.rs/either/1/either/into_either/trait.IntoEither.html "trait either::into_either::IntoEither") for T [Source](https://docs.rs/either/1/src/either/into_either.rs.html#29) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.into_either) #### fn [into\_either](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) (self, into\_left: [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) ) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Route.html#) Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left` is `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either) [Source](https://docs.rs/either/1/src/either/into_either.rs.html#55-57) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.into_either_with) #### fn [into\_either\_with](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) (self, into\_left: F) -> [Either](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Route.html#) where F: [FnOnce](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/ops/trait.FnOnce.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::ops::FnOnce") (&Self) -> [bool](https://doc.rust-lang.org/nightly/std/primitive.bool.html) , Converts `self` into a [`Left`](https://docs.rs/either/1/either/enum.Either.html#variant.Left "variant either::Either::Left") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") if `into_left(&self)` returns `true`. Converts `self` into a [`Right`](https://docs.rs/either/1/either/enum.Either.html#variant.Right "variant either::Either::Right") variant of [`Either`](https://docs.rs/either/1/either/enum.Either.html "enum either::Either") otherwise. [Read more](https://docs.rs/either/1/either/into_either/trait.IntoEither.html#method.into_either_with) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#134) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Paint-for-T) ### impl [Paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html "trait yansi::paint::Paint") for T where T: ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.fg) #### fn [fg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the foreground set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`red()`](self::red()) and [`green()`](self::green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-4) Example Set foreground color to white using `fg()`: use yansi::{Paint, Color}; painted.fg(Color::White); Set foreground color to white using [`white()`](self::white()) . use yansi::Paint; painted.white(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.primary) #### fn [primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-5) Example println!("{}", value.primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.fixed) #### fn [fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-6) Example println!("{}", value.fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.rgb) #### fn [rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-7) Example println!("{}", value.rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.black) #### fn [black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-8) Example println!("{}", value.black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.red) #### fn [red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-9) Example println!("{}", value.red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.green) #### fn [green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-10) Example println!("{}", value.green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.yellow) #### fn [yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-11) Example println!("{}", value.yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.blue) #### fn [blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-12) Example println!("{}", value.blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.magenta) #### fn [magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-13) Example println!("{}", value.magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.cyan) #### fn [cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-14) Example println!("{}", value.cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.white) #### fn [white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-15) Example println!("{}", value.white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.bright_black) #### fn [bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-16) Example println!("{}", value.bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.bright_red) #### fn [bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-17) Example println!("{}", value.bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.bright_green) #### fn [bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-18) Example println!("{}", value.bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.bright_yellow) #### fn [bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-19) Example println!("{}", value.bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.bright_blue) #### fn [bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-20) Example println!("{}", value.bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.bright_magenta) #### fn [bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-21) Example println!("{}", value.bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.bright_cyan) #### fn [bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-22) Example println!("{}", value.bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.bright_white) #### fn [bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`fg()`](self::fg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-23) Example println!("{}", value.bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.bg) #### fn [bg](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bg) (&self, value: [Color](https://docs.rs/yansi/1.0.1/yansi/color/enum.Color.html "enum yansi::color::Color") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns a styled value derived from `self` with the background set to `value`. This method should be used rarely. Instead, prefer to use color-specific builder methods like [`on_red()`](self::on_red()) and [`on_green()`](self::on_green()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-24) Example Set background color to red using `fg()`: use yansi::{Paint, Color}; painted.bg(Color::Red); Set background color to red using [`on_red()`](self::on_red()) . use yansi::Paint; painted.on_red(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_primary) #### fn [on\_primary](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_primary) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Primary`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-25) Example println!("{}", value.on_primary()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_fixed) #### fn [on\_fixed](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_fixed) (&self, color: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Fixed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-26) Example println!("{}", value.on_fixed(color)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_rgb) #### fn [on\_rgb](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_rgb) (&self, r: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , g: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) , b: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html) ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Rgb`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-27) Example println!("{}", value.on_rgb(r, g, b)); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_black) #### fn [on\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Black`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-28) Example println!("{}", value.on_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_red) #### fn [on\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Red`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-29) Example println!("{}", value.on_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_green) #### fn [on\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Green`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-30) Example println!("{}", value.on_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_yellow) #### fn [on\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Yellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-31) Example println!("{}", value.on_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_blue) #### fn [on\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Blue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-32) Example println!("{}", value.on_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_magenta) #### fn [on\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Magenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-33) Example println!("{}", value.on_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_cyan) #### fn [on\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: Cyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-34) Example println!("{}", value.on_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_white) #### fn [on\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: White`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-35) Example println!("{}", value.on_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_bright_black) #### fn [on\_bright\_black](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_black) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlack`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-36) Example println!("{}", value.on_bright_black()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_bright_red) #### fn [on\_bright\_red](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_red) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightRed`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-37) Example println!("{}", value.on_bright_red()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_bright_green) #### fn [on\_bright\_green](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_green) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightGreen`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-38) Example println!("{}", value.on_bright_green()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_bright_yellow) #### fn [on\_bright\_yellow](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_yellow) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightYellow`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-39) Example println!("{}", value.on_bright_yellow()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_bright_blue) #### fn [on\_bright\_blue](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_blue) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightBlue`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-40) Example println!("{}", value.on_bright_blue()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_bright_magenta) #### fn [on\_bright\_magenta](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_magenta) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightMagenta`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-41) Example println!("{}", value.on_bright_magenta()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_bright_cyan) #### fn [on\_bright\_cyan](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_cyan) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightCyan`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-42) Example println!("{}", value.on_bright_cyan()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_bright_white) #### fn [on\_bright\_white](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright_white) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`bg()`](self::bg()) set to \[`Color :: BrightWhite`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-43) Example println!("{}", value.on_bright_white()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.attr) #### fn [attr](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.attr) (&self, value: [Attribute](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the styling [`Attribute`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Attribute.html "enum yansi::attr_quirk::Attribute") `value`. This method should be used rarely. Instead, prefer to use attribute-specific builder methods like [`bold()`](self::bold()) and [`underline()`](self::underline()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-44) Example Make text bold using `attr()`: use yansi::{Paint, Attribute}; painted.attr(Attribute::Bold); Make text bold using using [`bold()`](self::bold()) . use yansi::Paint; painted.bold(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.bold) #### fn [bold](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bold) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Bold`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-45) Example println!("{}", value.bold()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.dim) #### fn [dim](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.dim) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Dim`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-46) Example println!("{}", value.dim()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.italic) #### fn [italic](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.italic) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Italic`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-47) Example println!("{}", value.italic()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.underline) #### fn [underline](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.underline) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Underline`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-48) Example println!("{}", value.underline()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.blink) #### fn [blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Blink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-49) Example println!("{}", value.blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.rapid_blink) #### fn [rapid\_blink](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.rapid_blink) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: RapidBlink`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-50) Example println!("{}", value.rapid_blink()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.invert) #### fn [invert](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.invert) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Invert`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-51) Example println!("{}", value.invert()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.conceal) #### fn [conceal](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.conceal) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Conceal`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-52) Example println!("{}", value.conceal()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.strike) #### fn [strike](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.strike) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`attr()`](self::attr()) set to \[`Attribute :: Strike`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-53) Example println!("{}", value.strike()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.quirk) #### fn [quirk](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.quirk) (&self, value: [Quirk](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Enables the `yansi` [`Quirk`](https://docs.rs/yansi/1.0.1/yansi/attr_quirk/enum.Quirk.html "enum yansi::attr_quirk::Quirk") `value`. This method should be used rarely. Instead, prefer to use quirk-specific builder methods like [`mask()`](self::mask()) and [`wrap()`](self::wrap()) , which have the same functionality but are pithier. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-54) Example Enable wrapping using `.quirk()`: use yansi::{Paint, Quirk}; painted.quirk(Quirk::Wrap); Enable wrapping using [`wrap()`](self::wrap()) . use yansi::Paint; painted.wrap(); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.mask) #### fn [mask](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.mask) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Mask`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-55) Example println!("{}", value.mask()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.wrap) #### fn [wrap](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.wrap) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Wrap`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-56) Example println!("{}", value.wrap()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.linger) #### fn [linger](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.linger) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Linger`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-57) Example println!("{}", value.linger()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.clear) #### fn [clear](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.clear) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> 👎Deprecated since 1.0.1: renamed to `resetting()` due to conflicts with `Vec::clear()`. The `clear()` method will be removed in a future release. Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Clear`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-58) Example println!("{}", value.clear()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.resetting) #### fn [resetting](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.resetting) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Resetting`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-59) Example println!("{}", value.resetting()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.bright) #### fn [bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: Bright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-60) Example println!("{}", value.bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.on_bright) #### fn [on\_bright](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.on_bright) (&self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Returns `self` with the [`quirk()`](self::quirk()) set to \[`Quirk :: OnBright`\]. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-61) Example println!("{}", value.on_bright()); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#135) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.whenever) #### fn [whenever](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#tymethod.whenever) (&self, value: [Condition](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") ) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <[&T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) \> Conditionally enable styling based on whether the [`Condition`](https://docs.rs/yansi/1.0.1/yansi/condition/struct.Condition.html "struct yansi::condition::Condition") `value` applies. Replaces any previous condition. See the [crate level docs](https://docs.rs/yansi/1.0.1/yansi/index.html#per-style "mod yansi") for more details. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#example-62) Example Enable styling `painted` only when both `stdout` and `stderr` are TTYs: use yansi::{Paint, Condition}; painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY); [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#104) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.new-1) #### fn [new](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) (self) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") where Self: [Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , Create a new [`Painted`](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") with a default [`Style`](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") . [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.new) [Source](https://docs.rs/yansi/1.0.1/src/yansi/paint.rs.html#126) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.paint) #### fn [paint](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) (&self, style: S) -> [Painted](https://docs.rs/yansi/1.0.1/yansi/paint/struct.Painted.html "struct yansi::paint::Painted") <&Self> where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Style](https://docs.rs/yansi/1.0.1/yansi/style/struct.Style.html "struct yansi::style::Style") \>, Apply a style wholesale to `self`. Any previous style is replaced. [Read more](https://docs.rs/yansi/1.0.1/yansi/paint/trait.Paint.html#method.paint) [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#34) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-Same-for-T) ### impl [Same](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html "trait typenum::type_operators::Same") for T [Source](https://docs.rs/typenum/1.19.0/src/typenum/type_operators.rs.html#35) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#associatedtype.Output) #### type [Output](https://docs.rs/typenum/1.19.0/typenum/type_operators/trait.Same.html#associatedtype.Output) = T Should always be `Self` [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-ToOwned-for-T) ### impl [ToOwned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html "trait alloc::borrow::ToOwned") for T where T: [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") , [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#associatedtype.Owned) #### type [Owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned) = T The resulting type after obtaining ownership. [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#90) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.to_owned) #### fn [to\_owned](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) (&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned) [Source](https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#94) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.clone_into) #### fn [clone\_into](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) (&self, target: [&mut T](https://doc.rust-lang.org/nightly/std/primitive.reference.html) ) Uses borrowed data to replace owned data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into) [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2861) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-ToString-for-T) ### impl [ToString](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::string::ToString") for T where T: [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") + ?[Sized](https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "trait core::marker::Sized") , [Source](https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2863) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.to_string) #### fn [to\_string](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string) (&self) -> [String](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/struct.String.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::string::String") Converts the given value to a `String`. [Read more](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/string/trait.ToString.html#tymethod.to_string) [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-TryFrom%3CU%3E-for-T) ### impl [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") for T where U: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#associatedtype.Error-2) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error) = [Infallible](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/enum.Infallible.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Infallible") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.try_from) #### fn [try\_from](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from) (value: U) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-TryInto%3CU%3E-for-T) ### impl [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") for T where U: [TryFrom](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom") , [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#associatedtype.Error-1) #### type [Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error) = >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") The type returned in the event of a conversion error. [Source](https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.try_into) #### fn [try\_into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#tymethod.try_into) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") >::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryFrom::Error") \> Performs the conversion. [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#221-223) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-VZip%3CV%3E-for-T) ### impl [VZip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html "trait ppv_lite86::types::VZip") for T where V: [MultiLane](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.MultiLane.html "trait ppv_lite86::types::MultiLane") , [Source](https://docs.rs/ppv-lite86/0.2.21/src/ppv_lite86/types.rs.html#226) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.vzip) #### fn [vzip](https://docs.rs/ppv-lite86/0.2.21/ppv_lite86/types/trait.VZip.html#tymethod.vzip) (self) -> V [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#393) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#impl-WithSubscriber-for-T) ### impl [WithSubscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html "trait tracing::instrument::WithSubscriber") for T [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#176-178) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.with_subscriber) #### fn [with\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) (self, subscriber: S) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Route.html#) where S: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Dispatch](https://docs.rs/tracing-core/0.1.36/tracing_core/dispatcher/struct.Dispatch.html "struct tracing_core::dispatcher::Dispatch") \>, Attaches the provided [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber) [Source](https://docs.rs/tracing/0.1.44/src/tracing/instrument.rs.html#228) [§](https://api.rocket.rs/v0.5/rocket/struct.Route.html#method.with_current_subscriber) #### fn [with\_current\_subscriber](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) (self) -> [WithDispatch](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Route.html#) Attaches the current [default](https://docs.rs/tracing/0.1.44/tracing/dispatcher/index.html#setting-the-default-subscriber "mod tracing::dispatcher") [`Subscriber`](https://docs.rs/tracing-core/0.1.36/tracing_core/subscriber/trait.Subscriber.html "trait tracing_core::subscriber::Subscriber") to this type, returning a [`WithDispatch`](https://docs.rs/tracing/0.1.44/tracing/instrument/struct.WithDispatch.html "struct tracing::instrument::WithDispatch") wrapper. [Read more](https://docs.rs/tracing/0.1.44/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber) --- # Rocket in rocket - Rust [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#) ---------------------------------------------------------------- [](https://api.rocket.rs/v0.5/rocket/all.html "show sidebar") [rocket](https://api.rocket.rs/v0.5/rocket/index.html) Struct Rocket Copy item path ============================ [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#136) [Search](https://api.rocket.rs/v0.5/rocket/struct.Rocket?search=) [Settings](https://api.rocket.rs/v0.5/settings.html) [Help](https://api.rocket.rs/v0.5/help.html) Summary pub struct Rocket(/* private fields */); Expand description The application server itself. [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#phases) Phases ----------------------------------------------------------------------- A `Rocket` instance represents a web server and its state. It progresses through three statically-enforced phases: build, ignite, orbit. * **Build**: _application and server configuration_ This phase enables: * setting configuration options * mounting/registering routes/catchers * managing state * attaching fairings This is the _only_ phase in which an instance can be modified. To finalize changes, an instance is ignited via [`Rocket::ignite()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.ignite "method rocket::Rocket::ignite") , progressing it into the _ignite_ phase, or directly launched into orbit with [`Rocket::launch()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.launch "method rocket::Rocket::launch") which progress the instance through ignite into orbit. * **Ignite**: _verification and finalization of configuration_ An instance in the [`Ignite`](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") phase is in its final configuration, available via [`Rocket::config()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.config "method rocket::Rocket::config") . Barring user-supplied interior mutation, application state is guaranteed to remain unchanged beyond this point. An instance in the ignite phase can be launched into orbit to serve requests via [`Rocket::launch()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.launch "method rocket::Rocket::launch") . * **Orbit**: _a running web server_ An instance in the [`Orbit`](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html "enum rocket::Orbit") phase represents a _running_ application, actively serving requests. [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#launching) Launching ----------------------------------------------------------------------------- To launch a `Rocket` application, the suggested approach is to return an instance of `Rocket` from a function named `rocket` marked with the [`#[launch]`](https://api.rocket.rs/v0.5/rocket/attr.launch.html "attr rocket::launch") attribute: #[launch] fn rocket() -> _ { rocket::build() } This generates a `main` function with an `async` runtime that runs the returned `Rocket` instance. * **Manual Launching** To launch an instance of `Rocket`, it _must_ progress through all three phases. To progress into the ignite or launch phases, a tokio `async` runtime is required. The [`#[main]`](https://api.rocket.rs/v0.5/rocket/attr.main.html "attr rocket::main") attribute initializes a Rocket-specific tokio runtime and runs the attributed `async fn` inside of it: #[rocket::main] async fn main() -> Result<(), rocket::Error> { let _rocket = rocket::build() .ignite().await? .launch().await?; Ok(()) } Note that [`Rocket::launch()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.launch "method rocket::Rocket::launch") automatically progresses an instance of `Rocket` from any phase into orbit: #[rocket::main] async fn main() -> Result<(), rocket::Error> { let _rocket = rocket::build().launch().await?; Ok(()) } For extreme and rare cases in which [`#[main]`](https://api.rocket.rs/v0.5/rocket/attr.main.html "attr rocket::main") imposes obstinate restrictions, use [`rocket::execute()`](https://api.rocket.rs/v0.5/rocket/fn.execute.html "fn rocket::execute") to execute Rocket’s `launch()` future. * **Automatic Launching** Manually progressing an instance of Rocket though its phases is only necessary when either an instance’s finalized state is to be inspected (in the _ignite_ phase) or the instance is expected to deorbit due to [`Rocket::shutdown()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.shutdown "method rocket::Rocket::shutdown") . In the more common case when neither is required, the [`#[launch]`](https://api.rocket.rs/v0.5/rocket/attr.launch.html "attr rocket::launch") attribute can be used. When applied to a function that returns a `Rocket`, it automatically initializes an `async` runtime and launches the function’s returned instance: use rocket::{Rocket, Build}; #[launch] fn rocket() -> Rocket { rocket::build() } To avoid needing to import _any_ items in the common case, the `launch` attribute will infer a return type written as `_` as `Rocket`: #[launch] fn rocket() -> _ { rocket::build() } Implementations[§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#implementations) ----------------------------------------------------------------------------------------- [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#138-570) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Rocket%3CBuild%3E) ### impl [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") <[Build](https://api.rocket.rs/v0.5/rocket/enum.Build.html "enum rocket::Build") \> [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#156-158) #### pub fn [build](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.build) () -> Self Create a new `Rocket` application using the default configuration provider, [`Config::figment()`](https://api.rocket.rs/v0.5/rocket/struct.Config.html#method.figment "associated function rocket::Config::figment") . This method is typically called through the [`rocket::build()`](https://api.rocket.rs/v0.5/rocket/fn.build.html "fn rocket::build") alias. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#examples) Examples #[launch] fn rocket() -> _ { rocket::build() } [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#182-193) #### pub fn [custom](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.custom) (provider: T) -> Self Creates a new `Rocket` application using the supplied configuration provider. This method is typically called through the [`rocket::custom()`](https://api.rocket.rs/v0.5/rocket/fn.custom.html "fn rocket::custom") alias. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example) Example use rocket::figment::{Figment, providers::{Toml, Env, Format}}; #[launch] fn rocket() -> _ { let figment = Figment::from(rocket::Config::default()) .merge(Toml::file("MyApp.toml").nested()) .merge(Env::prefixed("MY_APP_").global()); rocket::custom(figment) } [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#240-243) #### pub fn [configure](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.configure) (self, provider: T) -> Self Sets the configuration provider in `self` to `provider`. A [`Figment`](https://docs.rs/figment/0.10.19/figment/figment/struct.Figment.html "struct figment::figment::Figment") generated from the current `provider` can _always_ be retrieved via [`Rocket::figment()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.figment "method rocket::Rocket::figment") . However, because the provider can be changed at any point prior to ignition, a [`Config`](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") can only be retrieved in the ignite or orbit phases, or by manually extracting one from a particular figment. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-1) Example use rocket::Config; let config = Config { port: 7777, address: Ipv4Addr::new(18, 127, 0, 1).into(), temp_dir: "/tmp/config-example".into(), ..Config::debug_default() }; let rocket = rocket::custom(&config).ignite().await?; assert_eq!(rocket.config().port, 7777); assert_eq!(rocket.config().address, Ipv4Addr::new(18, 127, 0, 1)); assert_eq!(rocket.config().temp_dir.relative(), Path::new("/tmp/config-example")); // Create a new figment which modifies _some_ keys the existing figment: let figment = rocket.figment().clone() .merge((Config::PORT, 8888)) .merge((Config::ADDRESS, "171.64.200.10")); let rocket = rocket::custom(&config) .configure(figment) .ignite().await?; assert_eq!(rocket.config().port, 8888); assert_eq!(rocket.config().address, Ipv4Addr::new(171, 64, 200, 10)); assert_eq!(rocket.config().temp_dir.relative(), Path::new("/tmp/config-example")); [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#341-349) #### pub fn [mount](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.mount) <'a, B, R>(self, base: B, routes: R) -> Self where B: [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") <[Origin](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html "struct rocket::http::uri::Origin") <'a>> + [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") + [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") , B::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto::Error") : [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") , R: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Vec](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/vec/struct.Vec.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::vec::Vec") <[Route](https://api.rocket.rs/v0.5/rocket/struct.Route.html "struct rocket::Route") \>>, Mounts all of the routes in the supplied vector at the given `base` path. Mounting a route with path `path` at path `base` makes the route available at `base/path`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#panics) Panics Panics if either: * the `base` mount point is not a valid static path: a valid origin URI without dynamic parameters. * any route’s URI is not a valid origin URI. **Note:** _This kind of panic is guaranteed not to occur if the routes were generated using Rocket’s code generation._ ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#examples-1) Examples Use the `routes!` macro to mount routes created using the code generation facilities. Requests to the `/hello/world` URI will be dispatched to the `hi` route. #[get("/world")] fn hi() -> &'static str { "Hello!" } #[launch] fn rocket() -> _ { rocket::build().mount("/hello", routes![hi]) } Manually create a route named `hi` at path `"/world"` mounted at base `"/hello"`. Requests to the `/hello/world` URI will be dispatched to the `hi` route. use rocket::{Request, Route, Data, route}; use rocket::http::Method; fn hi<'r>(req: &'r Request, _: Data<'r>) -> route::BoxFuture<'r> { route::Outcome::from(req, "Hello!").pin() } #[launch] fn rocket() -> _ { let hi_route = Route::new(Method::Get, "/world", hi); rocket::build().mount("/hello", vec![hi_route]) } [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#380-388) #### pub fn [register](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.register) <'a, B, C>(self, base: B, catchers: C) -> Self where B: [TryInto](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto") <[Origin](https://api.rocket.rs/v0.5/rocket/http/uri/struct.Origin.html "struct rocket::http::uri::Origin") <'a>> + [Clone](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html "trait core::clone::Clone") + [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") , B::[Error](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.TryInto.html#associatedtype.Error "type rocket::mtls::oid::asn1_rs::nom::lib::std::convert::TryInto::Error") : [Display](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/fmt/trait.Display.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::fmt::Display") , C: [Into](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/convert/trait.Into.html "trait rocket::mtls::oid::asn1_rs::nom::lib::std::convert::Into") <[Vec](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/vec/struct.Vec.html "struct rocket::mtls::oid::asn1_rs::nom::lib::std::vec::Vec") <[Catcher](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html "struct rocket::Catcher") \>>, Registers all of the catchers in the supplied vector, scoped to `base`. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#panics-1) Panics Panics if `base` is not a valid static path: a valid origin URI without dynamic parameters. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#examples-2) Examples use rocket::Request; #[catch(500)] fn internal_error() -> &'static str { "Whoops! Looks like we messed up." } #[catch(404)] fn not_found(req: &Request) -> String { format!("I couldn't find '{}'. Try something else?", req.uri()) } #[launch] fn rocket() -> _ { rocket::build().register("/", catchers![internal_error, not_found]) } [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#432-442) #### pub fn [manage](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.manage) (self, state: T) -> Self where T: [Send](https://doc.rust-lang.org/nightly/core/marker/trait.Send.html "trait core::marker::Send") + [Sync](https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html "trait core::marker::Sync") + 'static, Add `state` to the state managed by this instance of Rocket. This method can be called any number of times as long as each call refers to a different `T`. Managed state can be retrieved by any request handler via the [`State`](https://api.rocket.rs/v0.5/rocket/struct.State.html "struct rocket::State") request guard. In particular, if a value of type `T` is managed by Rocket, adding `State` to the list of arguments in a request handler instructs Rocket to retrieve the managed value. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#panics-2) Panics Panics if state of type `T` is already being managed. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-2) Example use rocket::State; struct MyInt(isize); struct MyString(String); #[get("/int")] fn int(state: &State) -> String { format!("The stateful int is: {}", state.0) } #[get("/string")] fn string(state: &State) -> &str { &state.0 } #[launch] fn rocket() -> _ { rocket::build() .manage(MyInt(10)) .manage(MyString("Hello, managed state!".to_string())) .mount("/", routes![int, string]) } [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#466-469) #### pub fn [attach](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.attach) (self, fairing: F) -> Self Attaches a fairing to this instance of Rocket. No fairings are eagerly executed; fairings are executed at their appropriate time. If the attached fairing is _fungible_ and a fairing of the same name already exists, this fairing replaces it. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-3) Example use rocket::Rocket; use rocket::fairing::AdHoc; #[launch] fn rocket() -> _ { rocket::build() .attach(AdHoc::on_liftoff("Liftoff Message", |_| Box::pin(async { println!("We have liftoff!"); }))) } [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#513-569) #### pub async fn [ignite](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.ignite) (self) -> [Result](https://api.rocket.rs/v0.5/rocket/mtls/oid/asn1_rs/nom/lib/std/result/enum.Result.html "enum rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result") <[Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") <[Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") \>, [Error](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") \> Returns a `Future` that transitions this instance of `Rocket` into the _ignite_ phase. When `await`ed, the future runs all _ignite_ fairings in serial, [attach](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.attach "method rocket::Rocket::attach") order, and verifies that `self` represents a valid instance of `Rocket` ready for launch. This means that: * All ignite fairings succeeded. * A valid [`Config`](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") was extracted from [`Rocket::figment()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.figment "method rocket::Rocket::figment") . * If `secrets` are enabled, the extracted `Config` contains a safe secret key. * There are no [`Route`](https://api.rocket.rs/v0.5/rocket/struct.Route.html#collisions "struct rocket::Route") or [`Catcher`](https://api.rocket.rs/v0.5/rocket/struct.Catcher.html#collisions "struct rocket::Catcher") collisions. * No [`Sentinel`](https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html "trait rocket::Sentinel") triggered an abort. If any of these conditions fail to be met, a respective [`Error`](https://api.rocket.rs/v0.5/rocket/struct.Error.html "struct rocket::Error") is returned. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-4) Example use rocket::fairing::AdHoc; #[rocket::main] async fn main() -> Result<(), rocket::Error> { let rocket = rocket::build() .attach(AdHoc::on_ignite("Manage State", |rocket| async move { rocket.manage(String::from("managed string")) })); // No fairings are run until ignition occurs. assert!(rocket.state::().is_none()); let rocket = rocket.ignite().await?; assert_eq!(rocket.state::().unwrap(), "managed string"); Ok(()) } [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#588-676) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Rocket%3CIgnite%3E) ### impl [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") <[Ignite](https://api.rocket.rs/v0.5/rocket/enum.Ignite.html "enum rocket::Ignite") \> [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#602-604) #### pub fn [config](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.config) (&self) -> &[Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Returns the finalized, active configuration. This is guaranteed to remain stable through ignition and into orbit. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-5) Example #[rocket::main] async fn main() -> Result<(), rocket::Error> { let rocket = rocket::build().ignite().await?; let config = rocket.config(); Ok(()) } [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#638-640) #### pub fn [shutdown](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.shutdown) (&self) -> [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#) Returns a handle which can be used to trigger a shutdown and detect a triggered shutdown. A completed graceful shutdown resolves the future returned by [`Rocket::launch()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.launch "method rocket::Rocket::launch") . If [`Shutdown::notify()`](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html#method.notify "method rocket::Shutdown::notify") is called _before_ an instance is launched, it will be immediately shutdown after liftoff. See [`Shutdown`](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") and [`config::Shutdown`](https://api.rocket.rs/v0.5/rocket/config/struct.Shutdown.html "struct rocket::config::Shutdown") for details on graceful shutdown. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-6) Example use rocket::tokio::{self, time}; #[rocket::main] async fn main() -> Result<(), rocket::Error> { let rocket = rocket::build().ignite().await?; let shutdown = rocket.shutdown(); tokio::spawn(async move { time::sleep(time::Duration::from_secs(5)).await; shutdown.notify(); }); // The `launch()` future resolves after ~5 seconds. let result = rocket.launch().await; assert!(result.is_ok()); Ok(()) } [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#678-742) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Rocket%3COrbit%3E) ### impl [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket") <[Orbit](https://api.rocket.rs/v0.5/rocket/enum.Orbit.html "enum rocket::Orbit") \> [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#708-710) #### pub fn [config](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.config-1) (&self) -> &[Config](https://api.rocket.rs/v0.5/rocket/struct.Config.html "struct rocket::Config") Returns the finalized, active configuration. This is guaranteed to remain stable after [`Rocket::ignite()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.ignite "method rocket::Rocket::ignite") , through ignition and into orbit. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-7) Example use rocket::fairing::AdHoc; #[launch] fn rocket() -> _ { rocket::build() .attach(AdHoc::on_liftoff("Config", |rocket| Box::pin(async move { println!("Rocket launch config: {:?}", rocket.config()); }))) } [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#739-741) #### pub fn [shutdown](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.shutdown-1) (&self) -> [Shutdown](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") [ⓘ](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#) Returns a handle which can be used to trigger a shutdown and detect a triggered shutdown. A completed graceful shutdown resolves the future returned by [`Rocket::launch()`](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.launch "method rocket::Rocket::launch") . See [`Shutdown`](https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html "struct rocket::Shutdown") and [`config::Shutdown`](https://api.rocket.rs/v0.5/rocket/config/struct.Shutdown.html "struct rocket::config::Shutdown") for details on graceful shutdown. ##### [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#example-8) Example use rocket::tokio::{self, time}; use rocket::fairing::AdHoc; #[launch] fn rocket() -> _ { rocket::build() .attach(AdHoc::on_liftoff("Shutdown", |rocket| Box::pin(async move { let shutdown = rocket.shutdown(); tokio::spawn(async move { time::sleep(time::Duration::from_secs(5)).await; shutdown.notify(); }); }))) } [Source](https://api.rocket.rs/v0.5/src/rocket/rkt.rs.html#744-906) [§](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#impl-Rocket%3CP%3E) ### impl [Rocket](https://api.rocket.rs/v0.5/rocket/struct.Rocket.html "struct rocket::Rocket")