Skip to main content

ErrorSet

Struct ErrorSet 

Source
pub struct ErrorSet<T, E> { /* private fields */ }
Expand description

An error defined by a set of possible status codes.

The parameter T is the actual value of the error, and must implement IntoResponseWith.

The parameter E is a type-level set of possible status codes that this error can have. e.g. (NotFound, InternalServerError) means that this error can either be a 404 or a 500.

Implementations§

Source§

impl<T, E> ErrorSet<T, E>

Source

pub fn new_with<R: StatusWrapper>(value: T) -> Self
where E: Contains<R>,

Create a new [ApiError] with the given wrapper-type.

Checks at compile time that the status code is part of the set E.

Source

pub fn new<R: StatusWrapper>(value: R) -> Self
where E: Contains<R::Pure>, R::Inner: Into<T>,

Create a new [ApiError] with the given wrapper from a type that implements StatusWrapper. (e.g. NotFound<YourValue>)

Checks at compile time that the status code is part of the set E.

Source

pub fn new_unchecked(value: T, code: StatusCode) -> Self

Create a new [ApiError] with the given value and status code.

This does not check that the status code is part of the set E. Be careful when using this method, as it can lead to invalid [ApiError]s.

Source

pub fn into_parts(self) -> (T, StatusCode)

Convert this [ApiError] into a tuple of the value and the status code.

Source

pub fn into_superset<E2>(self) -> ErrorSet<T, E2>
where E2: SupersetOf<E>,

Convert this [ApiError] into a new [ApiError] with a superset of the original set of status codes.

Source

pub fn map_value<F, U>(self, f: F) -> ErrorSet<U, E>
where F: FnOnce(T) -> U,

Convert this [ApiError] into a new [ApiError] with a different value type.

Source

pub fn value(&self) -> &T

Get a reference to the value of this [ApiError].

Source

pub fn value_mut(&mut self) -> &mut T

Get a mutable reference to the value of this [ApiError].

Source

pub fn status_code(&self) -> StatusCode

Get the status code of this [ApiError].

Trait Implementations§

Source§

impl<T: Clone, R> Clone for ErrorSet<T, R>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, R> Debug for ErrorSet<T, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Eq, R> Eq for ErrorSet<T, R>

Source§

impl<T, R, S> From<BadGateway<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<BadGateway>,

Source§

