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§
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”).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".