Skip to main content

DiffFormat

Trait DiffFormat 

Source
pub trait DiffFormat<S, B>: Format<S, B> { }
Expand description

Public, nameable bound for a diff format, either changeset or patchset.

This is the downstream-visible counterpart to the crate-private Format trait. It carries no items of its own; the associated types live on the sealed supertrait and stay private. Because Format is crate-private, no external type can satisfy this bound, so it is sealed in the same sense as a sealed trait: only ChangesetFormat and PatchsetFormat implement it.

A consumer that only calls new, digest, and build can therefore write one function generic over F: DiffFormat<String, Vec<u8>> and fold a batch of wire events into either a changeset or a patchset, instead of duplicating the body once per format.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S, B, F: Format<S, B>> DiffFormat<S, B> for F