Struct ZeroclawAttribution
pub struct ZeroclawAttribution {
pub fields: BTreeMap<String, String>,
pub duration_ms: Option<u64>,
}Fields§
§fields: BTreeMap<String, String>§duration_ms: Option<u64>Per-event duration when applicable. Kept off fields so JSON
readers see a number, not a stringified number.
Implementations§
Source§impl ZeroclawAttribution
impl ZeroclawAttribution
pub fn get(&self, key: &str) -> Option<&str>
pub fn set(&mut self, key: impl Into<String>, value: impl Into<String>)
Sourcepub fn set_composite(&mut self, prefix: &str, composite: &str)
pub fn set_composite(&mut self, prefix: &str, composite: &str)
Set a composite-prefixed attribution by splitting composite at
the first . — populates <prefix>, <prefix>_type, and
(when the dotted form is present) <prefix>_alias in one call.
Sourcepub fn merge_from(&mut self, other: &Self)
pub fn merge_from(&mut self, other: &Self)
Fill any key absent on self from other. The flat-map shape
means composite groups move as a unit naturally (all three keys
merge independently, but the composite-prefix setter always
writes all three together, so the parent’s set is consistent).
Sourcepub fn is_fully_populated(&self) -> bool
pub fn is_fully_populated(&self) -> bool
True when every plain field in ATTRIBUTION_FIELDS and every
composite in COMPOSITE_PREFIXES has been populated — the
span-walk uses this as a “no point looking further up” check.
Trait Implementations§
Source§impl Clone for ZeroclawAttribution
impl Clone for ZeroclawAttribution
Source§fn clone(&self) -> ZeroclawAttribution
fn clone(&self) -> ZeroclawAttribution
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ZeroclawAttribution
impl Debug for ZeroclawAttribution
Source§impl Default for ZeroclawAttribution
impl Default for ZeroclawAttribution
Source§fn default() -> ZeroclawAttribution
fn default() -> ZeroclawAttribution
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ZeroclawAttribution
impl<'de> Deserialize<'de> for ZeroclawAttribution
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
Auto Trait Implementations§
impl Freeze for ZeroclawAttribution
impl RefUnwindSafe for ZeroclawAttribution
impl Send for ZeroclawAttribution
impl Sync for ZeroclawAttribution
impl Unpin for ZeroclawAttribution
impl UnsafeUnpin for ZeroclawAttribution
impl UnwindSafe for ZeroclawAttribution
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