File tree Expand file tree Collapse file tree 4 files changed +36
-0
lines changed Expand file tree Collapse file tree 4 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,19 @@ impl PartialEq for ConcreteBaseAudioContext {
66
66
}
67
67
}
68
68
69
+ impl std:: fmt:: Debug for ConcreteBaseAudioContext {
70
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
71
+ f. debug_struct ( "BaseAudioContext" )
72
+ . field ( "id" , & self . address ( ) )
73
+ . field ( "state" , & self . state ( ) )
74
+ . field ( "sample_rate" , & self . sample_rate ( ) )
75
+ . field ( "current_time" , & self . current_time ( ) )
76
+ . field ( "max_channel_count" , & self . max_channel_count ( ) )
77
+ . field ( "offline" , & self . offline ( ) )
78
+ . finish_non_exhaustive ( )
79
+ }
80
+ }
81
+
69
82
/// Inner representation of the `ConcreteBaseAudioContext`
70
83
///
71
84
/// These fields are wrapped inside an `Arc` in the actual `ConcreteBaseAudioContext`.
Original file line number Diff line number Diff line change 1
1
//! The `BaseAudioContext` interface and the `AudioContext` and `OfflineAudioContext` types
2
+
3
+ #![ deny( missing_debug_implementations) ]
4
+
2
5
use std:: { any:: Any , ops:: Range } ;
3
6
4
7
mod base;
Original file line number Diff line number Diff line change @@ -29,6 +29,15 @@ pub struct OfflineAudioContext {
29
29
resume_sender : mpsc:: Sender < ( ) > ,
30
30
}
31
31
32
+ impl std:: fmt:: Debug for OfflineAudioContext {
33
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
34
+ f. debug_struct ( "OfflineAudioContext" )
35
+ . field ( "length" , & self . length ( ) )
36
+ . field ( "base" , & self . base ( ) )
37
+ . finish_non_exhaustive ( )
38
+ }
39
+ }
40
+
32
41
struct OfflineAudioContextRenderer {
33
42
/// the rendering 'thread', fully controlled by the offline context
34
43
renderer : RenderThread ,
Original file line number Diff line number Diff line change @@ -118,6 +118,17 @@ pub struct AudioContext {
118
118
render_thread_init : RenderThreadInit ,
119
119
}
120
120
121
+ impl std:: fmt:: Debug for AudioContext {
122
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
123
+ f. debug_struct ( "AudioContext" )
124
+ . field ( "sink_id" , & self . sink_id ( ) )
125
+ . field ( "base_latency" , & self . base_latency ( ) )
126
+ . field ( "output_latency" , & self . output_latency ( ) )
127
+ . field ( "base" , & self . base ( ) )
128
+ . finish_non_exhaustive ( )
129
+ }
130
+ }
131
+
121
132
impl BaseAudioContext for AudioContext {
122
133
fn base ( & self ) -> & ConcreteBaseAudioContext {
123
134
& self . base
You can’t perform that action at this time.
0 commit comments