utoipa_actix_web::scope

Struct Scope

Source
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>
where T: ServiceFactory<ServiceRequest, Config = (), Error = Error, InitError = ()>,

Source

pub fn guard<G: Guard + 'static>(self, guard: G) -> Self

Passthrough implementation for actix_web::Scope::guard.

Source

pub fn app_data<U: 'static>(self, data: U) -> Self

Passthrough implementation for actix_web::Scope::app_data.

Source

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.

Source

pub fn configure<F>(self, cfg_fn: F) -> Self
where F: FnOnce(&mut ServiceConfig<'_>),

Synonymous for UtoipaApp::configure

Source

pub fn service<F>(self, factory: F) -> Self
where F: HttpServiceFactory + OpenApiFactory + 'static,

Synonymous for UtoipaApp::service

Source

pub fn route(self, path: &str, route: Route) -> Self

Passthrough implementation for actix_web::Scope::route.

Source

pub fn default_service<F, U>(self, f: F) -> Self
where F: IntoServiceFactory<U, ServiceRequest>, U: ServiceFactory<ServiceRequest, Config = (), Response = ServiceResponse, Error = Error> + 'static, U::InitError: Debug,

Passthrough implementation for actix_web::Scope::default_service.

Source

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>
where Scope<T>: From<Scope>,

Source§

fn from(value: &'s str) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Scope<T>> for Scope<T>
where T: ServiceFactory<ServiceRequest, Config = (), Error = Error, InitError = ()>,

Source§

fn from(value: Scope<T>) -> Self

Converts to this type from the input type.
Source§

impl<T, B> HttpServiceFactory for Scope<T>
where T: ServiceFactory<ServiceRequest, Config = (), Response = ServiceResponse<B>, Error = Error, InitError = ()> + 'static, B: MessageBody + 'static,

Source§

fn register(self, config: &mut AppService)

Source§

impl<T> OpenApiFactory for Scope<T>

Source§

fn paths(&self) -> Paths

Get OpenAPI paths.
Source§

fn schemas(&self, schemas: &mut Vec<(String, RefOr<Schema>)>)

Collect schema reference and append them to the schemas.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T