Struct uiuifree_actix_web_util::http::header::HeaderMap
[−]pub struct HeaderMap { /* private fields */ }Expand description
A multi-map of HTTP headers.
HeaderMap is a “multi-map” of HeaderName to one or more HeaderValues.
Examples
use actix_http::header::{self, HeaderMap, HeaderValue};
let mut map = HeaderMap::new();
map.insert(header::CONTENT_TYPE, HeaderValue::from_static("text/plain"));
map.insert(header::ORIGIN, HeaderValue::from_static("example.com"));
assert!(map.contains_key(header::CONTENT_TYPE));
assert!(map.contains_key(header::ORIGIN));
let mut removed = map.remove(header::ORIGIN);
assert_eq!(removed.next().unwrap(), "example.com");
assert!(!map.contains_key(header::ORIGIN));Implementations
impl HeaderMap
impl HeaderMap
pub fn new() -> HeaderMap
pub fn new() -> HeaderMap
Create an empty HeaderMap.
The map will be created without any capacity; this function will not allocate.
Examples
let map = HeaderMap::new();
assert!(map.is_empty());
assert_eq!(0, map.capacity());pub fn with_capacity(capacity: usize) -> HeaderMap
pub fn with_capacity(capacity: usize) -> HeaderMap
Create an empty HeaderMap with the specified capacity.
The map will be able to hold at least capacity elements without needing to reallocate.
If capacity is 0, the map will be created without allocating.
Examples
let map = HeaderMap::with_capacity(16);
assert!(map.is_empty());
assert!(map.capacity() >= 16);pub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of values stored in the map.
See also: len_keys.
Examples
let mut map = HeaderMap::new();
assert_eq!(map.len(), 0);
map.insert(header::ACCEPT, HeaderValue::from_static("text/plain"));
map.insert(header::SET_COOKIE, HeaderValue::from_static("one=1"));
assert_eq!(map.len(), 2);
map.append(header::SET_COOKIE, HeaderValue::from_static("two=2"));
assert_eq!(map.len(), 3);pub fn len_keys(&self) -> usize
pub fn len_keys(&self) -> usize
Returns the number of keys stored in the map.
The number of values stored will be at least this number. See also: Self::len.
Examples
let mut map = HeaderMap::new();
assert_eq!(map.len_keys(), 0);
map.insert(header::ACCEPT, HeaderValue::from_static("text/plain"));
map.insert(header::SET_COOKIE, HeaderValue::from_static("one=1"));
assert_eq!(map.len_keys(), 2);
map.append(header::SET_COOKIE, HeaderValue::from_static("two=2"));
assert_eq!(map.len_keys(), 2);pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the map contains no elements.
Examples
let mut map = HeaderMap::new();
assert!(map.is_empty());
map.insert(header::ACCEPT, HeaderValue::from_static("text/plain"));
assert!(!map.is_empty());pub fn clear(&mut self)
pub fn clear(&mut self)
Clears the map, removing all name-value pairs.
Keeps the allocated memory for reuse.
Examples
let mut map = HeaderMap::new();
map.insert(header::ACCEPT, HeaderValue::from_static("text/plain"));
map.insert(header::SET_COOKIE, HeaderValue::from_static("one=1"));
assert_eq!(map.len(), 2);
map.clear();
assert!(map.is_empty());pub fn get(&self, key: impl AsHeaderName) -> Option<&HeaderValue>
pub fn get(&self, key: impl AsHeaderName) -> Option<&HeaderValue>
Returns a reference to the first value associated with a header name.
Returns None if there is no value associated with the key.
Even when multiple values are associated with the key, the “first” one is returned but is
not guaranteed to be chosen with any particular order; though, the returned item will be
consistent for each call to get if the map has not changed.
See also: get_all.
Examples
let mut map = HeaderMap::new();
map.insert(header::SET_COOKIE, HeaderValue::from_static("one=1"));
let cookie = map.get(header::SET_COOKIE).unwrap();
assert_eq!(cookie, "one=1");
map.append(header::SET_COOKIE, HeaderValue::from_static("two=2"));
assert_eq!(map.get(header::SET_COOKIE).unwrap(), "one=1");
assert_eq!(map.get(header::SET_COOKIE), map.get("set-cookie"));
assert_eq!(map.get(header::SET_COOKIE), map.get("Set-Cookie"));
assert!(map.get(header::HOST).is_none());
assert!(map.get("INVALID HEADER NAME").is_none());pub fn get_mut(&mut self, key: impl AsHeaderName) -> Option<&mut HeaderValue>
pub fn get_mut(&mut self, key: impl AsHeaderName) -> Option<&mut HeaderValue>
Returns a mutable reference to the first value associated a header name.
Returns None if there is no value associated with the key.
Even when multiple values are associated with the key, the “first” one is returned but is
not guaranteed to be chosen with any particular order; though, the returned item will be
consistent for each call to get_mut if the map has not changed.
See also: get_all.
Examples
let mut map = HeaderMap::new();
map.insert(header::SET_COOKIE, HeaderValue::from_static("one=1"));
let mut cookie = map.get_mut(header::SET_COOKIE).unwrap();
assert_eq!(cookie, "one=1");
*cookie = HeaderValue::from_static("three=3");
assert_eq!(map.get(header::SET_COOKIE).unwrap(), "three=3");
assert!(map.get(header::HOST).is_none());
assert!(map.get("INVALID HEADER NAME").is_none());pub fn get_all(&self, key: impl AsHeaderName) -> Iter<'_, HeaderValue>
pub fn get_all(&self, key: impl AsHeaderName) -> Iter<'_, HeaderValue>
Returns an iterator over all values associated with a header name.
The returned iterator does not incur any allocations and will yield no items if there are no values associated with the key. Iteration order is guaranteed to be the same as insertion order.
Examples
let mut map = HeaderMap::new();
let mut none_iter = map.get_all(header::ORIGIN);
assert!(none_iter.next().is_none());
map.insert(header::SET_COOKIE, HeaderValue::from_static("one=1"));
map.append(header::SET_COOKIE, HeaderValue::from_static("two=2"));
let mut set_cookies_iter = map.get_all(header::SET_COOKIE);
assert_eq!(set_cookies_iter.next().unwrap(), "one=1");
assert_eq!(set_cookies_iter.next().unwrap(), "two=2");
assert!(set_cookies_iter.next().is_none());pub fn contains_key(&self, key: impl AsHeaderName) -> bool
pub fn contains_key(&self, key: impl AsHeaderName) -> bool
Returns true if the map contains a value for the specified key.
Invalid header names will simply return false.
Examples
let mut map = HeaderMap::new();
assert!(!map.contains_key(header::ACCEPT));
map.insert(header::ACCEPT, HeaderValue::from_static("text/plain"));
assert!(map.contains_key(header::ACCEPT));pub fn insert(&mut self, key: HeaderName, val: HeaderValue) -> RemovedⓘNotable traits for Removedimpl Iterator for Removed type Item = HeaderValue;
pub fn insert(&mut self, key: HeaderName, val: HeaderValue) -> RemovedⓘNotable traits for Removedimpl Iterator for Removed type Item = HeaderValue;
Inserts (overrides) a name-value pair in the map.
If the map already contained this key, the new value is associated with the key and all
previous values are removed and returned as a Removed iterator. The key is not updated;
this matters for types that can be == without being identical.
Examples
let mut map = HeaderMap::new();
map.insert(header::ACCEPT, HeaderValue::from_static("text/plain"));
assert!(map.contains_key(header::ACCEPT));
assert_eq!(map.len(), 1);
let mut removed = map.insert(header::ACCEPT, HeaderValue::from_static("text/csv"));
assert_eq!(removed.next().unwrap(), "text/plain");
assert!(removed.next().is_none());
assert_eq!(map.len(), 1);A convenience method is provided on the returned iterator to check if the insertion replaced any values.
let mut map = HeaderMap::new();
let removed = map.insert(header::ACCEPT, HeaderValue::from_static("text/plain"));
assert!(removed.is_empty());
let removed = map.insert(header::ACCEPT, HeaderValue::from_static("text/html"));
assert!(!removed.is_empty());pub fn append(&mut self, key: HeaderName, value: HeaderValue)
pub fn append(&mut self, key: HeaderName, value: HeaderValue)
Appends a name-value pair to the map.
If the map already contained this key, the new value is added to the list of values
currently associated with the key. The key is not updated; this matters for types that can
be == without being identical.
Examples
let mut map = HeaderMap::new();
map.append(header::HOST, HeaderValue::from_static("example.com"));
assert_eq!(map.len(), 1);
map.append(header::ACCEPT, HeaderValue::from_static("text/csv"));
assert_eq!(map.len(), 2);
map.append(header::ACCEPT, HeaderValue::from_static("text/html"));
assert_eq!(map.len(), 3);pub fn remove(&mut self, key: impl AsHeaderName) -> RemovedⓘNotable traits for Removedimpl Iterator for Removed type Item = HeaderValue;
pub fn remove(&mut self, key: impl AsHeaderName) -> RemovedⓘNotable traits for Removedimpl Iterator for Removed type Item = HeaderValue;
Removes all headers for a particular header name from the map.
Providing an invalid header names (as a string argument) will have no effect and return without error.
Examples
let mut map = HeaderMap::new();
map.append(header::SET_COOKIE, HeaderValue::from_static("one=1"));
map.append(header::SET_COOKIE, HeaderValue::from_static("one=2"));
assert_eq!(map.len(), 2);
let mut removed = map.remove(header::SET_COOKIE);
assert_eq!(removed.next().unwrap(), "one=1");
assert_eq!(removed.next().unwrap(), "one=2");
assert!(removed.next().is_none());
assert!(map.is_empty());A convenience method is provided on the returned iterator to check if the remove call
actually removed any values.
let mut map = HeaderMap::new();
let removed = map.remove("accept");
assert!(removed.is_empty());
map.insert(header::ACCEPT, HeaderValue::from_static("text/html"));
let removed = map.remove("accept");
assert!(!removed.is_empty());pub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of single-value headers the map can hold without needing to reallocate.
Since this is a multi-value map, the actual capacity is much larger when considering
each header name can be associated with an arbitrary number of values. The effect is that
the size of len may be greater than capacity since it counts all the values.
Conversely, len_keys will never be larger than capacity.
Examples
let map = HeaderMap::with_capacity(16);
assert!(map.is_empty());
assert!(map.capacity() >= 16);pub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional more headers to be inserted in the map.
The header map may reserve more space to avoid frequent reallocations. Additional capacity only considers single-value headers.
Panics
Panics if the new allocation size overflows usize.
Examples
let mut map = HeaderMap::with_capacity(2);
assert!(map.capacity() >= 2);
map.reserve(100);
assert!(map.capacity() >= 102);
assert!(map.is_empty());pub fn iter(&self) -> Iter<'_>ⓘNotable traits for Iter<'a>impl<'a> Iterator for Iter<'a> type Item = (&'a HeaderName, &'a HeaderValue);
pub fn iter(&self) -> Iter<'_>ⓘNotable traits for Iter<'a>impl<'a> Iterator for Iter<'a> type Item = (&'a HeaderName, &'a HeaderValue);
An iterator over all name-value pairs.
Names will be yielded for each associated value. So, if a key has 3 associated values, it will be yielded 3 times. The iteration order should be considered arbitrary.
Examples
let mut map = HeaderMap::new();
let mut iter = map.iter();
assert!(iter.next().is_none());
map.append(header::HOST, HeaderValue::from_static("duck.com"));
map.append(header::SET_COOKIE, HeaderValue::from_static("one=1"));
map.append(header::SET_COOKIE, HeaderValue::from_static("two=2"));
let mut iter = map.iter();
assert!(iter.next().is_some());
assert!(iter.next().is_some());
assert!(iter.next().is_some());
assert!(iter.next().is_none());
let pairs = map.iter().collect::<Vec<_>>();
assert!(pairs.contains(&(&header::HOST, &HeaderValue::from_static("duck.com"))));
assert!(pairs.contains(&(&header::SET_COOKIE, &HeaderValue::from_static("one=1"))));
assert!(pairs.contains(&(&header::SET_COOKIE, &HeaderValue::from_static("two=2"))));pub fn keys(&self) -> Keys<'_>ⓘNotable traits for Keys<'a>impl<'a> Iterator for Keys<'a> type Item = &'a HeaderName;
pub fn keys(&self) -> Keys<'_>ⓘNotable traits for Keys<'a>impl<'a> Iterator for Keys<'a> type Item = &'a HeaderName;
An iterator over all contained header names.
Each name will only be yielded once even if it has multiple associated values. The iteration order should be considered arbitrary.
Examples
let mut map = HeaderMap::new();
let mut iter = map.keys();
assert!(iter.next().is_none());
map.append(header::HOST, HeaderValue::from_static("duck.com"));
map.append(header::SET_COOKIE, HeaderValue::from_static("one=1"));
map.append(header::SET_COOKIE, HeaderValue::from_static("two=2"));
let keys = map.keys().cloned().collect::<Vec<_>>();
assert_eq!(keys.len(), 2);
assert!(keys.contains(&header::HOST));
assert!(keys.contains(&header::SET_COOKIE));pub fn drain(&mut self) -> Drain<'_>ⓘNotable traits for Drain<'a>impl<'a> Iterator for Drain<'a> type Item = (Option<HeaderName>, HeaderValue);
pub fn drain(&mut self) -> Drain<'_>ⓘNotable traits for Drain<'a>impl<'a> Iterator for Drain<'a> type Item = (Option<HeaderName>, HeaderValue);
Clears the map, returning all name-value sets as an iterator.
Header names will only be yielded for the first value in each set. All items that are yielded without a name and after an item with a name are associated with that same name. The first item will always contain a name.
Keeps the allocated memory for reuse.
Examples
let mut map = HeaderMap::new();
let mut iter = map.drain();
assert!(iter.next().is_none());
drop(iter);
map.append(header::SET_COOKIE, HeaderValue::from_static("one=1"));
map.append(header::SET_COOKIE, HeaderValue::from_static("two=2"));
let mut iter = map.drain();
assert_eq!(iter.next().unwrap(), (Some(header::SET_COOKIE), HeaderValue::from_static("one=1")));
assert_eq!(iter.next().unwrap(), (None, HeaderValue::from_static("two=2")));
drop(iter);
assert!(map.is_empty());Trait Implementations
impl From<HeaderMap<HeaderValue>> for HeaderMap
impl From<HeaderMap<HeaderValue>> for HeaderMap
Convert http::HeaderMap to our HeaderMap.
fn from(map: HeaderMap<HeaderValue>) -> HeaderMap
fn from(map: HeaderMap<HeaderValue>) -> HeaderMap
Converts to this type from the input type.
impl<'a> IntoIterator for &'a HeaderMap
impl<'a> IntoIterator for &'a HeaderMap
type Item = (&'a HeaderName, &'a HeaderValue)
type Item = (&'a HeaderName, &'a HeaderValue)
The type of the elements being iterated over.
fn into_iter(self) -> <&'a HeaderMap as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a HeaderMap as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
impl IntoIterator for HeaderMap
impl IntoIterator for HeaderMap
Note that this implementation will clone a HeaderName for each value. Consider using
drain to control header name cloning.
type Item = (HeaderName, HeaderValue)
type Item = (HeaderName, HeaderValue)
The type of the elements being iterated over.
fn into_iter(self) -> <HeaderMap as IntoIterator>::IntoIter
fn into_iter(self) -> <HeaderMap as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Auto Trait Implementations
impl RefUnwindSafe for HeaderMap
impl Send for HeaderMap
impl Sync for HeaderMap
impl Unpin for HeaderMap
impl UnwindSafe for HeaderMap
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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,
Causes 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,
Causes self to use its Display implementation when
Debug-formatted. Read more
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Causes self to use its LowerExp implementation when
Debug-formatted. Read more
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Causes self to use its LowerHex implementation when
Debug-formatted. Read more
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
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,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Causes self to use its Pointer implementation when
Debug-formatted. Read more
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Causes self to use its UpperExp implementation when
Debug-formatted. Read more
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Causes self to use its UpperHex implementation when
Debug-formatted. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T, U, I> LiftInto<U, I> for T where
U: LiftFrom<T, I>,
impl<T, U, I> LiftInto<U, I> for T where
U: LiftFrom<T, I>,
fn lift_into(self) -> U
fn lift_into(self) -> U
Performs the indexed conversion.
impl<T> Pipe for T where
T: ?Sized,
impl<T> Pipe for T where
T: ?Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
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,
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,
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,
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,
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,
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,
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. Read more
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,
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.
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Tap for T
impl<T> Tap for T
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
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,
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,
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,
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,
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,
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
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
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls .tap_mut() only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
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. Read more
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
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. Read more
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
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. Read more
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
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. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more