[][src]Trait atm::storage::StorageBackend

pub trait StorageBackend: Sized {
    type Error: Debug;
    fn append_file(
        &mut self,
        mfile: MIDIFile,
        mode: Option<u32>
    ) -> Result<(), Self::Error>;
fn finish(&mut self) -> Result<(), Self::Error>; fn append_melody(
        &mut self,
        melody: MIDINoteVec,
        mode: Option<u32>
    ) -> Result<(), Self::Error> { ... } }

Trait to implement storage backends for MIDI files generated from libatm::MIDIFile.

Associated Types

type Error: Debug

Error type for storage operations

Loading content...

Required methods

fn append_file(
    &mut self,
    mfile: MIDIFile,
    mode: Option<u32>
) -> Result<(), Self::Error>

Append MIDI file to storage backend

fn finish(&mut self) -> Result<(), Self::Error>

Conduct cleanup of storage backend and close for writing

NOTE: For some backends this method may be a NOOP, but should always be called after the last MIDI file has been written to disk.

Loading content...

Provided methods

fn append_melody(
    &mut self,
    melody: MIDINoteVec,
    mode: Option<u32>
) -> Result<(), Self::Error>

Convert melody to MIDI file and append to storage backend

Loading content...

Implementors

impl StorageBackend for BatchTarFile[src]

type Error = TarArchiveError

impl<G: PathGenerator> StorageBackend for TarFile<G>[src]

type Error = <TarArchive<BufWriter<File>, G> as StorageBackend>::Error

impl<G: PathGenerator> StorageBackend for TarGzFile<G>[src]

type Error = <TarArchive<GzEncoder<BufWriter<File>>, G> as StorageBackend>::Error

impl<W, G> StorageBackend for TarArchive<W, G> where
    W: Write,
    G: PathGenerator
[src]

type Error = TarArchiveError

Loading content...