pub struct Tag(/* private fields */);
Expand description
A Tag that semantically characterises an event.
Tags are non-empty unicode strings in NFC representation (i.e. normalized by canonical decomposition
followed by composition). Thus, ℌ
and H
are different tags while the various encodings of é
are
all represented by the codepoint E9.
Implementations§
Trait Implementations§
Source§impl<T: Into<String>> Add<T> for Tag
Concatenate another part to this tag
impl<T: Into<String>> Add<T> for Tag
Concatenate another part to this tag
let user_tag = tag!("user:") + "Bob";
let machine_tag = tag!("machine:") + format!("{}-{}", "thing", 42);
assert_eq!(user_tag, tag!("user:Bob"));
assert_eq!(machine_tag, tag!("machine:thing-42"));
This will never panic because the initial tag is already proven to be a valid tag.
Source§impl AddAssign<Tag> for TagSet
impl AddAssign<Tag> for TagSet
Source§fn add_assign(&mut self, rhs: Tag)
fn add_assign(&mut self, rhs: Tag)
Performs the
+=
operation. Read moreSource§impl Decode<DagCborCodec> for Tag
impl Decode<DagCborCodec> for Tag
Source§impl<'de> Deserialize<'de> for Tag
impl<'de> Deserialize<'de> for Tag
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 Encode<DagCborCodec> for Tag
impl Encode<DagCborCodec> for Tag
Source§impl FromIterator<Tag> for TagSet
impl FromIterator<Tag> for TagSet
Source§impl Ord for Tag
impl Ord for Tag
Source§impl PartialOrd for Tag
impl PartialOrd for Tag
Source§impl SubAssign<&Tag> for TagSet
impl SubAssign<&Tag> for TagSet
Source§fn sub_assign(&mut self, rhs: &Tag)
fn sub_assign(&mut self, rhs: &Tag)
Performs the
-=
operation. Read moreSource§impl TryFrom<&str> for Tag
impl TryFrom<&str> for Tag
Source§type Error = ParseError
type Error = ParseError
The type returned in the event of a conversion error.
impl Eq for Tag
impl StructuralPartialEq for Tag
Auto Trait Implementations§
impl Freeze for Tag
impl !RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl !UnwindSafe for Tag
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