SoundInterface

Trait SoundInterface 

Source
pub trait SoundInterface: RpcDevice {
    // Required methods
    fn find_sound(&self, name: &str) -> Result<Box<[String]>>
       where Box<[String]>: DeserializeOwned + 'static;
    fn play_sound(&self, name: &str, volume: f64, pitch: f64) -> Result<()>
       where (): DeserializeOwned + 'static;
}
Expand description

An interface between sound-making devices and the HALPI

Required Methods§

Source

fn find_sound(&self, name: &str) -> Result<Box<[String]>>
where Box<[String]>: DeserializeOwned + 'static,

Returns a slice of sound effect names matching the given name. The length of the slice is limited, so very generic names may result in a truncated list.

Source

fn play_sound(&self, name: &str, volume: f64, pitch: f64) -> Result<()>
where (): DeserializeOwned + 'static,

Plays the sound effect matching the given name at the given volume and pitch.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§