pub(crate) trait AudioBufferMethods<D>where
D: DomTypes,{
// Required methods
fn SampleRate(&self) -> Finite<f32>;
fn Length(&self) -> u32;
fn Duration(&self) -> Finite<f64>;
fn NumberOfChannels(&self) -> u32;
fn GetChannelData(
&self,
cx: &mut JSContext,
channel: u32,
) -> Result<RootedTraceableBox<TypedArray<Float32, Box<Heap<*mut JSObject>>>>, Error>;
fn CopyFromChannel(
&self,
destination: CustomAutoRooterGuard<'_, TypedArray<Float32, *mut JSObject>>,
channelNumber: u32,
startInChannel: u32,
) -> Result<(), Error>;
fn CopyToChannel(
&self,
cx: &mut JSContext,
source: CustomAutoRooterGuard<'_, TypedArray<Float32, *mut JSObject>>,
channelNumber: u32,
startInChannel: u32,
) -> Result<(), Error>;
fn Constructor(
cx: &mut JSContext,
global: &<D as DomTypes>::Window,
proto: Option<Handle<'_, *mut JSObject>>,
options: &AudioBufferOptions,
) -> Result<Root<Dom<<D as DomTypes>::AudioBuffer>>, Error>;
}Required Methods§
fn SampleRate(&self) -> Finite<f32>
fn Length(&self) -> u32
fn Duration(&self) -> Finite<f64>
fn NumberOfChannels(&self) -> u32
fn GetChannelData( &self, cx: &mut JSContext, channel: u32, ) -> Result<RootedTraceableBox<TypedArray<Float32, Box<Heap<*mut JSObject>>>>, Error>
fn CopyFromChannel( &self, destination: CustomAutoRooterGuard<'_, TypedArray<Float32, *mut JSObject>>, channelNumber: u32, startInChannel: u32, ) -> Result<(), Error>
fn CopyToChannel( &self, cx: &mut JSContext, source: CustomAutoRooterGuard<'_, TypedArray<Float32, *mut JSObject>>, channelNumber: u32, startInChannel: u32, ) -> Result<(), Error>
fn Constructor( cx: &mut JSContext, global: &<D as DomTypes>::Window, proto: Option<Handle<'_, *mut JSObject>>, options: &AudioBufferOptions, ) -> Result<Root<Dom<<D as DomTypes>::AudioBuffer>>, Error>
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.