Trait TryTo

Source
pub trait TryTo<T> {
    type Error;

    // Required method
    fn try_to(self) -> Result<T, Self::Error>;
}
Expand description

Not all enums can have the std::convert::TryFrom trait derived on them because of rules around implementing foreign traits on foreign types.

This trait provides a similar interface that does not have this issue. It closely mimics the std::convert::TryInto trait.

Required Associated Types§

Required Methods§

Source

fn try_to(self) -> Result<T, Self::Error>

Implementors§