[][src]Struct openpol::sounddat::Sounddat

pub struct Sounddat { /* fields omitted */ }

A way to access sound.dat contents.

Methods

impl Sounddat[src]

pub fn load<T: Read>(reader: T) -> Option<Sounddat>[src]

Load sound.dat contents. All of it is read into memory.

Errors

The code will panic if reader cannot read to end. If the number of sounds can't be autodetected (the file contains unexpected data) the function will return None.

pub fn sounds(&self) -> usize[src]

The number of sounds in the file.

pub fn sound_data(&self, sound: usize) -> &[u8][src]

The sound's data (sound is 0-based). The data is to be interpreted as described by the module's documentation on the sound format.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.