[−][src]Struct rowdy::Configuration
Application configuration. Usually deserialized from JSON for use.
The type parameter B
is the auth::AuthenticatorConfiguration
and by its associated
type, the Authenticator
that is going to be used for HTTP Basic Authentication.
Examples
extern crate rowdy; extern crate serde_json; use rowdy::Configuration; use rowdy::auth::NoOpConfiguration; // We are using the `NoOp` authenticator let json = r#"{ "token" : { "issuer": "https://www.acme.com", "allowed_origins": { "Some": ["https://www.example.com", "https://www.foobar.com"] }, "audience": ["https://www.example.com", "https://www.foobar.com"], "signature_algorithm": "RS256", "secret": { "rsa_private": "test/fixtures/rsa_private_key.der", "rsa_public": "test/fixtures/rsa_public_key.der" }, "expiry_duration": 86400 }, "basic_authenticator": {} }"#; let config: Configuration<NoOpConfiguration> = serde_json::from_str(json).unwrap(); let rocket = config.ignite().unwrap().mount("/", rowdy::routes()); // then `rocket.launch()`!
Fields
token: Configuration
Token configuration. See the type documentation for deserialization examples
basic_authenticator: B
The configuration for the authenticator that will handle HTTP Basic Authentication.
Methods
impl<B: AuthenticatorConfiguration<Basic>> Configuration<B>
[src]
pub fn ignite(&self) -> Result<Rocket, Error>
[src]
Ignites the rocket with various configuration objects, but does not mount any routes.
Remember to mount routes and call launch
on the returned Rocket object.
See the struct documentation for an example.
Trait Implementations
impl<B: Clone> Clone for Configuration<B>
[src]
fn clone(&self) -> Configuration<B>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<B: Debug> Debug for Configuration<B>
[src]
impl<B> Serialize for Configuration<B> where
B: Serialize,
[src]
B: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de, B> Deserialize<'de> for Configuration<B> where
B: Deserialize<'de>,
[src]
B: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl<B> Send for Configuration<B> where
B: Send,
B: Send,
impl<B> Sync for Configuration<B> where
B: Sync,
B: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> IntoCollection for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
A: Array<Item = T>,
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
impl<T, I> AsResult for T where
I: Input,
I: Input,