Skip to main content

Silent

Struct Silent 

Source
pub struct Silent;
Expand description

A device that plays nothing: for a backend with no sound yet, and tests.

Trait Implementations§

Source§

impl Audio for Silent

Source§

fn music_playing(&self, _: Millis) -> Option<(&str, f64)>

The music sounding at now: its cue and the seconds since it really started (once its file had loaded), or None in silence: nothing asked for, a track still loading or whose file failed. Of two tracks sounding (a crossfade), the newest: the old one until the new one has loaded.
Source§

fn play(&mut self, _: &AudioFrame<'_>, _: Millis)

Plays one frame’s frame of audio at now: the volumes first, then the requests and the music commands in order. It also checks on what is still loading, so it is called every frame, with nothing to play too.
Source§

fn stop_all(&mut self)

Stops the music, the voice and the sounds started with a handle: the game has quit.
Source§

fn suspend(&mut self)

Holds everything sounding (the sounds started with a handle, the voice and the music) while the system suspends the game (SystemEvent::Suspend); sound cues played once finish. Pauses, or mutes where the backend can’t pause. A second call does nothing. Read more
Source§

fn resume(&mut self)

Brings back what suspend held, and leaves a SoundRequest::PauseSounds pause in place. A call while not suspended does nothing.
Source§

fn voice_playing(&self, now: Millis) -> Option<&str>

The voice clip sounding at now, by its file (SoundRequest::Voice), or asked for and still loading: None once it has ended, and for a clip stopped, replaced, whose file failed or that loaded too late to be played. A clip held by suspend still sounds. None by default, for a device that plays no voices.
Source§

impl Clone for Silent

Source§

fn clone(&self) -> Silent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Silent

Source§

impl Debug for Silent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Silent

Source§

fn default() -> Silent

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.