pub trait IntoTag<R, Discriminant: DiscriminantTag = ()> {
// Required method
fn into_tag(self) -> R;
}Expand description
Converts self into another representation under a given discriminant.
This is the method-based counterpart to FromTag. It exists for ergonomic
use, similar to how Into complements From.
The additional discriminant ensures that conversions remain unambiguous even when source and target types are not fully concrete.
§Type Parameters
R: Target type (may be generic or non-concrete).Discriminant: A concrete marker type used to disambiguate conversions.
§Default Discriminant
Discriminant = (): uses the unit type as a default tag, meaning no additional disambiguation when a single interpretation exists.
Required Methods§
Implementations on Foreign Types§
Implementors§
impl<T, U, Tag> IntoTag<U, Tag> for Twhere
U: FromTag<T, Tag>,
Tag: DiscriminantTag,
This mirrors the relationship between Into and From, while preserving
disambiguation via the discriminant.
The discriminant ensures that even when T and U are not fully concrete,
the conversion remains uniquely identifiable and does not violate coherence.