pub trait MediaLoader {
// Required methods
fn load(&self, path: &Path) -> Result<CoverMedia, MediaError>;
fn save(&self, media: &CoverMedia, path: &Path) -> Result<(), MediaError>;
}Expand description
Codec adapter port for loading and saving cover media files.
I/O is performed by the adapter; the domain receives decoded pixels/samples.
Required Methods§
Sourcefn load(&self, path: &Path) -> Result<CoverMedia, MediaError>
fn load(&self, path: &Path) -> Result<CoverMedia, MediaError>
Load a media file from path and return decoded CoverMedia.
§Errors
Returns MediaError::UnsupportedFormat, MediaError::DecodeFailed,
or MediaError::IoError.