/// Create a new instance of the V0 type
Create a new instance of the V0 type
Create a new instance of the V0 type
pub fn new_v0(base: B, val: V0) -> Box<Self> {
        let inner = UnsizedEnum {
            header: Header { disc: 0, base },
            phantomdata: PhantomData,
            val: ManuallyDrop::new(val),
        };
        // Safe because all we're doing is writing a valid value into
        // a (possibly) bigger piece of memory.
        unsafe {
            let p = Self::alloc();
            ptr::write(p, inner);
            Box::from_raw(p)
        }
    }
pub fn new_v0 ( base : B , val : V0 ) -> Box < Self > { let inner = UnsizedEnum { header : Header { disc : 0 , base } , phantomdata : PhantomData , val : ManuallyDrop :: new ( val ) , } ; // Safe because all we're doing is writing a valid value into // a (possibly) bigger piece of memory. unsafe { let p = Self :: alloc ( ) ; ptr :: write ( p , inner ) ; Box :: from_raw ( p ) } }
Create a new instance of the V0 type
Create a new instance of the V0 type
base
B
val
V0