logo
pub struct Kind(_);
Expand description

A bitset representing the kinds of callbacks a Fairing wishes to receive.

A fairing can request any combination of any of the following kinds of callbacks:

  • Ignite
  • Liftoff
  • Request
  • Response
  • Shutdown

Two Kind structures can be ord together to represent a combination. For instance, to represent a fairing that is both an ignite and request fairing, use Kind::Ignite | Kind::Request. Similarly, to represent a fairing that is only an ignite fairing, use Kind::Ignite.

Additionally, a fairing can request to be treated as a singleton by specifying the Singleton kind.

Implementations

Kind flag representing a request for a ‘ignite’ callback.

Kind flag representing a request for a ‘liftoff’ callback.

Kind flag representing a request for a ‘request’ callback.

Kind flag representing a request for a ‘response’ callback.

Kind flag representing a request for a ‘shutdown’ callback.

Kind flag representing a singleton fairing.

Returns true if self is a superset of other. In other words, returns true if all of the kinds in other are also in self.

Example
use rocket::fairing::Kind;

let ignite_and_req = Kind::Ignite | Kind::Request;
assert!(ignite_and_req.is(Kind::Ignite | Kind::Request));

assert!(ignite_and_req.is(Kind::Ignite));
assert!(ignite_and_req.is(Kind::Request));

assert!(!ignite_and_req.is(Kind::Liftoff));
assert!(!ignite_and_req.is(Kind::Response));
assert!(!ignite_and_req.is(Kind::Ignite | Kind::Response));
assert!(!ignite_and_req.is(Kind::Ignite | Kind::Request | Kind::Response));

Returns true if self is exactly other.

Example
use rocket::fairing::Kind;

let ignite_and_req = Kind::Ignite | Kind::Request;
assert!(ignite_and_req.is_exactly(Kind::Ignite | Kind::Request));

assert!(!ignite_and_req.is_exactly(Kind::Ignite));
assert!(!ignite_and_req.is_exactly(Kind::Request));
assert!(!ignite_and_req.is_exactly(Kind::Response));
assert!(!ignite_and_req.is_exactly(Kind::Ignite | Kind::Response));

Trait Implementations

The resulting type after applying the | operator.

Performs the | operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts self into a collection.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more