fn from(err: BadGateway<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<BadRequest<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<BadRequest>,

Source§

fn from(err: BadRequest<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<Conflict<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<Conflict>,

Source§

fn from(err: Conflict<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<ExpectationFailed<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<ExpectationFailed>,

Source§

fn from(err: ExpectationFailed<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<FailedDependency<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<FailedDependency>,

Source§

fn from(err: FailedDependency<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<Forbidden<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<Forbidden>,

Source§

fn from(err: Forbidden<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<GatewayTimeout<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<GatewayTimeout>,

Source§

fn from(err: GatewayTimeout<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<Gone<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<Gone>,

Source§

fn from(err: Gone<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<HttpVersionNotSupported<R>> for ErrorSet<S, T>

Source§

fn from(err: HttpVersionNotSupported<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<ImATeapot<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<ImATeapot>,

Source§

fn from(err: ImATeapot<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<InsufficientStorage<R>> for ErrorSet<S, T>

Source§

fn from(err: InsufficientStorage<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<InternalServerError<R>> for ErrorSet<S, T>

Source§

fn from(err: InternalServerError<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<LengthRequired<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<LengthRequired>,

Source§

fn from(err: LengthRequired<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<Locked<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<Locked>,

Source§

fn from(err: Locked<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<LoopDetected<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<LoopDetected>,

Source§

fn from(err: LoopDetected<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<MethodNotAllowed<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<MethodNotAllowed>,

Source§

fn from(err: MethodNotAllowed<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<MisdirectedRequest<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<MisdirectedRequest>,

Source§

fn from(err: MisdirectedRequest<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<NetworkAuthenticationRequired<R>> for ErrorSet<S, T>

Source§

fn from(err: NetworkAuthenticationRequired<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<NotAcceptable<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<NotAcceptable>,

Source§

fn from(err: NotAcceptable<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<NotExtended<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<NotExtended>,

Source§

fn from(err: NotExtended<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<NotFound<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<NotFound>,

Source§

fn from(err: NotFound<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<NotImplemented<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<NotImplemented>,

Source§

fn from(err: NotImplemented<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<PaymentRequired<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<PaymentRequired>,

Source§

fn from(err: PaymentRequired<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<PreconditionFailed<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<PreconditionFailed>,

Source§

fn from(err: PreconditionFailed<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<PreconditionRequired<R>> for ErrorSet<S, T>

Source§

fn from(err: PreconditionRequired<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<ProxyAuthenticationRequired<R>> for ErrorSet<S, T>

Source§

fn from(err: ProxyAuthenticationRequired<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<RangeNotSatisfiable<R>> for ErrorSet<S, T>

Source§

fn from(err: RangeNotSatisfiable<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<RequestHeaderFieldsTooLarge<R>> for ErrorSet<S, T>

Source§

fn from(err: RequestHeaderFieldsTooLarge<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<RequestTimeout<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<RequestTimeout>,

Source§

fn from(err: RequestTimeout<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<ServiceUnavailable<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<ServiceUnavailable>,

Source§

fn from(err: ServiceUnavailable<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<TooManyRequests<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<TooManyRequests>,

Source§

fn from(err: TooManyRequests<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<Unauthorized<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<Unauthorized>,

Source§

fn from(err: Unauthorized<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<UnavailableForLegalReasons<R>> for ErrorSet<S, T>

Source§

fn from(err: UnavailableForLegalReasons<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<UnprocessableEntity<R>> for ErrorSet<S, T>

Source§

fn from(err: UnprocessableEntity<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<UnsupportedMediaType<R>> for ErrorSet<S, T>

Source§

fn from(err: UnsupportedMediaType<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<UpgradeRequired<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<UpgradeRequired>,

Source§

fn from(err: UpgradeRequired<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<UriTooLong<R>> for ErrorSet<S, T>
where R: Into<S>, T: Contains<UriTooLong>,

Source§

fn from(err: UriTooLong<R>) -> Self

Converts to this type from the input type.
Source§

impl<T, R, S> From<VariantAlsoNegotiates<R>> for ErrorSet<S, T>

Source§

fn from(err: VariantAlsoNegotiates<R>) -> Self

Converts to this type from the input type.
Source§

impl<T: Hash, R> Hash for ErrorSet<T, R>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: IntoResponseWith, R> IntoResponse for ErrorSet<T, R>

Source§

fn into_response(self) -> Response

Create a response.
Source§

impl<R, E1> IntoResponses for ErrorSet<R, (E1,)>

Source§

fn responses() -> BTreeMap<String, RefOr<Response>>

Returns an ordered map of response codes to responses.
Source§

impl<R, E1, E2> IntoResponses for ErrorSet<R, (E1, E2)>

Source§

fn responses() -> BTreeMap<String, RefOr<Response>>

Returns an ordered map of response codes to responses.
Source§

impl<R, E1, E2, E3> IntoResponses for ErrorSet<R, (E1, E2, E3)>

Source§

fn responses() -> BTreeMap<String, RefOr<Response>>

Returns an ordered map of response codes to responses.
Source§

impl<R, E1, E2, E3, E4> IntoResponses for ErrorSet<R, (E1, E2, E3, E4)>

Source§

fn responses() -> BTreeMap<String, RefOr<Response>>

Returns an ordered map of response codes to responses.
Source§

impl<R, E1, E2, E3, E4, E5> IntoResponses for ErrorSet<R, (E1, E2, E3, E4, E5)>

Source§

fn responses() -> BTreeMap<String, RefOr<Response>>

Returns an ordered map of response codes to responses.
Source§

impl<R, E1, E2, E3, E4, E5, E6> IntoResponses for ErrorSet<R, (E1, E2, E3, E4, E5, E6)>

Source§

fn responses() -> BTreeMap<String, RefOr<Response>>

Returns an ordered map of response codes to responses.
Source§

impl<R, E1, E2, E3, E4, E5, E6, E7> IntoResponses for ErrorSet<R, (E1, E2, E3, E4, E5, E6, E7)>

Source§

fn responses() -> BTreeMap<String, RefOr<Response>>

Returns an ordered map of response codes to responses.
Source§

impl<R, E1, E2, E3, E4, E5, E6, E7, E8> IntoResponses for ErrorSet<R, (E1, E2, E3, E4, E5, E6, E7, E8)>

Source§

fn responses() -> BTreeMap<String, RefOr<Response>>

Returns an ordered map of response codes to responses.
Source§

impl<R, E1, E2, E3, E4, E5, E6, E7, E8, E9> IntoResponses for ErrorSet<R, (E1, E2, E3, E4, E5, E6, E7, E8, E9)>

Source§

fn responses() -> BTreeMap<String, RefOr<Response>>

Returns an ordered map of response codes to responses.
Source§

impl<R, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10> IntoResponses for ErrorSet<R, (E1, E2, E3, E4, E5, E6, E7, E8, E9, E10)>

Source§

fn responses() -> BTreeMap<String, RefOr<Response>>

Returns an ordered map of response codes to responses.
Source§

impl<R, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11> IntoResponses for ErrorSet<R, (E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11)>

Source§

fn responses() -> BTreeMap<String, RefOr<Response>>

Returns an ordered map of response codes to responses.
Source§

impl<R, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12> IntoResponses for ErrorSet<R, (E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12)>

Source§

fn responses() -> BTreeMap<String, RefOr<Response>>

Returns an ordered map of response codes to responses.
Source§

impl<R> IntoResponses for ErrorSet<R, ()>

Source§

fn responses() -> BTreeMap<String, RefOr<Response>>

Returns an ordered map of response codes to responses.
Source§

impl<R, E1> OperationOutput for ErrorSet<R, (E1,)>

Source§

type Inner = <R as AideResponseFor>::Inner

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<R, E1, E2> OperationOutput for ErrorSet<R, (E1, E2)>

Source§

type Inner = <R as AideResponseFor>::Inner

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<R, E1, E2, E3> OperationOutput for ErrorSet<R, (E1, E2, E3)>

Source§

type Inner = <R as AideResponseFor>::Inner

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<R, E1, E2, E3, E4> OperationOutput for ErrorSet<R, (E1, E2, E3, E4)>

Source§

type Inner = <R as AideResponseFor>::Inner

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<R, E1, E2, E3, E4, E5> OperationOutput for ErrorSet<R, (E1, E2, E3, E4, E5)>

Source§

type Inner = <R as AideResponseFor>::Inner

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<R, E1, E2, E3, E4, E5, E6> OperationOutput for ErrorSet<R, (E1, E2, E3, E4, E5, E6)>

Source§

type Inner = <R as AideResponseFor>::Inner

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<R, E1, E2, E3, E4, E5, E6, E7> OperationOutput for ErrorSet<R, (E1, E2, E3, E4, E5, E6, E7)>

Source§

type Inner = <R as AideResponseFor>::Inner

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<R, E1, E2, E3, E4, E5, E6, E7, E8> OperationOutput for ErrorSet<R, (E1, E2, E3, E4, E5, E6, E7, E8)>

Source§

type Inner = <R as AideResponseFor>::Inner

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<R, E1, E2, E3, E4, E5, E6, E7, E8, E9> OperationOutput for ErrorSet<R, (E1, E2, E3, E4, E5, E6, E7, E8, E9)>

Source§

type Inner = <R as AideResponseFor>::Inner

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<R, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10> OperationOutput for ErrorSet<R, (E1, E2, E3, E4, E5, E6, E7, E8, E9, E10)>

Source§

type Inner = <R as AideResponseFor>::Inner

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<R, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11> OperationOutput for ErrorSet<R, (E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11)>

Source§

type Inner = <R as AideResponseFor>::Inner

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<R, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12> OperationOutput for ErrorSet<R, (E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12)>

Source§

type Inner = <R as AideResponseFor>::Inner

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( ctx: &mut GenContext, operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<R> OperationOutput for ErrorSet<R, ()>
where R: AideResponseFor,

Source§

type Inner = <R as AideResponseFor>::Inner

The type that is used in examples. Read more
Source§

fn operation_response( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Option<Response>

Return a response documentation for this type, alternatively modify the operation if required. Read more
Source§

fn inferred_responses( _ctx: &mut GenContext, _operation: &mut Operation, ) -> Vec<(Option<u16>, Response)>

Inferred responses are used when the type is used as a request handler return type. Read more
Source§

impl<T: PartialEq, R> PartialEq for ErrorSet<T, R>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl<T, E> Freeze for ErrorSet<T, E>
where T: Freeze, PhantomData<fn() -> E>: Freeze,

§

impl<T, E> RefUnwindSafe for ErrorSet<T, E>

§

impl<T, E> Send for ErrorSet<T, E>
where T: Send, PhantomData<fn() -> E>: Send,

§

impl<T, E> Sync for ErrorSet<T, E>
where T: Sync, PhantomData<fn() -> E>: Sync,

§

impl<T, E> Unpin for ErrorSet<T, E>
where T: Unpin, PhantomData<fn() -> E>: Unpin,

§

impl<T, E> UnsafeUnpin for ErrorSet<T, E>

§

impl<T, E> UnwindSafe for ErrorSet<T, E>
where T: UnwindSafe, PhantomData<fn() -> E>: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T, S> Handler<IntoResponseHandler, S> for T
where T: IntoResponse + Clone + Send + Sync + 'static,

Source§

type Future = Ready<Response<Body>>

The type of future calling this handler returns.
Source§

fn call( self, _req: Request<Body>, _state: S, ) -> <T as Handler<IntoResponseHandler, S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<H, T> HandlerWithoutStateExt<T> for H
where H: Handler<T, ()>,

Source§

fn into_service(self) -> HandlerService<H, T, ()>

Convert the handler into a Service and no state.
Source§

fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>

Convert the handler into a MakeService and no state. Read more
Source§

fn into_make_service_with_connect_info<C>( self, ) -> IntoMakeServiceWithConnectInfo<HandlerService<H, T, ()>, C>

Convert the handler into a MakeService which stores information about the incoming connection and has no state. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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> IntoApi for T

Source§

fn into_api<A>(self) -> UseApi<T, A>
where T: Sized,

into UseApi
Source§

impl<S1, S2> SupersetOf<S2> for S1
where S2: SubsetOf<S1> + ?Sized, S1: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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