Struct rama::http::HeaderValue
pub struct HeaderValue { /* private fields */ }
Expand description
Represents an HTTP header field value.
In practice, HTTP header field values are usually valid ASCII. However, the HTTP spec allows for a header value to contain opaque bytes as well. In this case, the header field value is not able to be represented as a string.
To handle this, the HeaderValue
is useable as a type and can be compared
with strings and implements Debug
. A to_str
fn is provided that returns
an Err
if the header value contains non visible ascii characters.
Implementations§
§impl HeaderValue
impl HeaderValue
pub const fn from_static(src: &'static str) -> HeaderValue
pub const fn from_static(src: &'static str) -> HeaderValue
Convert a static string to a HeaderValue
.
This function will not perform any copying, however the string is checked to ensure that no invalid characters are present. Only visible ASCII characters (32-127) are permitted.
§Panics
This function panics if the argument contains invalid header value characters.
Until Allow panicking in constants makes its way into stable, the panic message at compile-time is going to look cryptic, but should at least point at your header value:
error: any use of this value will cause an error
--> http/src/header/value.rs:67:17
|
67 | ([] as [u8; 0])[0]; // Invalid header value
| ^^^^^^^^^^^^^^^^^^
| |
| index out of bounds: the length is 0 but the index is 0
| inside `HeaderValue::from_static` at http/src/header/value.rs:67:17
| inside `INVALID_HEADER` at src/main.rs:73:33
|
::: src/main.rs:73:1
|
73 | const INVALID_HEADER: HeaderValue = HeaderValue::from_static("жsome value");
| ----------------------------------------------------------------------------
§Examples
let val = HeaderValue::from_static("hello");
assert_eq!(val, "hello");
pub fn from_str(src: &str) -> Result<HeaderValue, InvalidHeaderValue>
pub fn from_str(src: &str) -> Result<HeaderValue, InvalidHeaderValue>
Attempt to convert a string to a HeaderValue
.
If the argument contains invalid header value characters, an error is
returned. Only visible ASCII characters (32-127) are permitted. Use
from_bytes
to create a HeaderValue
that includes opaque octets
(128-255).
This function is intended to be replaced in the future by a TryFrom
implementation once the trait is stabilized in std.
§Examples
let val = HeaderValue::from_str("hello").unwrap();
assert_eq!(val, "hello");
An invalid value
let val = HeaderValue::from_str("\n");
assert!(val.is_err());
pub fn from_name(name: HeaderName) -> HeaderValue
pub fn from_name(name: HeaderName) -> HeaderValue
Converts a HeaderName into a HeaderValue
Since every valid HeaderName is a valid HeaderValue this is done infallibly.
§Examples
let val = HeaderValue::from_name(ACCEPT);
assert_eq!(val, HeaderValue::from_bytes(b"accept").unwrap());
pub fn from_bytes(src: &[u8]) -> Result<HeaderValue, InvalidHeaderValue>
pub fn from_bytes(src: &[u8]) -> Result<HeaderValue, InvalidHeaderValue>
Attempt to convert a byte slice to a HeaderValue
.
If the argument contains invalid header value bytes, an error is returned. Only byte values between 32 and 255 (inclusive) are permitted, excluding byte 127 (DEL).
This function is intended to be replaced in the future by a TryFrom
implementation once the trait is stabilized in std.
§Examples
let val = HeaderValue::from_bytes(b"hello\xfa").unwrap();
assert_eq!(val, &b"hello\xfa"[..]);
An invalid value
let val = HeaderValue::from_bytes(b"\n");
assert!(val.is_err());
Attempt to convert a Bytes
buffer to a HeaderValue
.
This will try to prevent a copy if the type passed is the type used internally, and will copy the data if it is not.
Convert a Bytes
directly into a HeaderValue
without validating.
This function does NOT validate that illegal bytes are not contained within the buffer.
§Panics
In a debug build this will panic if src
is not valid UTF-8.
§Safety
src
must contain valid UTF-8. In a release build it is undefined
behaviour to call this with src
that is not valid UTF-8.
pub fn to_str(&self) -> Result<&str, ToStrError>
pub fn to_str(&self) -> Result<&str, ToStrError>
Yields a &str
slice if the HeaderValue
only contains visible ASCII
chars.
This function will perform a scan of the header value, checking all the characters.
§Examples
let val = HeaderValue::from_static("hello");
assert_eq!(val.to_str().unwrap(), "hello");
pub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the length of self
.
This length is in bytes.
§Examples
let val = HeaderValue::from_static("hello");
assert_eq!(val.len(), 5);
pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the HeaderValue
has a length of zero bytes.
§Examples
let val = HeaderValue::from_static("");
assert!(val.is_empty());
let val = HeaderValue::from_static("hello");
assert!(!val.is_empty());
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
Converts a HeaderValue
to a byte slice.
§Examples
let val = HeaderValue::from_static("hello");
assert_eq!(val.as_bytes(), b"hello");
pub fn set_sensitive(&mut self, val: bool)
pub fn set_sensitive(&mut self, val: bool)
Mark that the header value represents sensitive information.
§Examples
let mut val = HeaderValue::from_static("my secret");
val.set_sensitive(true);
assert!(val.is_sensitive());
val.set_sensitive(false);
assert!(!val.is_sensitive());
pub fn is_sensitive(&self) -> bool
pub fn is_sensitive(&self) -> bool
Returns true
if the value represents sensitive data.
Sensitive data could represent passwords or other data that should not be stored on disk or in memory. By marking header values as sensitive, components using this crate can be instructed to treat them with special care for security reasons. For example, caches can avoid storing sensitive values, and HPACK encoders used by HTTP/2.0 implementations can choose not to compress them.
Additionally, sensitive values will be masked by the Debug
implementation of HeaderValue
.
Note that sensitivity is not factored into equality or ordering.
§Examples
let mut val = HeaderValue::from_static("my secret");
val.set_sensitive(true);
assert!(val.is_sensitive());
val.set_sensitive(false);
assert!(!val.is_sensitive());
Trait Implementations§
§impl AsRef<[u8]> for HeaderValue
impl AsRef<[u8]> for HeaderValue
§impl Clone for HeaderValue
impl Clone for HeaderValue
§fn clone(&self) -> HeaderValue
fn clone(&self) -> HeaderValue
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for HeaderValue
impl Debug for HeaderValue
source§impl<'a> From<&'a After> for HeaderValue
impl<'a> From<&'a After> for HeaderValue
source§fn from(after: &'a After) -> HeaderValue
fn from(after: &'a After) -> HeaderValue
source§impl<'a> From<&'a EntityTag> for HeaderValue
impl<'a> From<&'a EntityTag> for HeaderValue
source§fn from(tag: &'a EntityTag) -> HeaderValue
fn from(tag: &'a EntityTag) -> HeaderValue
source§impl<'a> From<&'a EntityTagRange> for HeaderValue
impl<'a> From<&'a EntityTagRange> for HeaderValue
source§fn from(tag: &'a EntityTagRange) -> HeaderValue
fn from(tag: &'a EntityTagRange) -> HeaderValue
source§impl<'a, Sep> From<&'a FlatCsv<Sep>> for HeaderValue
impl<'a, Sep> From<&'a FlatCsv<Sep>> for HeaderValue
source§fn from(flat: &'a FlatCsv<Sep>) -> HeaderValue
fn from(flat: &'a FlatCsv<Sep>) -> HeaderValue
§impl<'a> From<&'a HeaderValue> for HeaderValue
impl<'a> From<&'a HeaderValue> for HeaderValue
§fn from(t: &'a HeaderValue) -> HeaderValue
fn from(t: &'a HeaderValue) -> HeaderValue
source§impl<'a> From<&'a HeaderValueString> for HeaderValue
impl<'a> From<&'a HeaderValueString> for HeaderValue
source§fn from(src: &'a HeaderValueString) -> HeaderValue
fn from(src: &'a HeaderValueString) -> HeaderValue
source§impl<'a> From<&'a HttpDate> for HeaderValue
impl<'a> From<&'a HttpDate> for HeaderValue
source§fn from(date: &'a HttpDate) -> HeaderValue
fn from(date: &'a HttpDate) -> HeaderValue
source§impl<'a> From<&'a IfRange_> for HeaderValue
impl<'a> From<&'a IfRange_> for HeaderValue
source§fn from(if_range: &'a IfRange_) -> HeaderValue
fn from(if_range: &'a IfRange_) -> HeaderValue
source§impl<'a> From<&'a OriginOrAny> for HeaderValue
impl<'a> From<&'a OriginOrAny> for HeaderValue
source§fn from(origin: &'a OriginOrAny) -> HeaderValue
fn from(origin: &'a OriginOrAny) -> HeaderValue
source§impl<'a> From<&'a OriginOrNull> for HeaderValue
impl<'a> From<&'a OriginOrNull> for HeaderValue
source§fn from(origin: &'a OriginOrNull) -> HeaderValue
fn from(origin: &'a OriginOrNull) -> HeaderValue
source§impl<'a> From<&'a Policy> for HeaderValue
impl<'a> From<&'a Policy> for HeaderValue
source§fn from(policy: &'a Policy) -> HeaderValue
fn from(policy: &'a Policy) -> HeaderValue
source§impl<'a> From<&'a Seconds> for HeaderValue
impl<'a> From<&'a Seconds> for HeaderValue
source§fn from(secs: &'a Seconds) -> HeaderValue
fn from(secs: &'a Seconds) -> HeaderValue
source§impl From<EntityTag> for HeaderValue
impl From<EntityTag> for HeaderValue
source§fn from(tag: EntityTag) -> HeaderValue
fn from(tag: EntityTag) -> HeaderValue
§impl From<HeaderName> for HeaderValue
impl From<HeaderName> for HeaderValue
§fn from(h: HeaderName) -> HeaderValue
fn from(h: HeaderName) -> HeaderValue
§impl From<HeaderValue> for AllowOrigin
impl From<HeaderValue> for AllowOrigin
§fn from(val: HeaderValue) -> AllowOrigin
fn from(val: HeaderValue) -> AllowOrigin
§impl From<HeaderValue> for RequestId
impl From<HeaderValue> for RequestId
§fn from(value: HeaderValue) -> RequestId
fn from(value: HeaderValue) -> RequestId
source§impl From<HttpDate> for HeaderValue
impl From<HttpDate> for HeaderValue
source§fn from(date: HttpDate) -> HeaderValue
fn from(date: HttpDate) -> HeaderValue
§impl From<i16> for HeaderValue
impl From<i16> for HeaderValue
§fn from(num: i16) -> HeaderValue
fn from(num: i16) -> HeaderValue
§impl From<i32> for HeaderValue
impl From<i32> for HeaderValue
§fn from(num: i32) -> HeaderValue
fn from(num: i32) -> HeaderValue
§impl From<i64> for HeaderValue
impl From<i64> for HeaderValue
§fn from(num: i64) -> HeaderValue
fn from(num: i64) -> HeaderValue
§impl From<isize> for HeaderValue
impl From<isize> for HeaderValue
§fn from(num: isize) -> HeaderValue
fn from(num: isize) -> HeaderValue
§impl From<u16> for HeaderValue
impl From<u16> for HeaderValue
§fn from(num: u16) -> HeaderValue
fn from(num: u16) -> HeaderValue
§impl From<u32> for HeaderValue
impl From<u32> for HeaderValue
§fn from(num: u32) -> HeaderValue
fn from(num: u32) -> HeaderValue
§impl From<u64> for HeaderValue
impl From<u64> for HeaderValue
§fn from(num: u64) -> HeaderValue
fn from(num: u64) -> HeaderValue
§impl From<usize> for HeaderValue
impl From<usize> for HeaderValue
§fn from(num: usize) -> HeaderValue
fn from(num: usize) -> HeaderValue
§impl FromStr for HeaderValue
impl FromStr for HeaderValue
§type Err = InvalidHeaderValue
type Err = InvalidHeaderValue
§fn from_str(s: &str) -> Result<HeaderValue, <HeaderValue as FromStr>::Err>
fn from_str(s: &str) -> Result<HeaderValue, <HeaderValue as FromStr>::Err>
s
to return a value of this type. Read more§impl Hash for HeaderValue
impl Hash for HeaderValue
§impl<B> MakeHeaderValue<B> for HeaderValuewhere
B: Send + 'static,
impl<B> MakeHeaderValue<B> for HeaderValuewhere
B: Send + 'static,
§fn make_header_value(
self,
response: Response<B>,
) -> impl Future<Output = (Response<B>, Option<HeaderValue>)> + Send
fn make_header_value( self, response: Response<B>, ) -> impl Future<Output = (Response<B>, Option<HeaderValue>)> + Send
§impl<S, B> MakeHeaderValue<S, B> for HeaderValue
impl<S, B> MakeHeaderValue<S, B> for HeaderValue
§fn make_header_value(
&self,
ctx: Context<S>,
req: Request<B>,
) -> impl Future<Output = (Context<S>, Request<B>, Option<HeaderValue>)> + Send
fn make_header_value( &self, ctx: Context<S>, req: Request<B>, ) -> impl Future<Output = (Context<S>, Request<B>, Option<HeaderValue>)> + Send
§impl<S, ReqBody, ResBody> MakeHeaderValueFactory<S, ReqBody, ResBody> for HeaderValue
impl<S, ReqBody, ResBody> MakeHeaderValueFactory<S, ReqBody, ResBody> for HeaderValue
§type Maker = HeaderValue
type Maker = HeaderValue
§fn make_header_value_maker(
&self,
ctx: Context<S>,
req: Request<ReqBody>,
) -> impl Future<Output = (Context<S>, Request<ReqBody>, <HeaderValue as MakeHeaderValueFactory<S, ReqBody, ResBody>>::Maker)> + Send
fn make_header_value_maker( &self, ctx: Context<S>, req: Request<ReqBody>, ) -> impl Future<Output = (Context<S>, Request<ReqBody>, <HeaderValue as MakeHeaderValueFactory<S, ReqBody, ResBody>>::Maker)> + Send
§impl Ord for HeaderValue
impl Ord for HeaderValue
§impl<'a, T> PartialEq<&'a T> for HeaderValue
impl<'a, T> PartialEq<&'a T> for HeaderValue
§impl PartialEq<[u8]> for HeaderValue
impl PartialEq<[u8]> for HeaderValue
§impl<'a> PartialEq<HeaderValue> for &'a HeaderValue
impl<'a> PartialEq<HeaderValue> for &'a HeaderValue
§impl<'a> PartialEq<HeaderValue> for &'a str
impl<'a> PartialEq<HeaderValue> for &'a str
§impl PartialEq<HeaderValue> for [u8]
impl PartialEq<HeaderValue> for [u8]
§impl PartialEq<HeaderValue> for String
impl PartialEq<HeaderValue> for String
§impl PartialEq<HeaderValue> for str
impl PartialEq<HeaderValue> for str
§impl PartialEq<String> for HeaderValue
impl PartialEq<String> for HeaderValue
§impl PartialEq<str> for HeaderValue
impl PartialEq<str> for HeaderValue
§impl PartialEq for HeaderValue
impl PartialEq for HeaderValue
§impl<'a, T> PartialOrd<&'a T> for HeaderValue
impl<'a, T> PartialOrd<&'a T> for HeaderValue
§impl PartialOrd<[u8]> for HeaderValue
impl PartialOrd<[u8]> for HeaderValue
§impl<'a> PartialOrd<HeaderValue> for &'a HeaderValue
impl<'a> PartialOrd<HeaderValue> for &'a HeaderValue
§impl<'a> PartialOrd<HeaderValue> for &'a str
impl<'a> PartialOrd<HeaderValue> for &'a str
§impl PartialOrd<HeaderValue> for [u8]
impl PartialOrd<HeaderValue> for [u8]
§impl PartialOrd<HeaderValue> for String
impl PartialOrd<HeaderValue> for String
§impl PartialOrd<HeaderValue> for str
impl PartialOrd<HeaderValue> for str
§impl PartialOrd<String> for HeaderValue
impl PartialOrd<String> for HeaderValue
§impl PartialOrd<str> for HeaderValue
impl PartialOrd<str> for HeaderValue
§impl PartialOrd for HeaderValue
impl PartialOrd for HeaderValue
§impl<'a> TryFrom<&'a [u8]> for HeaderValue
impl<'a> TryFrom<&'a [u8]> for HeaderValue
§type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
§fn try_from(
t: &'a [u8],
) -> Result<HeaderValue, <HeaderValue as TryFrom<&'a [u8]>>::Error>
fn try_from( t: &'a [u8], ) -> Result<HeaderValue, <HeaderValue as TryFrom<&'a [u8]>>::Error>
§impl TryFrom<&HeaderValue> for Authority
impl TryFrom<&HeaderValue> for Authority
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
header: &HeaderValue,
) -> Result<Authority, <Authority as TryFrom<&HeaderValue>>::Error>
fn try_from( header: &HeaderValue, ) -> Result<Authority, <Authority as TryFrom<&HeaderValue>>::Error>
§impl TryFrom<&HeaderValue> for DnsResolveMode
impl TryFrom<&HeaderValue> for DnsResolveMode
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
value: &HeaderValue,
) -> Result<DnsResolveMode, <DnsResolveMode as TryFrom<&HeaderValue>>::Error>
fn try_from( value: &HeaderValue, ) -> Result<DnsResolveMode, <DnsResolveMode as TryFrom<&HeaderValue>>::Error>
§impl TryFrom<&HeaderValue> for Forwarded
impl TryFrom<&HeaderValue> for Forwarded
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
header: &HeaderValue,
) -> Result<Forwarded, <Forwarded as TryFrom<&HeaderValue>>::Error>
fn try_from( header: &HeaderValue, ) -> Result<Forwarded, <Forwarded as TryFrom<&HeaderValue>>::Error>
§impl TryFrom<&HeaderValue> for ForwardedElement
impl TryFrom<&HeaderValue> for ForwardedElement
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
header: &HeaderValue,
) -> Result<ForwardedElement, <ForwardedElement as TryFrom<&HeaderValue>>::Error>
fn try_from( header: &HeaderValue, ) -> Result<ForwardedElement, <ForwardedElement as TryFrom<&HeaderValue>>::Error>
§impl TryFrom<&HeaderValue> for Host
impl TryFrom<&HeaderValue> for Host
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
header: &HeaderValue,
) -> Result<Host, <Host as TryFrom<&HeaderValue>>::Error>
fn try_from( header: &HeaderValue, ) -> Result<Host, <Host as TryFrom<&HeaderValue>>::Error>
§impl<'a> TryFrom<&'a String> for HeaderValue
impl<'a> TryFrom<&'a String> for HeaderValue
§type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
§fn try_from(
s: &'a String,
) -> Result<HeaderValue, <HeaderValue as TryFrom<&'a String>>::Error>
fn try_from( s: &'a String, ) -> Result<HeaderValue, <HeaderValue as TryFrom<&'a String>>::Error>
§impl<'a> TryFrom<&'a str> for HeaderValue
impl<'a> TryFrom<&'a str> for HeaderValue
§type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
§fn try_from(
t: &'a str,
) -> Result<HeaderValue, <HeaderValue as TryFrom<&'a str>>::Error>
fn try_from( t: &'a str, ) -> Result<HeaderValue, <HeaderValue as TryFrom<&'a str>>::Error>
§impl TryFrom<HeaderValue> for Authority
impl TryFrom<HeaderValue> for Authority
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
header: HeaderValue,
) -> Result<Authority, <Authority as TryFrom<HeaderValue>>::Error>
fn try_from( header: HeaderValue, ) -> Result<Authority, <Authority as TryFrom<HeaderValue>>::Error>
§impl TryFrom<HeaderValue> for Forwarded
impl TryFrom<HeaderValue> for Forwarded
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
header: HeaderValue,
) -> Result<Forwarded, <Forwarded as TryFrom<HeaderValue>>::Error>
fn try_from( header: HeaderValue, ) -> Result<Forwarded, <Forwarded as TryFrom<HeaderValue>>::Error>
§impl TryFrom<HeaderValue> for ForwardedElement
impl TryFrom<HeaderValue> for ForwardedElement
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
header: HeaderValue,
) -> Result<ForwardedElement, <ForwardedElement as TryFrom<HeaderValue>>::Error>
fn try_from( header: HeaderValue, ) -> Result<ForwardedElement, <ForwardedElement as TryFrom<HeaderValue>>::Error>
§impl TryFrom<HeaderValue> for Host
impl TryFrom<HeaderValue> for Host
§type Error = OpaqueError
type Error = OpaqueError
§fn try_from(
header: HeaderValue,
) -> Result<Host, <Host as TryFrom<HeaderValue>>::Error>
fn try_from( header: HeaderValue, ) -> Result<Host, <Host as TryFrom<HeaderValue>>::Error>
§impl TryFrom<String> for HeaderValue
impl TryFrom<String> for HeaderValue
§type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
§fn try_from(
t: String,
) -> Result<HeaderValue, <HeaderValue as TryFrom<String>>::Error>
fn try_from( t: String, ) -> Result<HeaderValue, <HeaderValue as TryFrom<String>>::Error>
§impl TryFrom<Vec<u8>> for HeaderValue
impl TryFrom<Vec<u8>> for HeaderValue
§type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
impl Eq for HeaderValue
Auto Trait Implementations§
impl !Freeze for HeaderValue
impl RefUnwindSafe for HeaderValue
impl Send for HeaderValue
impl Sync for HeaderValue
impl Unpin for HeaderValue
impl UnwindSafe for HeaderValue
Blanket Implementations§
§impl<A, T> AsBits<T> for A
impl<A, T> AsBits<T> for 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Conv for T
impl<T> Conv for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§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.§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.§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.§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.§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.§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.§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.§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.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§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 more§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 more§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
§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
§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.§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.§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.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<S, P, B, E>(self, other: P) -> And<T, P>
fn and<S, P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more§impl<T> Tap for T
impl<T> Tap for T
§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 more§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 more§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 more§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 more§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 more§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 more§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.§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.§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.§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.§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.§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.§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.source§impl<T> ToHex for T
impl<T> ToHex for T
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self
into the result. Upper case
letters are used (e.g. F9B4CA
)