mirror of https://github.com/rwf2/Rocket.git
parent
b3f41f248c
commit
ae406cf0ca
|
@ -3,7 +3,7 @@ use fairing::{Fairing, Kind, Info};
|
|||
|
||||
/// A ad-hoc fairing that can be created from a function or closure.
|
||||
///
|
||||
/// This enum can be used to create a fairing from a simple function or clusure
|
||||
/// This enum can be used to create a fairing from a simple function or closure
|
||||
/// without creating a new structure or implementing `Fairing` directly.
|
||||
///
|
||||
/// # Usage
|
||||
|
|
|
@ -192,7 +192,7 @@ documentation](https://api.rocket.rs/rocket/fairing/trait.Fairing.html#example).
|
|||
|
||||
For simple occasions, implementing the `Fairing` trait can be cumbersome. This
|
||||
is why Rocket provides the [`AdHoc`] type, which creates a fairing from a simple
|
||||
function or clusure. Using the `AdHoc` type is easy: simply call the
|
||||
function or closure. Using the `AdHoc` type is easy: simply call the
|
||||
`on_attach`, `on_launch`, `on_request`, or `on_response` constructors on `AdHoc`
|
||||
to create an `AdHoc` structure from a function or closure.
|
||||
|
||||
|
|
Loading…
Reference in New Issue