[][src]Trait unsafe_from::UnsafeInto

pub unsafe trait UnsafeInto<T>: Sized {
    unsafe fn unsafe_into(self) -> T;
}

Unsafe version of Into<T> trait from std.

Prefer implementing UnsafeFrom because it gives you UnsafeInto freely.

Example

use unsafe_from::UnsafeInto;

struct MyUnsafeType(i32);

unsafe impl UnsafeInto<MyUnsafeType> for i32 {
    unsafe fn unsafe_into(self) -> MyUnsafeType {
        MyUnsafeType(self)
    }
}

Required methods

unsafe fn unsafe_into(self) -> T

Loading content...

Implementors

impl<T, U> UnsafeInto<U> for T where
    U: UnsafeFrom<T>, 
[src]

Loading content...