pub trait ApplySettings<S>: Sized {
// Required method
fn try_apply_settings(self, settings: &S) -> Result<Self, Error>;
// Provided method
fn apply_settings(self, settings: &S) -> Self { ... }
}
Expand description
Extension trait for applying parsed settings to the server object.
Required Methods§
Provided Methods§
Sourcefn apply_settings(self, settings: &S) -> Self
👎Deprecated: Prefer try_apply_settings()
.
fn apply_settings(self, settings: &S) -> Self
try_apply_settings()
.Applies some settings object value to self
.
The default implementation calls try_apply_settings()
.
§Panics
May panic if settings are invalid or cannot be applied.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<F, I, S, B> ApplySettings<ActixSettings> for HttpServer<F, I, S, B>
impl<F, I, S, B> ApplySettings<ActixSettings> for HttpServer<F, I, S, B>
Source§fn apply_settings(self, settings: &ActixSettings) -> Self
fn apply_settings(self, settings: &ActixSettings) -> Self
👎Deprecated: Prefer
try_apply_settings()
.fn try_apply_settings(self, settings: &ActixSettings) -> Result<Self, Error>
Source§impl<F, I, S, B, A> ApplySettings<BasicSettings<A>> for HttpServer<F, I, S, B>where
F: Fn() -> I + Send + Clone + 'static,
I: IntoServiceFactory<S, Request>,
S: ServiceFactory<Request, Config = AppConfig> + 'static,
S::Error: Into<Error> + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
B: MessageBody + 'static,
A: DeserializeOwned,
impl<F, I, S, B, A> ApplySettings<BasicSettings<A>> for HttpServer<F, I, S, B>where
F: Fn() -> I + Send + Clone + 'static,
I: IntoServiceFactory<S, Request>,
S: ServiceFactory<Request, Config = AppConfig> + 'static,
S::Error: Into<Error> + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
B: MessageBody + 'static,
A: DeserializeOwned,
Source§fn apply_settings(self, settings: &BasicSettings<A>) -> Self
fn apply_settings(self, settings: &BasicSettings<A>) -> Self
👎Deprecated: Prefer
try_apply_settings()
.