% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/audit-export.R
\name{trail_to_list}
\alias{trail_to_list}
\title{Convert an Audit Trail to a Plain List}
\usage{
trail_to_list(.trail)
}
\arguments{
\item{.trail}{An \code{\link[=audit_trail]{audit_trail()}} object.}
}
\value{
A named list with elements \code{name}, \code{created_at} (ISO 8601 string),
\code{n_snapshots}, and \code{snapshots} (a named list keyed by snapshot label).
}
\description{
Converts an \code{\link[=audit_trail]{audit_trail()}} object to a plain R list suitable for
serialisation with \code{\link[jsonlite:toJSON]{jsonlite::toJSON()}}. All POSIXct timestamps are
converted to ISO 8601 character strings and data.frames are converted
to lists of named rows for JSON compatibility.
}
\examples{
trail <- audit_trail("example")
mtcars |> audit_tap(trail, "raw")
lst <- trail_to_list(trail)
str(lst, max.level = 2)

}
\seealso{
Other audit export:
\code{\link[=audit_export]{audit_export()}},
\code{\link[=read_trail]{read_trail()}},
\code{\link[=trail_to_df]{trail_to_df()}},
\code{\link[=write_trail]{write_trail()}}
}
\concept{audit export}
