/// Helper callback function that interprets its `user_data` field as a
/// reference to a reference to something that implements `Write`. The
/// double reference is required to ensure we're not trying to pass a
/// fat pointer (e.g. for `T = &dyn Write`) to the C callback.
Helper callback function that interprets its `user_data` field as a
reference to a reference to something that implements `Write`. The
double reference is required to ensure we're not trying to pass a
fat pointer  to the C callback.
Helper callback function that interprets its ` user_data ` field as a reference to a reference to something that implements ` Write ` . The double reference is required to ensure we ' re not trying to pass a fat pointer to the C callback .
unsafe extern "C" fn callback<T: std::io::Write>(
            string: MlirStringRef,
            to: *mut std::ffi::c_void,
        ) {
            let to: &mut &mut T = std::mem::transmute(to);
            to.write(std::slice::from_raw_parts(
                string.data as *const _,
                string.length as usize,
            ))
            .unwrap();
        }
unsafe extern " " fn callback < T : std :: io :: Write > ( string : MlirStringRef , to : * mut std :: ffi :: c_void , ) { let to : & mut & mut T = std :: mem :: transmute ( to ) ; to . write ( std :: slice :: from_raw_parts ( string . data as * const _ , string . length as usize , ) ) . unwrap ( ) ; }
Helper callback function that interprets its `user_data` field as a
reference to a reference to something that implements `Write`.
Helper callback function that interprets its ` user_data ` field as a reference to a reference to something that implements ` Write ` .
string
MlirStringRef
to
*mut std::ffi::c_void