pub struct StatusCode(/* private fields */);native only.Expand description
An HTTP status code (status-code in RFC 9110 et al.).
Constants are provided for known status codes, including those in the IANA HTTP Status Code Registry.
Status code values in the range 100-999 (inclusive) are supported by this
type. Values in the range 100-599 are semantically classified by the most
significant digit. See StatusCode::is_success, etc. Values above 599
are unclassified but allowed for legacy compatibility, though their use is
discouraged. Applications may interpret such values as protocol errors.
§Examples
use http::StatusCode;
assert_eq!(StatusCode::from_u16(200).unwrap(), StatusCode::OK);
assert_eq!(StatusCode::NOT_FOUND.as_u16(), 404);
assert!(StatusCode::OK.is_success());Implementations§
Source§impl StatusCode
impl StatusCode
Sourcepub const fn from_u16(src: u16) -> Result<StatusCode, InvalidStatusCode>
Available on crate feature exception only.
pub const fn from_u16(src: u16) -> Result<StatusCode, InvalidStatusCode>
exception only.Converts a u16 to a status code.
The function validates the correctness of the supplied u16. It must be greater or equal to 100 and less than 1000.
§Example
use http::StatusCode;
let ok = StatusCode::from_u16(200).unwrap();
assert_eq!(ok, StatusCode::OK);
let err = StatusCode::from_u16(99);
assert!(err.is_err());Sourcepub fn from_bytes(src: &[u8]) -> Result<StatusCode, InvalidStatusCode>
Available on crate feature exception only.
pub fn from_bytes(src: &[u8]) -> Result<StatusCode, InvalidStatusCode>
exception only.Converts a &[u8] to a status code.
Sourcepub const fn as_u16(&self) -> u16
Available on crate feature exception only.
pub const fn as_u16(&self) -> u16
exception only.Returns the u16 corresponding to this StatusCode.
§Note
This is the same as the From<StatusCode> implementation, but
included as an inherent method because that implementation doesn’t
appear in rustdocs, as well as a way to force the type instead of
relying on inference.
§Example
let status = http::StatusCode::OK;
assert_eq!(status.as_u16(), 200);Sourcepub fn as_str(&self) -> &str
Available on crate feature exception only.
pub fn as_str(&self) -> &str
exception only.Returns a &str representation of the StatusCode
The return value only includes a numerical representation of the status code. The canonical reason is not included.
§Example
let status = http::StatusCode::OK;
assert_eq!(status.as_str(), "200");Sourcepub fn canonical_reason(&self) -> Option<&'static str>
Available on crate feature exception only.
pub fn canonical_reason(&self) -> Option<&'static str>
exception only.Get the standardised reason-phrase for this status code.
This is mostly here for servers writing responses, but could potentially have application at other times.
The reason phrase is defined as being exclusively for human readers. You should avoid deriving any meaning from it at all costs.
Bear in mind also that in HTTP/2.0 and HTTP/3.0 the reason phrase is abolished from transmission, and so this canonical reason phrase really is the only reason phrase you’ll find.
§Example
let status = http::StatusCode::OK;
assert_eq!(status.canonical_reason(), Some("OK"));Sourcepub fn is_informational(&self) -> bool
Available on crate feature exception only.
pub fn is_informational(&self) -> bool
exception only.Check if status is within 100-199.
Sourcepub fn is_success(&self) -> bool
Available on crate feature exception only.
pub fn is_success(&self) -> bool
exception only.Check if status is within 200-299.
Sourcepub fn is_redirection(&self) -> bool
Available on crate feature exception only.
pub fn is_redirection(&self) -> bool
exception only.Check if status is within 300-399.
Sourcepub fn is_client_error(&self) -> bool
Available on crate feature exception only.
pub fn is_client_error(&self) -> bool
exception only.Check if status is within 400-499.
Sourcepub fn is_server_error(&self) -> bool
Available on crate feature exception only.
pub fn is_server_error(&self) -> bool
exception only.Check if status is within 500-599.
Source§impl StatusCode
impl StatusCode
Sourcepub const CONTINUE: StatusCode
Available on crate feature exception only.
pub const CONTINUE: StatusCode
exception only.100 Continue [RFC9110, Section 15.2.1]
Sourcepub const SWITCHING_PROTOCOLS: StatusCode
Available on crate feature exception only.
pub const SWITCHING_PROTOCOLS: StatusCode
exception only.101 Switching Protocols [RFC9110, Section 15.2.2]
Sourcepub const PROCESSING: StatusCode
Available on crate feature exception only.
pub const PROCESSING: StatusCode
exception only.102 Processing [RFC2518, Section 10.1]
Sourcepub const EARLY_HINTS: StatusCode
Available on crate feature exception only.
pub const EARLY_HINTS: StatusCode
exception only.103 Early Hints [RFC8297, Section 2]
Sourcepub const OK: StatusCode
Available on crate feature exception only.
pub const OK: StatusCode
exception only.200 OK [RFC9110, Section 15.3.1]
Sourcepub const CREATED: StatusCode
Available on crate feature exception only.
pub const CREATED: StatusCode
exception only.201 Created [RFC9110, Section 15.3.2]
Sourcepub const ACCEPTED: StatusCode
Available on crate feature exception only.
pub const ACCEPTED: StatusCode
exception only.202 Accepted [RFC9110, Section 15.3.3]
Sourcepub const NON_AUTHORITATIVE_INFORMATION: StatusCode
Available on crate feature exception only.
pub const NON_AUTHORITATIVE_INFORMATION: StatusCode
exception only.203 Non-Authoritative Information [RFC9110, Section 15.3.4]
Sourcepub const NO_CONTENT: StatusCode
Available on crate feature exception only.
pub const NO_CONTENT: StatusCode
exception only.204 No Content [RFC9110, Section 15.3.5]
Sourcepub const RESET_CONTENT: StatusCode
Available on crate feature exception only.
pub const RESET_CONTENT: StatusCode
exception only.205 Reset Content [RFC9110, Section 15.3.6]
Sourcepub const PARTIAL_CONTENT: StatusCode
Available on crate feature exception only.
pub const PARTIAL_CONTENT: StatusCode
exception only.206 Partial Content [RFC9110, Section 15.3.7]
Sourcepub const MULTI_STATUS: StatusCode
Available on crate feature exception only.
pub const MULTI_STATUS: StatusCode
exception only.207 Multi-Status [RFC4918, Section 11.1]
Sourcepub const ALREADY_REPORTED: StatusCode
Available on crate feature exception only.
pub const ALREADY_REPORTED: StatusCode
exception only.208 Already Reported [RFC5842, Section 7.1]
Sourcepub const IM_USED: StatusCode
Available on crate feature exception only.
pub const IM_USED: StatusCode
exception only.226 IM Used [RFC3229, Section 10.4.1]
Sourcepub const MULTIPLE_CHOICES: StatusCode
Available on crate feature exception only.
pub const MULTIPLE_CHOICES: StatusCode
exception only.300 Multiple Choices [RFC9110, Section 15.4.1]
Sourcepub const MOVED_PERMANENTLY: StatusCode
Available on crate feature exception only.
pub const MOVED_PERMANENTLY: StatusCode
exception only.301 Moved Permanently [RFC9110, Section 15.4.2]
Sourcepub const FOUND: StatusCode
Available on crate feature exception only.
pub const FOUND: StatusCode
exception only.302 Found [RFC9110, Section 15.4.3]
Sourcepub const SEE_OTHER: StatusCode
Available on crate feature exception only.
pub const SEE_OTHER: StatusCode
exception only.303 See Other [RFC9110, Section 15.4.4]
Sourcepub const NOT_MODIFIED: StatusCode
Available on crate feature exception only.
pub const NOT_MODIFIED: StatusCode
exception only.304 Not Modified [RFC9110, Section 15.4.5]
Sourcepub const USE_PROXY: StatusCode
Available on crate feature exception only.
pub const USE_PROXY: StatusCode
exception only.305 Use Proxy [RFC9110, Section 15.4.6]
Sourcepub const TEMPORARY_REDIRECT: StatusCode
Available on crate feature exception only.
pub const TEMPORARY_REDIRECT: StatusCode
exception only.307 Temporary Redirect [RFC9110, Section 15.4.7]
Sourcepub const PERMANENT_REDIRECT: StatusCode
Available on crate feature exception only.
pub const PERMANENT_REDIRECT: StatusCode
exception only.308 Permanent Redirect [RFC9110, Section 15.4.8]
Sourcepub const BAD_REQUEST: StatusCode
Available on crate feature exception only.
pub const BAD_REQUEST: StatusCode
exception only.400 Bad Request [RFC9110, Section 15.5.1]
Sourcepub const UNAUTHORIZED: StatusCode
Available on crate feature exception only.
pub const UNAUTHORIZED: StatusCode
exception only.401 Unauthorized [RFC9110, Section 15.5.2]
Sourcepub const PAYMENT_REQUIRED: StatusCode
Available on crate feature exception only.
pub const PAYMENT_REQUIRED: StatusCode
exception only.402 Payment Required [RFC9110, Section 15.5.3]
Sourcepub const FORBIDDEN: StatusCode
Available on crate feature exception only.
pub const FORBIDDEN: StatusCode
exception only.403 Forbidden [RFC9110, Section 15.5.4]
Sourcepub const NOT_FOUND: StatusCode
Available on crate feature exception only.
pub const NOT_FOUND: StatusCode
exception only.404 Not Found [RFC9110, Section 15.5.5]
Sourcepub const METHOD_NOT_ALLOWED: StatusCode
Available on crate feature exception only.
pub const METHOD_NOT_ALLOWED: StatusCode
exception only.405 Method Not Allowed [RFC9110, Section 15.5.6]
Sourcepub const NOT_ACCEPTABLE: StatusCode
Available on crate feature exception only.
pub const NOT_ACCEPTABLE: StatusCode
exception only.406 Not Acceptable [RFC9110, Section 15.5.7]
Sourcepub const PROXY_AUTHENTICATION_REQUIRED: StatusCode
Available on crate feature exception only.
pub const PROXY_AUTHENTICATION_REQUIRED: StatusCode
exception only.407 Proxy Authentication Required [RFC9110, Section 15.5.8]
Sourcepub const REQUEST_TIMEOUT: StatusCode
Available on crate feature exception only.
pub const REQUEST_TIMEOUT: StatusCode
exception only.408 Request Timeout [RFC9110, Section 15.5.9]
Sourcepub const CONFLICT: StatusCode
Available on crate feature exception only.
pub const CONFLICT: StatusCode
exception only.409 Conflict [RFC9110, Section 15.5.10]
Sourcepub const GONE: StatusCode
Available on crate feature exception only.
pub const GONE: StatusCode
exception only.410 Gone [RFC9110, Section 15.5.11]
Sourcepub const LENGTH_REQUIRED: StatusCode
Available on crate feature exception only.
pub const LENGTH_REQUIRED: StatusCode
exception only.411 Length Required [RFC9110, Section 15.5.12]
Sourcepub const PRECONDITION_FAILED: StatusCode
Available on crate feature exception only.
pub const PRECONDITION_FAILED: StatusCode
exception only.412 Precondition Failed [RFC9110, Section 15.5.13]
Sourcepub const PAYLOAD_TOO_LARGE: StatusCode
Available on crate feature exception only.
pub const PAYLOAD_TOO_LARGE: StatusCode
exception only.413 Payload Too Large [RFC9110, Section 15.5.14]
Sourcepub const URI_TOO_LONG: StatusCode
Available on crate feature exception only.
pub const URI_TOO_LONG: StatusCode
exception only.414 URI Too Long [RFC9110, Section 15.5.15]
Sourcepub const UNSUPPORTED_MEDIA_TYPE: StatusCode
Available on crate feature exception only.
pub const UNSUPPORTED_MEDIA_TYPE: StatusCode
exception only.415 Unsupported Media Type [RFC9110, Section 15.5.16]
Sourcepub const RANGE_NOT_SATISFIABLE: StatusCode
Available on crate feature exception only.
pub const RANGE_NOT_SATISFIABLE: StatusCode
exception only.416 Range Not Satisfiable [RFC9110, Section 15.5.17]
Sourcepub const EXPECTATION_FAILED: StatusCode
Available on crate feature exception only.
pub const EXPECTATION_FAILED: StatusCode
exception only.417 Expectation Failed [RFC9110, Section 15.5.18]
Sourcepub const IM_A_TEAPOT: StatusCode
Available on crate feature exception only.
pub const IM_A_TEAPOT: StatusCode
exception only.418 I’m a teapot [curiously not registered by IANA but RFC2324, Section 2.3.2]
Sourcepub const MISDIRECTED_REQUEST: StatusCode
Available on crate feature exception only.
pub const MISDIRECTED_REQUEST: StatusCode
exception only.421 Misdirected Request [RFC9110, Section 15.5.20]
Sourcepub const UNPROCESSABLE_ENTITY: StatusCode
Available on crate feature exception only.
pub const UNPROCESSABLE_ENTITY: StatusCode
exception only.422 Unprocessable Entity [RFC9110, Section 15.5.21]
Sourcepub const LOCKED: StatusCode
Available on crate feature exception only.
pub const LOCKED: StatusCode
exception only.423 Locked [RFC4918, Section 11.3]
Sourcepub const FAILED_DEPENDENCY: StatusCode
Available on crate feature exception only.
pub const FAILED_DEPENDENCY: StatusCode
exception only.424 Failed Dependency [RFC4918, Section 11.4]
Sourcepub const TOO_EARLY: StatusCode
Available on crate feature exception only.
pub const TOO_EARLY: StatusCode
exception only.425 Too early [RFC8470, Section 5.2]
Sourcepub const UPGRADE_REQUIRED: StatusCode
Available on crate feature exception only.
pub const UPGRADE_REQUIRED: StatusCode
exception only.426 Upgrade Required [RFC9110, Section 15.5.22]
Sourcepub const PRECONDITION_REQUIRED: StatusCode
Available on crate feature exception only.
pub const PRECONDITION_REQUIRED: StatusCode
exception only.428 Precondition Required [RFC6585, Section 3]
Sourcepub const TOO_MANY_REQUESTS: StatusCode
Available on crate feature exception only.
pub const TOO_MANY_REQUESTS: StatusCode
exception only.429 Too Many Requests [RFC6585, Section 4]
Sourcepub const REQUEST_HEADER_FIELDS_TOO_LARGE: StatusCode
Available on crate feature exception only.
pub const REQUEST_HEADER_FIELDS_TOO_LARGE: StatusCode
exception only.431 Request Header Fields Too Large [RFC6585, Section 5]
Sourcepub const UNAVAILABLE_FOR_LEGAL_REASONS: StatusCode
Available on crate feature exception only.
pub const UNAVAILABLE_FOR_LEGAL_REASONS: StatusCode
exception only.451 Unavailable For Legal Reasons [RFC7725, Section 3]
Sourcepub const INTERNAL_SERVER_ERROR: StatusCode
Available on crate feature exception only.
pub const INTERNAL_SERVER_ERROR: StatusCode
exception only.500 Internal Server Error [RFC9110, Section 15.6.1]
Sourcepub const NOT_IMPLEMENTED: StatusCode
Available on crate feature exception only.
pub const NOT_IMPLEMENTED: StatusCode
exception only.501 Not Implemented [RFC9110, Section 15.6.2]
Sourcepub const BAD_GATEWAY: StatusCode
Available on crate feature exception only.
pub const BAD_GATEWAY: StatusCode
exception only.502 Bad Gateway [RFC9110, Section 15.6.3]
Sourcepub const SERVICE_UNAVAILABLE: StatusCode
Available on crate feature exception only.
pub const SERVICE_UNAVAILABLE: StatusCode
exception only.503 Service Unavailable [RFC9110, Section 15.6.4]
Sourcepub const GATEWAY_TIMEOUT: StatusCode
Available on crate feature exception only.
pub const GATEWAY_TIMEOUT: StatusCode
exception only.504 Gateway Timeout [RFC9110, Section 15.6.5]
Sourcepub const HTTP_VERSION_NOT_SUPPORTED: StatusCode
Available on crate feature exception only.
pub const HTTP_VERSION_NOT_SUPPORTED: StatusCode
exception only.505 HTTP Version Not Supported [RFC9110, Section 15.6.6]
Sourcepub const VARIANT_ALSO_NEGOTIATES: StatusCode
Available on crate feature exception only.
pub const VARIANT_ALSO_NEGOTIATES: StatusCode
exception only.506 Variant Also Negotiates [RFC2295, Section 8.1]
Sourcepub const INSUFFICIENT_STORAGE: StatusCode
Available on crate feature exception only.
pub const INSUFFICIENT_STORAGE: StatusCode
exception only.507 Insufficient Storage [RFC4918, Section 11.5]
Sourcepub const LOOP_DETECTED: StatusCode
Available on crate feature exception only.
pub const LOOP_DETECTED: StatusCode
exception only.508 Loop Detected [RFC5842, Section 7.2]
Sourcepub const NOT_EXTENDED: StatusCode
Available on crate feature exception only.
pub const NOT_EXTENDED: StatusCode
exception only.510 Not Extended [RFC2774, Section 7]
Sourcepub const NETWORK_AUTHENTICATION_REQUIRED: StatusCode
Available on crate feature exception only.
pub const NETWORK_AUTHENTICATION_REQUIRED: StatusCode
exception only.511 Network Authentication Required [RFC6585, Section 6]
Trait Implementations§
Source§impl Clone for StatusCode
impl Clone for StatusCode
Source§fn clone(&self) -> StatusCode
fn clone(&self) -> StatusCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StatusCode
Source§impl Debug for StatusCode
impl Debug for StatusCode
Source§impl Default for StatusCode
impl Default for StatusCode
Source§fn default() -> StatusCode
fn default() -> StatusCode
Source§impl Display for StatusCode
Formats the status code, including the canonical reason.
impl Display for StatusCode
Formats the status code, including the canonical reason.
§Example
assert_eq!(format!("{}", StatusCode::OK), "200 OK");impl Eq for StatusCode
Source§impl From<&StatusCode> for StatusCode
impl From<&StatusCode> for StatusCode
Source§fn from(t: &StatusCode) -> StatusCode
fn from(t: &StatusCode) -> StatusCode
Source§impl From<StatusCode> for StatusCode
Available on crate feature http-1x only.
impl From<StatusCode> for StatusCode
http-1x only.Source§fn from(value: StatusCode) -> StatusCode
fn from(value: StatusCode) -> StatusCode
Source§impl FromStr for StatusCode
impl FromStr for StatusCode
Source§type Err = InvalidStatusCode
type Err = InvalidStatusCode
Source§fn from_str(s: &str) -> Result<StatusCode, InvalidStatusCode>
fn from_str(s: &str) -> Result<StatusCode, InvalidStatusCode>
s to return a value of this type. Read moreSource§impl Hash for StatusCode
impl Hash for StatusCode
Source§impl IntoResponse for StatusCode
impl IntoResponse for StatusCode
Source§fn into_response(self) -> Response<Body>
fn into_response(self) -> Response<Body>
Source§impl IntoResponse for StatusCode
impl IntoResponse for StatusCode
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Source§impl Ord for StatusCode
impl Ord for StatusCode
Source§fn cmp(&self, other: &StatusCode) -> Ordering
fn cmp(&self, other: &StatusCode) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for StatusCode
impl PartialEq for StatusCode
Source§impl PartialEq<u16> for StatusCode
impl PartialEq<u16> for StatusCode
Source§impl PartialOrd for StatusCode
impl PartialOrd for StatusCode
impl StructuralPartialEq for StatusCode
Source§impl TryFrom<&[u8]> for StatusCode
impl TryFrom<&[u8]> for StatusCode
Source§type Error = InvalidStatusCode
type Error = InvalidStatusCode
Source§fn try_from(
t: &[u8],
) -> Result<StatusCode, <StatusCode as TryFrom<&[u8]>>::Error>
fn try_from( t: &[u8], ) -> Result<StatusCode, <StatusCode as TryFrom<&[u8]>>::Error>
Source§impl TryFrom<&str> for StatusCode
impl TryFrom<&str> for StatusCode
Source§type Error = InvalidStatusCode
type Error = InvalidStatusCode
Source§fn try_from(t: &str) -> Result<StatusCode, <StatusCode as TryFrom<&str>>::Error>
fn try_from(t: &str) -> Result<StatusCode, <StatusCode as TryFrom<&str>>::Error>
Source§impl TryFrom<u16> for StatusCode
impl TryFrom<u16> for StatusCode
Source§type Error = InvalidStatusCode
type Error = InvalidStatusCode
Source§fn try_from(t: u16) -> Result<StatusCode, <StatusCode as TryFrom<u16>>::Error>
fn try_from(t: u16) -> Result<StatusCode, <StatusCode as TryFrom<u16>>::Error>
Auto Trait Implementations§
impl Freeze for StatusCode
impl RefUnwindSafe for StatusCode
impl Send for StatusCode
impl Sync for StatusCode
impl Unpin for StatusCode
impl UnsafeUnpin for StatusCode
impl UnwindSafe for StatusCode
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T, S> Handler<IntoResponseHandler, S> for T
impl<T, S> Handler<IntoResponseHandler, S> for T
Source§fn call(
self,
_req: Request<Body>,
_state: S,
) -> <T as Handler<IntoResponseHandler, S>>::Future
fn call( self, _req: Request<Body>, _state: S, ) -> <T as Handler<IntoResponseHandler, S>>::Future
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>>,
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>>,
tower::Layer to the handler. Read moreSource§fn with_state(self, state: S) -> HandlerService<Self, T, S>
fn with_state(self, state: S) -> HandlerService<Self, T, S>
Service by providing the stateSource§impl<H, T> HandlerWithoutStateExt<T> for H
impl<H, T> HandlerWithoutStateExt<T> for H
Source§fn into_service(self) -> HandlerService<H, T, ()>
fn into_service(self) -> HandlerService<H, T, ()>
Service and no state.Source§fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>
fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>
MakeService and no state. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
impl<N> NodeTrait for N
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().impl<T> RuleType for T
Source§impl<E> ServerFnErrorAssertions<E> for Ewhere
E: Debug,
impl<E> ServerFnErrorAssertions<E> for Ewhere
E: Debug,
Source§fn should_contain_message(&self, expected: &str)where
E: Display,
fn should_contain_message(&self, expected: &str)where
E: Display,
Source§fn should_have_message(&self, expected: &str)where
E: Display,
fn should_have_message(&self, expected: &str)where
E: Display,
Source§impl<T> SingleFromPath for T
impl<T> SingleFromPath for T
Source§fn from_path_at(ctx: &ParamContext, index: usize) -> Result<T, PathError>
fn from_path_at(ctx: &ParamContext, index: usize) -> Result<T, PathError>
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.