fn check_handle_impl<T: 'static>(handle: Handle, ownership: Option<HandleOwnershipType>) {
    match HANDLES_MAP
        .read()
        .expect("Unable to obtain read-lock")
        .get(&handle)
    {
        Some(info) => {
            let actual_object_type = TypeId::of::<T>();
            assert_eq!(
                info.object_type, actual_object_type,
                "Wrong type id for '{:X}' handle",
                handle
            );

            if let Some(val) = ownership {
                assert_eq!(
                    val, info.ownership,
                    "Error: '{:X}' handle should be {:?}",
                    handle, info.ownership
                );
            }
        }
        None => panic!("Invalid handle value: '{:X}'", handle),
    }
}
/// Checks given handle for validity.
///
/// # Panics
///
/// Panics if handle is unknown or its type or ownership model is wrong.
Checks given handle for validity.
Checks given handle for validity .
fn check_handle_impl<T: 'static>(handle: Handle, ownership: Option<HandleOwnershipType>) {
    match HANDLES_MAP
        .read()
        .expect("Unable to obtain read-lock")
        .get(&handle)
    {
        Some(info) => {
            let actual_object_type = TypeId::of::<T>();
            assert_eq!(
                info.object_type, actual_object_type,
                "Wrong type id for '{:X}' handle",
                handle
            );
            if let Some(val) = ownership {
                assert_eq!(
                    val, info.ownership,
                    "Error: '{:X}' handle should be {:?}",
                    handle, info.ownership
                );
            }
        }
        None => panic!("Invalid handle value: '{:X}'", handle),
    }
}
fn check_handle_impl < T : ' static > ( handle : Handle , ownership : Option < HandleOwnershipType > ) { match HANDLES_MAP . read ( ) . expect ( " " ) . get ( & handle ) { Some ( info ) => { let actual_object_type = TypeId :: of :: < T > ( ) ; assert_eq ! ( info object_type actual_object_type " " handle ) ; if let Some ( val ) = ownership { assert_eq ! ( val info ownership " " handle info ownership ) ; } } None => panic ! ( " " handle ) , } }
Checks given handle for validity.
Checks given handle for validity .
handle
Handle
ownership
Option<HandleOwnershipType>
panics
Panics if handle is unknown or its type or ownership model is wrong.
Panics if handle is unknown or its type or ownership model is wrong .