ApplySettings

Trait ApplySettings 

Source
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§

Source

fn try_apply_settings(self, settings: &S) -> Result<Self, Error>

Applies some settings object value to self.

§Errors

May return error if settings are invalid or cannot be applied.

Provided Methods§

Source

fn apply_settings(self, settings: &S) -> Self

👎Deprecated: Prefer 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>
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,

Source§

fn apply_settings(self, settings: &ActixSettings) -> Self

👎Deprecated: Prefer try_apply_settings().
Source§

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,

Source§

fn apply_settings(self, settings: &BasicSettings<A>) -> Self

👎Deprecated: Prefer try_apply_settings().
Source§

fn try_apply_settings(self, settings: &BasicSettings<A>) -> Result<Self, Error>

Implementors§