Skip to content

Commit 62b18f3

Browse files
committed
Add Debug impl for AudioWorkletNode and friends
1 parent a222c8e commit 62b18f3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/worklet.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
//! See `examples/worklet.rs` or `examples/worklet_bitcrusher.rs` for an example implementation of
44
//! user defined nodes.
55
6+
#![deny(missing_debug_implementations)]
7+
68
use crate::context::{AudioContextRegistration, AudioParamId, BaseAudioContext};
79
use crate::node::{AudioNode, ChannelConfig, ChannelConfigOptions};
810
use crate::param::{AudioParam, AudioParamDescriptor};
@@ -18,6 +20,12 @@ pub struct AudioParamValues<'a> {
1820
map: &'a HashMap<String, AudioParamId>,
1921
}
2022

23+
impl<'a> std::fmt::Debug for AudioParamValues<'a> {
24+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25+
f.debug_struct("AudioParamValues").finish_non_exhaustive()
26+
}
27+
}
28+
2129
impl<'a> AudioParamValues<'a> {
2230
/// Get the computed values for the given [`AudioParam`]
2331
///
@@ -128,6 +136,7 @@ impl<C: Default> Default for AudioWorkletNodeOptions<C> {
128136
/// - `cargo run --release --example worklet`
129137
/// - `cargo run --release --example worklet_bitcrusher`
130138
///
139+
#[derive(Debug)]
131140
pub struct AudioWorkletNode {
132141
registration: AudioContextRegistration,
133142
channel_config: ChannelConfig,

0 commit comments

Comments
 (0)