pub struct EventIdentity { /* private fields */ }Expand description
Producer-stamped run, turn, message, and tool correlation values.
The store persists these values in the existing signed headers member of
harn.session.event.v1; adding identity therefore needs no schema fork.
Implementations§
Source§impl EventIdentity
impl EventIdentity
pub fn new() -> Self
Sourcepub fn with(
self,
field: EventIdentityField,
value: impl Into<String>,
) -> Result<Self, EventIdentityError>
pub fn with( self, field: EventIdentityField, value: impl Into<String>, ) -> Result<Self, EventIdentityError>
Add a field, rejecting blank/control-bearing or conflicting values.
pub fn insert( &mut self, field: EventIdentityField, value: impl Into<String>, ) -> Result<(), EventIdentityError>
pub fn get(&self, field: EventIdentityField) -> Option<&str>
pub fn is_empty(&self) -> bool
Sourcepub fn from_headers(
headers: &BTreeMap<String, String>,
) -> Result<Self, EventIdentityError>
pub fn from_headers( headers: &BTreeMap<String, String>, ) -> Result<Self, EventIdentityError>
Parse and normalize only the reserved identity keys in headers.
Sourcepub fn apply_to_headers(
&self,
headers: &mut BTreeMap<String, String>,
) -> Result<(), EventIdentityError>
pub fn apply_to_headers( &self, headers: &mut BTreeMap<String, String>, ) -> Result<(), EventIdentityError>
Project identity into headers without silently replacing a producer ID.
Trait Implementations§
Source§impl Clone for EventIdentity
impl Clone for EventIdentity
Source§fn clone(&self) -> EventIdentity
fn clone(&self) -> EventIdentity
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 EventIdentity
impl Debug for EventIdentity
Source§impl Default for EventIdentity
impl Default for EventIdentity
Source§fn default() -> EventIdentity
fn default() -> EventIdentity
Returns the “default value” for a type. Read more
impl Eq for EventIdentity
Source§impl PartialEq for EventIdentity
impl PartialEq for EventIdentity
impl StructuralPartialEq for EventIdentity
Auto Trait Implementations§
impl Freeze for EventIdentity
impl RefUnwindSafe for EventIdentity
impl Send for EventIdentity
impl Sync for EventIdentity
impl Unpin for EventIdentity
impl UnsafeUnpin for EventIdentity
impl UnwindSafe for EventIdentity
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