ForceFrom

Trait ForceFrom 

Source
pub trait ForceFrom<T>: Sized {
    type Warning;

    // Required method
    fn force_from(src: T) -> Warned<Self, Self::Warning>;
}
Expand description

Convert T into Warned<T, Warning>

Required Associated Types§

Required Methods§

Source

fn force_from(src: T) -> Warned<Self, Self::Warning>

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§

Source§

impl<T: Into<U>, U> ForceFrom<T> for U

use warned::*;
struct A;
struct B;
impl From<A> for B {
    fn from(src: A) -> B { B }
}
let _: Warned<B, std::convert::Infallible> = A.force_into();