pub unsafe fn object_has_state(obj: *const Object, state: State) -> Result<bool>
This function is unsafe because it may dereference raw pointers.