Skip to main content

SidecarFormat

Trait SidecarFormat 

Source
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§

Source

fn read(&self, path: &Path) -> Result<PresentationMetadata, SidecarError>

Read metadata from a sidecar file.

Source

fn write( &self, path: &Path, metadata: &PresentationMetadata, ) -> Result<(), SidecarError>

Write metadata to a sidecar file.

Source

fn file_extension(&self) -> &'static str

The file extension this format uses (e.g., “pdfpc”).

Implementors§