Trait TransmuteFromObject

Source
pub unsafe trait TransmuteFromObject: Sized {
    // Required method
    fn check(vm: &VirtualMachine, obj: &PyObject) -> PyResult<()>;
}
Expand description

Marks a type that has the exact same layout as PyObjectRef, e.g. a type that is repr(transparent) over PyObjectRef.

§Safety

Can only be implemented for types that are repr(transparent) over a PyObjectRef obj, and logically valid so long as check(vm, obj) returns Ok(())

Required Methods§

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§