
Does a fit object carry usable posterior draws?
Source:R/import-standalone-backends.R
backend_has_draws.RdDetect the degenerate "no draws" case after a fit, so a caller
can fail loudly instead of returning an empty fit. This is backend-aware:
rstan returns a mode-2 stanfit with an empty @sim when the sampler fails
to initialize (rather than erroring), while cmdstanr exposes its draws through
$draws(). Unrecognized objects (e.g. test mocks) are treated as having draws
so they pass through untouched.