pub struct ObservationSet { /* private fields */ }Expand description
Deterministically ordered, path-addressed observations from one operation.
Implementations§
Source§impl ObservationSet
impl ObservationSet
Sourcepub fn insert(
&mut self,
path: impl Into<String>,
value: ObservationValue,
) -> Result<(), ObservationError>
pub fn insert( &mut self, path: impl Into<String>, value: ObservationValue, ) -> Result<(), ObservationError>
Inserts one uniquely named observation.
Sourcepub fn get(&self, path: &str) -> Option<&ObservationValue>
pub fn get(&self, path: &str) -> Option<&ObservationValue>
Looks up an observation by its stable path.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &ObservationValue)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &ObservationValue)>
Iterates in stable path order.
Sourcepub fn prefixed(self, prefix: &str) -> Result<Self, ObservationError>
pub fn prefixed(self, prefix: &str) -> Result<Self, ObservationError>
Adds a prefix to every path, preserving deterministic order.
Sourcepub fn extend(&mut self, other: Self) -> Result<(), ObservationError>
pub fn extend(&mut self, other: Self) -> Result<(), ObservationError>
Extends this set, rejecting path collisions.
Trait Implementations§
Source§impl Clone for ObservationSet
impl Clone for ObservationSet
Source§fn clone(&self) -> ObservationSet
fn clone(&self) -> ObservationSet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ObservationSet
impl Debug for ObservationSet
Source§impl Default for ObservationSet
impl Default for ObservationSet
Source§fn default() -> ObservationSet
fn default() -> ObservationSet
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ObservationSet
impl<'de> Deserialize<'de> for ObservationSet
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 PartialEq for ObservationSet
impl PartialEq for ObservationSet
Source§impl Serialize for ObservationSet
impl Serialize for ObservationSet
impl StructuralPartialEq for ObservationSet
Auto Trait Implementations§
impl Freeze for ObservationSet
impl RefUnwindSafe for ObservationSet
impl Send for ObservationSet
impl Sync for ObservationSet
impl Unpin for ObservationSet
impl UnsafeUnpin for ObservationSet
impl UnwindSafe for ObservationSet
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