pub(crate) unsafe fn try_display(
    world: &mut World,
    entity: Entity,
    component_ptr: *mut u8,
    is_zst: bool,
    type_id: TypeId,
    inspectable_registry: &InspectableRegistry,
    type_registry: &TypeRegistryInternal,
    ui: &mut egui::Ui,
    ui_ctx: Option<&egui::CtxRef>,
    id: egui::Id,
) -> Result<bool, ()> {
    if let Some(inspect_callback) = inspectable_registry.impls.get(&type_id) {
        let id = id_to_u64(&id);
        let mut context = Context::new_world_access(ui_ctx, world);
        let mut context = context.with_id(id);

        let changed =
            display_by_inspectable_registry(inspect_callback, component_ptr, ui, &mut context);
        return Ok(changed);
    }

    if is_zst {
        return Ok(false);
    }

    if let Ok(changed) = display_by_reflection(
        type_registry,
        inspectable_registry,
        type_id,
        world,
        entity,
        ui,
        ui_ctx,
        id,
    ) {
        return Ok(changed);
    }

    Err(())
}
/// Safety:
/// `component_ptr` must point to a valid component, and the function must have unique access.
`component_ptr` must point to a valid component, and the function must have unique access.
` component_ptr ` must point to a valid component and the function must have unique access .
pub(crate) unsafe fn try_display(
    world: &mut World,
    entity: Entity,
    component_ptr: *mut u8,
    is_zst: bool,
    type_id: TypeId,
    inspectable_registry: &InspectableRegistry,
    type_registry: &TypeRegistryInternal,
    ui: &mut egui::Ui,
    ui_ctx: Option<&egui::CtxRef>,
    id: egui::Id,
) -> Result<bool, ()> {
    if let Some(inspect_callback) = inspectable_registry.impls.get(&type_id) {
        let id = id_to_u64(&id);
        let mut context = Context::new_world_access(ui_ctx, world);
        let mut context = context.with_id(id);
        let changed =
            display_by_inspectable_registry(inspect_callback, component_ptr, ui, &mut context);
        return Ok(changed);
    }
    if is_zst {
        return Ok(false);
    }
    if let Ok(changed) = display_by_reflection(
        type_registry,
        inspectable_registry,
        type_id,
        world,
        entity,
        ui,
        ui_ctx,
        id,
    ) {
        return Ok(changed);
    }
    Err(())
}
pub ( crate ) unsafe fn try_display ( world : & mut World , entity : Entity , component_ptr : * mut u8 , is_zst : bool , type_id : TypeId , inspectable_registry : & InspectableRegistry , type_registry : & TypeRegistryInternal , ui : & mut egui :: Ui , ui_ctx : Option < & egui :: CtxRef > , id : egui :: Id , ) -> Result < bool , ( ) > { if let Some ( inspect_callback ) = inspectable_registry . impls . get ( & type_id ) { let id = id_to_u64 ( & id ) ; let mut context = Context :: new_world_access ( ui_ctx , world ) ; let mut context = context . with_id ( id ) ; let changed = display_by_inspectable_registry ( inspect_callback , component_ptr , ui , & mut context ) ; return Ok ( changed ) ; } if is_zst { return Ok ( false ) ; } if let Ok ( changed ) = display_by_reflection ( type_registry , inspectable_registry , type_id , world , entity , ui , ui_ctx , id , ) { return Ok ( changed ) ; } Err ( ( ) ) }
Safety:
`component_ptr` must point to a valid component, and the function must have unique access.
Safety : ` component_ptr ` must point to a valid component and the function must have unique access .
world
&mut World
entity
Entity
component_ptr
*mut u8
is_zst
bool
type_id
TypeId
inspectable_registry
&InspectableRegistry
type_registry
&TypeRegistryInternal
ui
&mut egui::Ui
ui_ctx
Option<&egui::CtxRef>
id
egui::Id
world
&mut World
entity
Entity
component_ptr
*mut u8
is_zst
bool
type_id
TypeId
inspectable_registry
&InspectableRegistry
type_registry
&TypeRegistryInternal
ui
&mut egui::Ui
ui_ctx
Option<&egui::CtxRef>
id
egui::Id