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.

Implementations read and write Dais presentation metadata using a concrete file format such as .pdfpc or the Dais-native sidecar format.

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”).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§