paperclip_actix::web

Struct Resource

source
pub struct Resource<R = Resource> { /* private fields */ }
Expand description

Wrapper for actix_web::Resource

Implementations§

source§

impl Resource

source

pub fn new(path: &str) -> Resource

source§

impl<T> Resource<Resource<T>>
where T: ServiceFactory<ServiceRequest, Config = (), Error = Error, InitError = ()>,

source

pub fn name(self, name: &str) -> Self

Proxy for actix_web::Resource::name.

NOTE: This doesn’t affect spec generation.

source

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

Proxy for actix_web::Resource::guard.

NOTE: This doesn’t affect spec generation.

source

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

source

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

Proxy for actix_web::Resource::app_data.

NOTE: This doesn’t affect spec generation.

source

pub fn to<F, Args>(self, handler: F) -> Self
where F: Handler<Args>, Args: FromRequest + 'static, F::Output: Responder + 'static, F::Future: Apiv2Operation,

source

pub fn wrap<M, B>( self, mw: M, ) -> Resource<Resource<impl ServiceFactory<ServiceRequest, Config = (), Response = ServiceResponse<B>, Error = Error, InitError = ()>>>
where B: MessageBody, M: Transform<T::Service, ServiceRequest, Response = ServiceResponse<B>, Error = Error, InitError = ()> + 'static,

Proxy for actix_web::web::Resource::wrap.

NOTE: This doesn’t affect spec generation.

source

pub fn wrap_fn<F, R, B>( self, mw: F, ) -> Resource<Resource<impl ServiceFactory<ServiceRequest, Config = (), Response = ServiceResponse<B>, Error = Error, InitError = ()>>>
where B: MessageBody, F: Fn(ServiceRequest, &T::Service) -> R + Clone + 'static, R: Future<Output = Result<ServiceResponse<B>, Error>>,

Proxy for actix_web::web::Resource::wrap_fn.

NOTE: This doesn’t affect spec generation.

source

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

Proxy for actix_web::web::Resource::default_service.

NOTE: This doesn’t affect spec generation.

Trait Implementations§

source§

impl<T, B> HttpServiceFactory for Resource<Resource<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> Mountable for Resource<T>

source§

fn path(&self) -> &str

Where this thing gets mounted.
source§

fn operations(&mut self) -> BTreeMap<HttpMethod, DefaultOperationRaw>

Map of HTTP methods and the associated API operations.
source§

fn definitions(&mut self) -> BTreeMap<String, DefaultSchemaRaw>

The definitions recorded by this object.
source§

fn security_definitions(&mut self) -> BTreeMap<String, SecurityScheme>

The security definitions recorded by this object.
source§

fn update_operations(&mut self, map: &mut BTreeMap<String, DefaultPathItemRaw>)

Updates the given map of operations with operations tracked by this object. Read more

Auto Trait Implementations§

§

impl<R> Freeze for Resource<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for Resource<R>
where R: RefUnwindSafe,

§

impl<R> Send for Resource<R>
where R: Send,

§

impl<R> Sync for Resource<R>
where R: Sync,

§

impl<R> Unpin for Resource<R>
where R: Unpin,

§

impl<R> UnwindSafe for Resource<R>
where R: UnwindSafe,

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.

§

impl<T> Instrument for T

§

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

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

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

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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