[][src]Trait floaout::io::read::ReadFmt

pub trait ReadFmt<T, B>: Read {
    fn read_details(&mut self) -> Result<T>;
fn read_blocks(&mut self, _: &T) -> Result<B>; }

This trait reads format.

Required methods

fn read_details(&mut self) -> Result<T>

This method reads details of format.

Examples

use std::io;
use std::fs::File;
use floaout::format::bub::Bubble;
use floaout::io::read::ReadFmt;
 
fn main() -> io::Result<()> {
    let mut reader = io::BufReader::new(File::open("foo.bub")?);
 
    // read Bubble details
    let bub: Bubble = reader.read_details()?;
 
    Ok(())
}

fn read_blocks(&mut self, _: &T) -> Result<B>

This method reads format blocks.

Examples

use std::io;
use std::fs::File;
use floaout::format::bub::{Bubble, BubbleBlocks};
use floaout::io::read::ReadFmt;
 
fn main() -> io::Result<()> {
    let mut reader = io::BufReader::new(File::open("foo.bub")?);
 
    // read Bubble details
    let bub: Bubble = reader.read_details()?;
 
    // read Bubble blocks
    let bub_blocks: BubbleBlocks = reader.read_blocks(&bub)?;
 
    Ok(())
}
Loading content...

Implementations on Foreign Types

impl<R: Read + Seek> ReadFmt<Bubble, BubbleBlocks> for BufReader<R>[src]

impl<R: Read + Seek> ReadFmt<Floaout, FloaoutBlocks> for BufReader<R>[src]

impl<R: Read + Seek> ReadFmt<Wav, WavBlocks> for BufReader<R>[src]

Loading content...

Implementors

Loading content...