#[non_exhaustive]pub struct SoundCue {
pub files: Vec<String>,
pub volume: u8,
pub credit: CreditRef,
pub looped: bool,
}Expand description
A sound effect: one of its files plays each time. Build it with
SoundCue::new (ADR-0039).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.files: Vec<String>The variants, relative to base/audio/; one is picked at random
each time the cue plays. At least one.
volume: u8Volume in percent (0–100).
credit: CreditRefWho made it.
looped: boolWhether it loops until it is stopped (false, the file’s default:
it plays once). A looped cue is started with a handle
(AudioQueue::start_sound in shuyi-ui), which stops it.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SoundCue
impl<'de> Deserialize<'de> for SoundCue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SoundCue
impl StructuralPartialEq for SoundCue
Auto Trait Implementations§
impl Freeze for SoundCue
impl RefUnwindSafe for SoundCue
impl Send for SoundCue
impl Sync for SoundCue
impl Unpin for SoundCue
impl UnsafeUnpin for SoundCue
impl UnwindSafe for SoundCue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more