pub trait TryIntoTag<R, Discriminant: DiscriminantTag = ()> {
type Error;
// Required method
fn try_into_tag(self) -> Result<R, Self::Error>;
}Expand description
Fallible version of IntoTag.
Attempts to convert self into another representation under a given
discriminant, returning an error if the conversion fails.
§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 Associated Types§
Required Methods§
fn try_into_tag(self) -> Result<R, Self::Error>
Implementations on Foreign Types§
Source§impl TryIntoTag<(), NoneTag> for ()
Trivial extraction of None from unit.
impl TryIntoTag<(), NoneTag> for ()
Trivial extraction of None from unit.
type Error = Infallible
fn try_into_tag(self) -> Result<Self, Self::Error>
Source§impl TryIntoTag<(), SomeTag> for ()
Trivial extraction of Some from unit.
impl TryIntoTag<(), SomeTag> for ()
Trivial extraction of Some from unit.
type Error = Infallible
fn try_into_tag(self) -> Result<Self, Self::Error>
Source§impl TryIntoTag<[(); 0], ManyTag> for ()
Trivial extraction of Many as a zero-sized array from unit.
impl TryIntoTag<[(); 0], ManyTag> for ()
Trivial extraction of Many as a zero-sized array from unit.