pub struct DynamicConfig { /* private fields */ }Expand description
Takes one snapshot per request and puts it in the request’s extensions.
App::new().wrap(DynamicConfig::new(sections()));HttpServer::new takes a factory and calls it once per worker thread,
so either build the Sections inside the closure — free, since it
holds closures over process-wide configuration — or build one list and
clone it in:
let configuration = DynamicConfig::new(Sections::new());
HttpServer::new(move || App::new().wrap(configuration.clone()));Implementations§
Trait Implementations§
Source§impl Clone for DynamicConfig
impl Clone for DynamicConfig
Source§impl Debug for DynamicConfig
impl Debug for DynamicConfig
Source§impl<S, B> Transform<S, ServiceRequest> for DynamicConfigwhere
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
B: 'static,
impl<S, B> Transform<S, ServiceRequest> for DynamicConfigwhere
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
B: 'static,
Source§type Response = ServiceResponse<B>
type Response = ServiceResponse<B>
Responses produced by the service.
Source§type Transform = SnapshotMiddleware<S>
type Transform = SnapshotMiddleware<S>
The
TransformService value created by this factorySource§type Future = Ready<Result<<DynamicConfig as Transform<S, ServiceRequest>>::Transform, <DynamicConfig as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<DynamicConfig as Transform<S, ServiceRequest>>::Transform, <DynamicConfig as Transform<S, ServiceRequest>>::InitError>>
The future response value.
Source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
Auto Trait Implementations§
impl !RefUnwindSafe for DynamicConfig
impl !UnwindSafe for DynamicConfig
impl Freeze for DynamicConfig
impl Send for DynamicConfig
impl Sync for DynamicConfig
impl Unpin for DynamicConfig
impl UnsafeUnpin for DynamicConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more