Struct rama::http::StatusCode

pub struct StatusCode(/* private fields */);
Expand description

An HTTP status code (status-code in RFC 7230 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§

§

impl StatusCode

pub fn from_u16(src: u16) -> Result<StatusCode, InvalidStatusCode>

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());

pub fn from_bytes(src: &[u8]) -> Result<StatusCode, InvalidStatusCode>

Converts a &u8 to a status code

pub fn as_u16(&self) -> u16

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

pub fn as_str(&self) -> &str

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");

pub fn canonical_reason(&self) -> Option<&'static str>

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"));

pub fn is_informational(&self) -> bool

Check if status is within 100-199.

pub fn is_success(&self) -> bool

Check if status is within 200-299.

pub fn is_redirection(&self) -> bool

Check if status is within 300-399.

pub fn is_client_error(&self) -> bool

Check if status is within 400-499.

pub fn is_server_error(&self) -> bool

Check if status is within 500-599.

§

impl StatusCode

pub const CONTINUE: StatusCode = _

100 Continue [RFC7231, Section 6.2.1]

pub const SWITCHING_PROTOCOLS: StatusCode = _

101 Switching Protocols [RFC7231, Section 6.2.2]

pub const PROCESSING: StatusCode = _

102 Processing [RFC2518]

pub const OK: StatusCode = _

pub const CREATED: StatusCode = _

201 Created [RFC7231, Section 6.3.2]

pub const ACCEPTED: StatusCode = _

202 Accepted [RFC7231, Section 6.3.3]

pub const NON_AUTHORITATIVE_INFORMATION: StatusCode = _

203 Non-Authoritative Information [RFC7231, Section 6.3.4]

pub const NO_CONTENT: StatusCode = _

204 No Content [RFC7231, Section 6.3.5]

pub const RESET_CONTENT: StatusCode = _

205 Reset Content [RFC7231, Section 6.3.6]

pub const PARTIAL_CONTENT: StatusCode = _

206 Partial Content [RFC7233, Section 4.1]

pub const MULTI_STATUS: StatusCode = _

207 Multi-Status [RFC4918]

pub const ALREADY_REPORTED: StatusCode = _

208 Already Reported [RFC5842]

pub const IM_USED: StatusCode = _

226 IM Used [RFC3229]

pub const MULTIPLE_CHOICES: StatusCode = _

300 Multiple Choices [RFC7231, Section 6.4.1]

pub const MOVED_PERMANENTLY: StatusCode = _

301 Moved Permanently [RFC7231, Section 6.4.2]

pub const FOUND: StatusCode = _

pub const SEE_OTHER: StatusCode = _

303 See Other [RFC7231, Section 6.4.4]

pub const NOT_MODIFIED: StatusCode = _

304 Not Modified [RFC7232, Section 4.1]

pub const USE_PROXY: StatusCode = _

305 Use Proxy [RFC7231, Section 6.4.5]

pub const TEMPORARY_REDIRECT: StatusCode = _

307 Temporary Redirect [RFC7231, Section 6.4.7]

pub const PERMANENT_REDIRECT: StatusCode = _

308 Permanent Redirect [RFC7238]

pub const BAD_REQUEST: StatusCode = _

400 Bad Request [RFC7231, Section 6.5.1]

pub const UNAUTHORIZED: StatusCode = _

401 Unauthorized [RFC7235, Section 3.1]

pub const PAYMENT_REQUIRED: StatusCode = _

402 Payment Required [RFC7231, Section 6.5.2]

pub const FORBIDDEN: StatusCode = _

403 Forbidden [RFC7231, Section 6.5.3]

pub const NOT_FOUND: StatusCode = _

404 Not Found [RFC7231, Section 6.5.4]

pub const METHOD_NOT_ALLOWED: StatusCode = _

405 Method Not Allowed [RFC7231, Section 6.5.5]

pub const NOT_ACCEPTABLE: StatusCode = _

406 Not Acceptable [RFC7231, Section 6.5.6]

pub const PROXY_AUTHENTICATION_REQUIRED: StatusCode = _

407 Proxy Authentication Required [RFC7235, Section 3.2]

pub const REQUEST_TIMEOUT: StatusCode = _

408 Request Timeout [RFC7231, Section 6.5.7]

pub const CONFLICT: StatusCode = _

409 Conflict [RFC7231, Section 6.5.8]

pub const GONE: StatusCode = _

pub const LENGTH_REQUIRED: StatusCode = _

411 Length Required [RFC7231, Section 6.5.10]

pub const PRECONDITION_FAILED: StatusCode = _

412 Precondition Failed [RFC7232, Section 4.2]

pub const PAYLOAD_TOO_LARGE: StatusCode = _

413 Payload Too Large [RFC7231, Section 6.5.11]

pub const URI_TOO_LONG: StatusCode = _

414 URI Too Long [RFC7231, Section 6.5.12]

pub const UNSUPPORTED_MEDIA_TYPE: StatusCode = _

415 Unsupported Media Type [RFC7231, Section 6.5.13]

pub const RANGE_NOT_SATISFIABLE: StatusCode = _

416 Range Not Satisfiable [RFC7233, Section 4.4]

pub const EXPECTATION_FAILED: StatusCode = _

417 Expectation Failed [RFC7231, Section 6.5.14]

