pub struct MetadataMap<T> { /* private fields */ }
Expand description
Implementations§
Source§impl<T> MetadataMap<T>
impl<T> MetadataMap<T>
Sourcepub fn insert<K, V>(&mut self, key: K, value: V) -> Option<T>
pub fn insert<K, V>(&mut self, key: K, value: V) -> Option<T>
Inserts a key-value pair into the map.
If the map did not have this key present, None
is returned.
If the map did have this key present, the value is updated, and the old value is returned. The key is not updated, though; it is retained as is (verbatim).
Sourcepub fn get<K>(&self, key: K) -> Option<&T>
pub fn get<K>(&self, key: K) -> Option<&T>
Gets a reference to the value associated with the given key.
Sourcepub fn get_mut<K>(&mut self, key: &K) -> Option<&mut T>
pub fn get_mut<K>(&mut self, key: &K) -> Option<&mut T>
Gets a mutable reference to the value associated with the given key.
Sourcepub fn remove<K>(&mut self, key: &K) -> Option<T>
pub fn remove<K>(&mut self, key: &K) -> Option<T>
Removes a key from the map, returning the value at the key if the key was previously in the map.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears the map, removing all key-value pairs. Keeps the allocated memory for reuse.
Sourcepub fn iter(&self) -> Iter<'_, Cow<'static, str>, T>
pub fn iter(&self) -> Iter<'_, Cow<'static, str>, T>
Returns an iterator over the map’s entries.
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, Cow<'static, str>, T>
pub fn iter_mut(&mut self) -> IterMut<'_, Cow<'static, str>, T>
Returns a mutable iterator over the map’s entries.
Trait Implementations§
Source§impl<T: Clone> Clone for MetadataMap<T>
impl<T: Clone> Clone for MetadataMap<T>
Source§fn clone(&self) -> MetadataMap<T>
fn clone(&self) -> MetadataMap<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for MetadataMap<T>
impl<T: Debug> Debug for MetadataMap<T>
Source§impl<T: Default> Default for MetadataMap<T>
impl<T: Default> Default for MetadataMap<T>
Source§fn default() -> MetadataMap<T>
fn default() -> MetadataMap<T>
Returns the “default value” for a type. Read more
Source§impl<Ctx> FromJobCallParts<Ctx> for MetadataMap<MetadataValue>
impl<Ctx> FromJobCallParts<Ctx> for MetadataMap<MetadataValue>
Source§impl IntoJobResult for MetadataMap<MetadataValue>
impl IntoJobResult for MetadataMap<MetadataValue>
Source§fn into_job_result(self) -> Option<JobResult>
fn into_job_result(self) -> Option<JobResult>
Create a JobResult.
Source§impl IntoJobResultParts for MetadataMap<MetadataValue>
impl IntoJobResultParts for MetadataMap<MetadataValue>
Source§type Error = Box<dyn Error + Send + Sync>
type Error = Box<dyn Error + Send + Sync>
The type returned in the event of an error. Read more
Source§fn into_job_result_parts(
self,
res: JobResultParts,
) -> Result<JobResultParts, Self::Error>
fn into_job_result_parts( self, res: JobResultParts, ) -> Result<JobResultParts, Self::Error>
Set parts of the response
Source§impl<T: PartialEq> PartialEq for MetadataMap<T>
impl<T: PartialEq> PartialEq for MetadataMap<T>
impl<T> StructuralPartialEq for MetadataMap<T>
Auto Trait Implementations§
impl<T> Freeze for MetadataMap<T>
impl<T> RefUnwindSafe for MetadataMap<T>where
T: RefUnwindSafe,
impl<T> Send for MetadataMap<T>where
T: Send,
impl<T> Sync for MetadataMap<T>where
T: Sync,
impl<T> Unpin for MetadataMap<T>
impl<T> UnwindSafe for MetadataMap<T>where
T: RefUnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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<H, T> JobWithoutContextExt<T> for H
impl<H, T> JobWithoutContextExt<T> for H
Source§fn into_service(self) -> JobService<H, T, ()>
fn into_service(self) -> JobService<H, T, ()>
Convert the handler into a
Service
and no context.