% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/adapter.R
\name{shard_register_adapter}
\alias{shard_register_adapter}
\title{Register an Adapter for Class-Specific Traversal}
\usage{
shard_register_adapter(class, adapter)
}
\arguments{
\item{class}{A character string naming the class to register the adapter for.}

\item{adapter}{A list containing:
\describe{
\item{class}{Character string matching the \code{class} parameter.}
\item{children}{Function taking an object and returning a named list of
child objects to traverse.}
\item{replace}{Function taking the original object and a named list of
(potentially shared) children, returning a reconstructed object.}
\item{path_prefix}{Optional character string prefix for child paths in
the sharing plan (default: class name).}
}}
}
\value{
Invisibly returns the previous adapter for this class (if any),
or NULL if no adapter was registered.
}
\description{
Registers a custom adapter for a specific class. When deep sharing encounters
an object of this class, it will use the adapter's \code{children()} function
to extract shareable components instead of generic traversal.
}
\examples{
shard_list_adapters()
}
