pub struct Scope<T>(/* private fields */);
Expand description
Wrapper type for actix_web::Scope
and utoipa::openapi::OpenApi
with additional path
prefix created with scope::scope("path-prefix")
call.
See usage from scope
.
Implementations§
Source§impl<T> Scope<T>
impl<T> Scope<T>
Sourcepub fn guard<G: Guard + 'static>(self, guard: G) -> Self
pub fn guard<G: Guard + 'static>(self, guard: G) -> Self
Passthrough implementation for actix_web::Scope::guard
.
Sourcepub fn app_data<U: 'static>(self, data: U) -> Self
pub fn app_data<U: 'static>(self, data: U) -> Self
Passthrough implementation for actix_web::Scope::app_data
.
Sourcepub fn wrap<M, B>(
self,
middleware: M,
) -> Scope<impl ServiceFactory<ServiceRequest, Config = (), Response = ServiceResponse<B>, Error = Error, InitError = ()>>where
M: Transform<T::Service, ServiceRequest, Response = ServiceResponse<B>, Error = Error, InitError = ()> + 'static,
B: MessageBody,
pub fn wrap<M, B>(
self,
middleware: M,
) -> Scope<impl ServiceFactory<ServiceRequest, Config = (), Response = ServiceResponse<B>, Error = Error, InitError = ()>>where
M: Transform<T::Service, ServiceRequest, Response = ServiceResponse<B>, Error = Error, InitError = ()> + 'static,
B: MessageBody,
Passthrough implementation for actix_web::Scope::wrap
.
Sourcepub fn configure<F>(self, cfg_fn: F) -> Selfwhere
F: FnOnce(&mut ServiceConfig<'_>),
pub fn configure<F>(self, cfg_fn: F) -> Selfwhere
F: FnOnce(&mut ServiceConfig<'_>),
Synonymous for UtoipaApp::configure
Sourcepub fn service<F>(self, factory: F) -> Selfwhere
F: HttpServiceFactory + OpenApiFactory + 'static,
pub fn service<F>(self, factory: F) -> Selfwhere
F: HttpServiceFactory + OpenApiFactory + 'static,
Synonymous for UtoipaApp::service
Sourcepub fn route(self, path: &str, route: Route) -> Self
pub fn route(self, path: &str, route: Route) -> Self
Passthrough implementation for actix_web::Scope::route
.
Sourcepub fn default_service<F, U>(self, f: F) -> Selfwhere
F: IntoServiceFactory<U, ServiceRequest>,
U: ServiceFactory<ServiceRequest, Config = (), Response = ServiceResponse, Error = Error> + 'static,
U::InitError: Debug,
pub fn default_service<F, U>(self, f: F) -> Selfwhere
F: IntoServiceFactory<U, ServiceRequest>,
U: ServiceFactory<ServiceRequest, Config = (), Response = ServiceResponse, Error = Error> + 'static,
U::InitError: Debug,
Passthrough implementation for actix_web::Scope::default_service
.
Sourcepub fn map<F: FnOnce(Scope<T>) -> Scope<NF>, NF: ServiceFactory<ServiceRequest, Config = (), Error = Error, InitError = ()>>(
self,
op: F,
) -> Scope<NF>
pub fn map<F: FnOnce(Scope<T>) -> Scope<NF>, NF: ServiceFactory<ServiceRequest, Config = (), Error = Error, InitError = ()>>( self, op: F, ) -> Scope<NF>
Synonymous for UtoipaApp::map
Trait Implementations§
Source§impl<'s, T: ServiceFactory<ServiceRequest, Config = (), Error = Error, InitError = ()>> From<&'s str> for Scope<T>
impl<'s, T: ServiceFactory<ServiceRequest, Config = (), Error = Error, InitError = ()>> From<&'s str> for Scope<T>
Source§impl<T, B> HttpServiceFactory for Scope<T>where
T: ServiceFactory<ServiceRequest, Config = (), Response = ServiceResponse<B>, Error = Error, InitError = ()> + 'static,
B: MessageBody + 'static,
impl<T, B> HttpServiceFactory for Scope<T>where
T: ServiceFactory<ServiceRequest, Config = (), Response = ServiceResponse<B>, Error = Error, InitError = ()> + 'static,
B: MessageBody + 'static,
fn register(self, config: &mut AppService)
Auto Trait Implementations§
impl<T> !Freeze for Scope<T>
impl<T> !RefUnwindSafe for Scope<T>
impl<T> !Send for Scope<T>
impl<T> !Sync for Scope<T>
impl<T> Unpin for Scope<T>where
T: Unpin,
impl<T> !UnwindSafe for Scope<T>
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