I have successfully created a JsValue(MidiAccess) struct. How do I get access the MidiAccess in the JsValue object? For example, how do I access MidiAccess.inputs()?
I tried the following with no luck:
let midi_access: MidiAccess = JsValue.into();
when I access "midi_access.inputs()" I get "method not found in `web_sys::MidiAccess"
( I'm very new at Rust )
For reference, that kind of struct (one without field names) is usually called a tuple struct. You can access its fields with dot notation, so in your example if you had a JsValue named value you would use value.0 to access the MidiAccess field. If there were a second field you could access it with value.1 and so on. You can read more here: Defining and Instantiating Structs - The Rust Programming Language