[][src]Trait cpp_core::CastFrom

pub trait CastFrom<T>: Sized {
    unsafe fn cast_from(value: T) -> Self;
}

Performs some of the conversions that are available implicitly in C++.

CastInto is automatically implemented for all CastFrom conversions, similar to From and Into traits from std.

Required methods

unsafe fn cast_from(value: T) -> Self

Performs the conversion.

Safety

This operation is safe as long as value is valid.

Loading content...

Implementors

impl<'a> CastFrom<&'a CStr> for MutPtr<c_char>[src]

impl<'a> CastFrom<&'a CStr> for Ptr<c_char>[src]

impl<'a, T, U: CppDeletable> CastFrom<&'a CppBox<U>> for Ptr<T> where
    U: StaticUpcast<T>, 
[src]

impl<'a, T, U: CppDeletable> CastFrom<&'a CppBox<U>> for Ref<T> where
    U: StaticUpcast<T>, 
[src]

impl<'a, T, U: CppDeletable> CastFrom<&'a mut CppBox<U>> for MutPtr<T> where
    U: StaticUpcast<T>, 
[src]

impl<'a, T, U: CppDeletable> CastFrom<&'a mut CppBox<U>> for MutRef<T> where
    U: StaticUpcast<T>, 
[src]

impl<T> CastFrom<NullPtr> for MutPtr<T>[src]

impl<T> CastFrom<NullPtr> for Ptr<T>[src]

impl<T, U> CastFrom<*const U> for Ptr<T> where
    U: StaticUpcast<T>, 
[src]

impl<T, U> CastFrom<*mut U> for MutPtr<T> where
    U: StaticUpcast<T>, 
[src]

impl<T, U> CastFrom<*mut U> for Ptr<T> where
    U: StaticUpcast<T>, 
[src]

impl<T, U> CastFrom<MutPtr<U>> for MutPtr<T> where
    U: StaticUpcast<T>, 
[src]

impl<T, U> CastFrom<MutPtr<U>> for Ptr<T> where
    U: StaticUpcast<T>, 
[src]

impl<T, U> CastFrom<MutRef<U>> for MutPtr<T> where
    U: StaticUpcast<T>, 
[src]

impl<T, U> CastFrom<MutRef<U>> for MutRef<T> where
    U: StaticUpcast<T>, 
[src]

impl<T, U> CastFrom<MutRef<U>> for Ptr<T> where
    U: StaticUpcast<T>, 
[src]

impl<T, U> CastFrom<MutRef<U>> for Ref<T> where
    U: StaticUpcast<T>, 
[src]

impl<T, U> CastFrom<Ptr<U>> for Ptr<T> where
    U: StaticUpcast<T>, 
[src]

impl<T, U> CastFrom<Ref<U>> for Ptr<T> where
    U: StaticUpcast<T>, 
[src]

impl<T, U> CastFrom<Ref<U>> for Ref<T> where
    U: StaticUpcast<T>, 
[src]

Loading content...