pub trait SidecarFormat {
// Required methods
fn read(&self, path: &Path) -> Result<PresentationMetadata, SidecarError>;
fn write(
&self,
path: &Path,
metadata: &PresentationMetadata,
) -> Result<(), SidecarError>;
fn file_extension(&self) -> &'static str;
}Expand description
Abstraction for sidecar file formats.
In v1, the only implementation is .pdfpc. Future formats (e.g., .dais)
implement this same trait and slot in without changing downstream code.
Required Methods§
Sourcefn read(&self, path: &Path) -> Result<PresentationMetadata, SidecarError>
fn read(&self, path: &Path) -> Result<PresentationMetadata, SidecarError>
Read metadata from a sidecar file.
Sourcefn write(
&self,
path: &Path,
metadata: &PresentationMetadata,
) -> Result<(), SidecarError>
fn write( &self, path: &Path, metadata: &PresentationMetadata, ) -> Result<(), SidecarError>
Write metadata to a sidecar file.
Sourcefn file_extension(&self) -> &'static str
fn file_extension(&self) -> &'static str
The file extension this format uses (e.g., “pdfpc”).