% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/infra__runtime_config.R
\name{.with_config_snapshot}
\alias{.with_config_snapshot}
\title{Run Code with a Temporary Configuration Snapshot}
\usage{
.with_config_snapshot(
  snapshot_fn,
  restore_fn,
  fn,
  should_restore = NULL,
  on_exit_fn = NULL
)
}
\arguments{
\item{snapshot_fn}{Function returning previous config snapshot.}

\item{restore_fn}{Function restoring previous config.}

\item{fn}{Function to execute while temporary config is active.}

\item{should_restore}{Optional predicate that decides whether restore should run.}

\item{on_exit_fn}{Optional cleanup function executed on exit.}
}
\value{
Result of \code{fn()}.
}
\description{
Internal helper that snapshots a runtime config, executes code, then
best-effort restores the original config on exit.
}
\keyword{internal}