pub const IM_A_TEAPOT: StatusCode = _

418 I’m a teapot [curiously not registered by IANA but RFC2324]

pub const MISDIRECTED_REQUEST: StatusCode = _

421 Misdirected Request RFC7540, Section 9.1.2

pub const UNPROCESSABLE_ENTITY: StatusCode = _

422 Unprocessable Entity [RFC4918]

pub const LOCKED: StatusCode = _

423 Locked [RFC4918]

pub const FAILED_DEPENDENCY: StatusCode = _

424 Failed Dependency [RFC4918]

pub const UPGRADE_REQUIRED: StatusCode = _

426 Upgrade Required [RFC7231, Section 6.5.15]

pub const PRECONDITION_REQUIRED: StatusCode = _

428 Precondition Required [RFC6585]

pub const TOO_MANY_REQUESTS: StatusCode = _

429 Too Many Requests [RFC6585]

pub const REQUEST_HEADER_FIELDS_TOO_LARGE: StatusCode = _

431 Request Header Fields Too Large [RFC6585]

451 Unavailable For Legal Reasons [RFC7725]

pub const INTERNAL_SERVER_ERROR: StatusCode = _

500 Internal Server Error [RFC7231, Section 6.6.1]

pub const NOT_IMPLEMENTED: StatusCode = _

501 Not Implemented [RFC7231, Section 6.6.2]

pub const BAD_GATEWAY: StatusCode = _

502 Bad Gateway [RFC7231, Section 6.6.3]

pub const SERVICE_UNAVAILABLE: StatusCode = _

503 Service Unavailable [RFC7231, Section 6.6.4]

pub const GATEWAY_TIMEOUT: StatusCode = _

504 Gateway Timeout [RFC7231, Section 6.6.5]

pub const HTTP_VERSION_NOT_SUPPORTED: StatusCode = _

505 HTTP Version Not Supported [RFC7231, Section 6.6.6]

pub const VARIANT_ALSO_NEGOTIATES: StatusCode = _

506 Variant Also Negotiates [RFC2295]

pub const INSUFFICIENT_STORAGE: StatusCode = _

507 Insufficient Storage [RFC4918]

pub const LOOP_DETECTED: StatusCode = _

508 Loop Detected [RFC5842]

pub const NOT_EXTENDED: StatusCode = _

510 Not Extended [RFC2774]

pub const NETWORK_AUTHENTICATION_REQUIRED: StatusCode = _

511 Network Authentication Required [RFC6585]

Trait Implementations§

§

impl Clone for StatusCode

§

fn clone(&self) -> StatusCode

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
§

impl Debug for StatusCode

§

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

Formats the value using the given formatter. Read more
§

impl Default for StatusCode

§

fn default() -> StatusCode

Returns the “default value” for a type. Read more
§

impl Display for StatusCode

Formats the status code, including the canonical reason.

§Example

assert_eq!(format!("{}", StatusCode::OK), "200 OK");
§

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

Formats the value using the given formatter. Read more
§

impl<'a> From<&'a StatusCode> for StatusCode

§

fn from(t: &'a StatusCode) -> StatusCode

Converts to this type from the input type.
§

impl FromStr for StatusCode

§

type Err = InvalidStatusCode

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<StatusCode, InvalidStatusCode>

Parses a string s to return a value of this type. Read more
§

impl Hash for StatusCode

§

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

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
§

impl IntoResponse for StatusCode

§

fn into_response(self) -> Response<Body>

Create a response.
§

impl Ord for StatusCode

§

fn cmp(&self, other: &StatusCode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq<u16> for StatusCode

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq for StatusCode

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for StatusCode

§

fn partial_cmp(&self, other: &StatusCode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl<'a> TryFrom<&'a [u8]> for StatusCode

§

type Error = InvalidStatusCode

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

fn try_from( t: &'a [u8], ) -> Result<StatusCode, <StatusCode as TryFrom<&'a [u8]>>::Error>

Performs the conversion.
§

impl<'a> TryFrom<&'a str> for StatusCode

§

type Error = InvalidStatusCode

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

fn try_from( t: &'a str, ) -> Result<StatusCode, <StatusCode as TryFrom<&'a str>>::Error>

Performs the conversion.
§

impl TryFrom<u16> for StatusCode

§

type Error = InvalidStatusCode

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

fn try_from(t: u16) -> Result<StatusCode, <StatusCode as TryFrom<u16>>::Error>

Performs the conversion.
§

impl Copy for StatusCode

§

impl Eq for StatusCode

§

impl StructuralPartialEq for StatusCode

Auto Trait Implementations§

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, dst: *mut T)

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

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

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

§

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

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

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

§

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

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

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

§

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

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

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

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

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
§

impl<State, R> IntoEndpointService<State, ()> for R
where State: Clone + Send + Sync + 'static, R: IntoResponse + Clone + Send + Sync + 'static,

§

fn into_endpoint_service( self, ) -> impl Service<State, Request<Body>, Response = Response<Body>, Error = Infallible>

convert the type into a rama_core::Service.
§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<S, P, B, E>(self, other: P) -> And<T, P>
where T: Policy<S, B, E>, P: Policy<S, B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
§

fn or<S, P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<S, B, E>, P: Policy<S, B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
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
§

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

§

impl<T> MaybeSendSync for T