Struct ggez::audio::SoundData[][src]

pub struct SoundData(_);

Static sound data stored in memory. It is Arc'ed, so cheap to clone.

Implementations

impl SoundData[src]

pub fn new<P: AsRef<Path>>(context: &mut Context, path: P) -> GameResult<Self>[src]

Load the file at the given path and create a new SoundData from it.

pub fn from_bytes(data: &[u8]) -> Self[src]

Copies the data in the given slice into a new SoundData object.

pub fn from_read<R>(reader: &mut R) -> GameResult<Self> where
    R: Read
[src]

Creates a SoundData from any Read object; this involves copying it into a buffer.

pub fn can_play(&self) -> bool[src]

Indicates if the data can be played as a sound.

Trait Implementations

impl AsRef<[u8]> for SoundData[src]

impl Clone for SoundData[src]

impl Debug for SoundData[src]

impl From<Arc<[u8]>> for SoundData[src]

impl From<Box<[u8], Global>> for SoundData[src]

impl From<Vec<u8, Global>> for SoundData[src]

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> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,