#[non_exhaustive]pub enum SoundSource {
Url(String),
Bytes(ImageData),
}Expand description
What a sound is loaded from (load_sound; TS: Sound.load’s
string | Uint8Array): where its file is, or the file’s bytes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Url(String)
A bundled asset (asset!(...)’s uri), a relative path, file:,
data: or an http(s) URL.
Bytes(ImageData)
The encoded bytes of a sound file (WAV, AAC, MP3, …): one the app
embeds (include_bytes!) or makes. Its format is read from the
bytes; equal bytes share one decoded sound.
Trait Implementations§
Source§impl Clone for SoundSource
impl Clone for SoundSource
Source§impl Debug for SoundSource
impl Debug for SoundSource
Source§impl From<&'static [u8]> for SoundSource
impl From<&'static [u8]> for SoundSource
Source§impl From<&String> for SoundSource
impl From<&String> for SoundSource
Source§impl From<&str> for SoundSource
impl From<&str> for SoundSource
Source§impl From<ImageData> for SoundSource
impl From<ImageData> for SoundSource
Source§impl From<String> for SoundSource
impl From<String> for SoundSource
Source§impl JsValue for SoundSource
A sound’s source from JS: a URL or path, or a sound file’s bytes.
impl JsValue for SoundSource
A sound’s source from JS: a URL or path, or a sound file’s bytes.
Source§impl PartialEq for SoundSource
impl PartialEq for SoundSource
impl StructuralPartialEq for SoundSource
Auto Trait Implementations§
impl !RefUnwindSafe for SoundSource
impl !UnwindSafe for SoundSource
impl Forget for SoundSource
impl Freeze for SoundSource
impl Move for SoundSource
impl Send for SoundSource
impl Sync for SoundSource
impl Unpin for SoundSource
impl UnsafeUnpin for SoundSourcewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<dyn AsRef<[u8]> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn AsRef<[u8]> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<Rgba> is !null: UnsafeUnpin,
PhantomData<ArcInner<Rgba>>: UnsafeUnpin,
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
Source§impl<T> CallbackArgs for Twhere
T: Ret,
impl<T> CallbackArgs for Twhere
T: Ret,
Source§fn ts_params(types: &mut TsTypes, names: &[&str]) -> String
fn ts_params(types: &mut TsTypes, names: &[&str]) -> String
Its TypeScript parameters, named
names (name: string, amount: number), or without names value for one and a, b, … for
several.Source§fn into_js_args<'a>(
self,
host: &'a dyn JsHost,
) -> Result<Vec<JsOwned<'a>>, PropError>
fn into_js_args<'a>( self, host: &'a dyn JsHost, ) -> Result<Vec<JsOwned<'a>>, PropError>
The arguments as JS values.