pub trait TagLike: Copy + PartialEq + Sized {
// Required method
fn embedding(self) -> Tag;
// Provided methods
fn assert_eq(self, expected: Self) -> Result<Self> { ... }
fn with_value<V>(self, value: V) -> TaggedValue<V, Self> { ... }
}Expand description
This is the common trait that types to be used as tags are supposed to implement.
Required Methods§
Provided Methods§
sourcefn assert_eq(self, expected: Self) -> Result<Self>
fn assert_eq(self, expected: Self) -> Result<Self>
Assert that this Tag matches the provided expected tag.
On mismatch, returns an Error with ErrorKind::UnexpectedTag.
sourcefn with_value<V>(self, value: V) -> TaggedValue<V, Self>
fn with_value<V>(self, value: V) -> TaggedValue<V, Self>
Ergonomic way to get a TaggedValue for a given tag and value
Object Safety§
This trait is not object safe.