pub trait CompactionRule: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn rewrite(
&self,
ctx: &LinkCtx<'_>,
edits: &[Edit],
data: &dyn DataAccess,
) -> BinocResult<Option<Vec<Edit>>>;
// Provided method
fn format(&self) -> Option<ArtifactFormat> { ... }
}Required Methods§
fn name(&self) -> &str
fn rewrite( &self, ctx: &LinkCtx<'_>, edits: &[Edit], data: &dyn DataAccess, ) -> BinocResult<Option<Vec<Edit>>>
Provided Methods§
Sourcefn format(&self) -> Option<ArtifactFormat>
fn format(&self) -> Option<ArtifactFormat>
The artifact format whose provenance-scoped segment this rule rewrites.
The dispatcher slices a link’s merged edit list down to the edits tagged
with this format before calling rewrite, so a rule
never sees or rewrites another content type’s edits. None means the
rule operates on the whole (unsegmented) edit list — reserved for
cross-content-type or structural compaction; format-specific rules must
declare their format.