Struct tracing_tunnel::TracedValues
source · pub struct TracedValues<S> { /* private fields */ }
Expand description
Collection of named TracedValue
s.
Functionally this collection is similar to a HashMap<S, TracedValue>
,
with the key difference being that the order of iteration is the insertion order.
If a value is updated, including via Extend
etc., it preserves its old placement.
Implementations§
source§impl<S: From<&'static str> + AsRef<str>> TracedValues<S>
impl<S: From<&'static str> + AsRef<str>> TracedValues<S>
sourcepub fn from_values(values: &ValueSet<'_>) -> Self
pub fn from_values(values: &ValueSet<'_>) -> Self
Creates traced values from the specified value set.
sourcepub fn from_record(values: &Record<'_>) -> Self
pub fn from_record(values: &Record<'_>) -> Self
Creates traced values from the specified record.
sourcepub fn from_event(event: &Event<'_>) -> Self
pub fn from_event(event: &Event<'_>) -> Self
Creates traced values from the values in the specified event.
source§impl<S: AsRef<str>> TracedValues<S>
impl<S: AsRef<str>> TracedValues<S>
sourcepub fn get(&self, name: &str) -> Option<&TracedValue>
pub fn get(&self, name: &str) -> Option<&TracedValue>
Returns the value with the specified name, or None
if it not set.
sourcepub fn iter(&self) -> TracedValuesIter<'_, S> ⓘ
pub fn iter(&self) -> TracedValuesIter<'_, S> ⓘ
Iterates over the contained name-value pairs.
sourcepub fn insert(&mut self, name: S, value: TracedValue) -> Option<TracedValue>
pub fn insert(&mut self, name: S, value: TracedValue) -> Option<TracedValue>
Inserts a value with the specified name. If a value with the same name was present previously, it is overwritten. Returns the previous value with the specified name, if any.
Trait Implementations§
source§impl<S: Clone> Clone for TracedValues<S>
impl<S: Clone> Clone for TracedValues<S>
source§fn clone(&self) -> TracedValues<S>
fn clone(&self) -> TracedValues<S>
Returns a copy 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<S> Default for TracedValues<S>
impl<S> Default for TracedValues<S>
source§impl<'de> Deserialize<'de> for TracedValues<String>
impl<'de> Deserialize<'de> for TracedValues<String>
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<S: AsRef<str>> Extend<(S, TracedValue)> for TracedValues<S>
impl<S: AsRef<str>> Extend<(S, TracedValue)> for TracedValues<S>
source§fn extend<I: IntoIterator<Item = (S, TracedValue)>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = (S, TracedValue)>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl<S: AsRef<str>> FromIterator<(S, TracedValue)> for TracedValues<S>
impl<S: AsRef<str>> FromIterator<(S, TracedValue)> for TracedValues<S>
source§fn from_iter<I: IntoIterator<Item = (S, TracedValue)>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = (S, TracedValue)>>(iter: I) -> Self
Creates a value from an iterator. Read more
source§impl<'a, S: AsRef<str>> IntoIterator for &'a TracedValues<S>
impl<'a, S: AsRef<str>> IntoIterator for &'a TracedValues<S>
source§impl<S> IntoIterator for TracedValues<S>
impl<S> IntoIterator for TracedValues<S>
Auto Trait Implementations§
impl<S> Freeze for TracedValues<S>
impl<S> RefUnwindSafe for TracedValues<S>where
S: RefUnwindSafe,
impl<S> Send for TracedValues<S>where
S: Send,
impl<S> Sync for TracedValues<S>where
S: Sync,
impl<S> Unpin for TracedValues<S>where
S: Unpin,
impl<S> UnwindSafe for TracedValues<S>where
S: UnwindSafe,
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