This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub struct OpenRadioContext<'a> { // public struct | |
usb_context: Context, // private fields, safety depends on these not being accessed directly | |
device_handle: DeviceHandle<'a>, | |
} | |
... snip ... | |
impl <'a> OpenRadioContext<'a> { | |
fn open() -> OpenRadioContext<'a> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub struct OpenRadioContext<'a, 'b:'a> { | |
_context: PhantomData<&'b Context>, | |
usb_context: Box<Context>, | |
device_handle: DeviceHandle<'a>, | |
} | |
impl <'a, 'b> Drop for OpenRadioContext<'a, 'b> { | |
fn drop(&mut self) { | |
self.device_handle.release_interface(0).unwrap(); | |
} |
OlderNewer