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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.