pub unsafe fn from_custom_data(custom_data: Box<Box<dyn CustomData>>) -> Self {
        let (ptr, len) = (custom_data.ptr() as *const c_void, custom_data.len());
        let userdata = mem::transmute::<Box<Box<dyn CustomData>>, &mut c_void>(custom_data);
        let data_provider = CGDataProviderCreateWithData(userdata, ptr, len, Some(release));
        return CGDataProvider::from_ptr(data_provider);

        unsafe extern "C" fn release(info: *mut c_void, _: *const c_void, _: size_t) {
            drop(mem::transmute::<*mut c_void, Box<Box<dyn CustomData>>>(info))
        }
    }
/// Creates a data provider from the given raw pointer, length, and destructor function.
///
/// This is double-boxed because the Core Text API requires that the userdata be a single
/// pointer.
Creates a data provider from the given raw pointer, length, and destructor function.
This is double-boxed because the Core Text API requires that the userdata be a single
pointer.
Creates a data provider from the given raw pointer length and destructor function . This is double - boxed because the Core Text API requires that the userdata be a single pointer .
pub unsafe fn from_custom_data(custom_data: Box<Box<dyn CustomData>>) -> Self {
        let (ptr, len) = (custom_data.ptr() as *const c_void, custom_data.len());
        let userdata = mem::transmute::<Box<Box<dyn CustomData>>, &mut c_void>(custom_data);
        let data_provider = CGDataProviderCreateWithData(userdata, ptr, len, Some(release));
        return CGDataProvider::from_ptr(data_provider);
        unsafe extern "C" fn release(info: *mut c_void, _: *const c_void, _: size_t) {
            drop(mem::transmute::<*mut c_void, Box<Box<dyn CustomData>>>(info))
        }
    }
pub unsafe fn from_custom_data ( custom_data : Box < Box < dyn CustomData > > ) -> Self { let ( ptr , len ) = ( custom_data . ptr ( ) as * const c_void , custom_data . len ( ) ) ; let userdata = mem :: transmute :: < Box < Box < dyn CustomData > > , & mut c_void > ( custom_data ) ; let data_provider = CGDataProviderCreateWithData ( userdata , ptr , len , Some ( release ) ) ; return CGDataProvider :: from_ptr ( data_provider ) ; unsafe extern " " fn release ( info : * mut c_void , _ : * const c_void , _ : size_t ) { drop ( mem :: transmute :: < * mut c_void , Box < Box < dyn CustomData > > > ( info ) ) } }
Creates a data provider from the given raw pointer, length, and destructor function.
Creates a data provider from the given raw pointer length and destructor function .
custom_data
Box<Box<dyn CustomData>>