Trait RamaTryInto

pub trait RamaTryInto<T, CrateMarker = ()>: Sized {
    type Error;

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

Alternative for TryInto which can be implemented by external crates for external types

To implement this trait, use a crate local CrateMarker generic type More info: https://ramaproxy.org/book/intro/patterns.html#working-around-the-orphan-rule-in-specific-cases

Note: RamaTryInto has a blacket implementation for types that implement RamaTryFrom in the opposite direction, and as such also work for types that implement TryInto

Required Associated Types§

type Error

Required Methods§

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

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.

Implementors§

§

impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for T
where U: RamaTryFrom<T, CrateMarker>,

§

type Error = <U as RamaTryFrom<T, CrateMarker>>::Error