[−][src]Struct libusb::Context
A libusb
context.
Methods
impl Context
[src]
impl Context
pub fn new() -> Result<Self>
[src]
pub fn new() -> Result<Self>
Opens a new libusb
context.
pub fn set_log_level(&mut self, level: LogLevel)
[src]
pub fn set_log_level(&mut self, level: LogLevel)
Sets the log level of a libusb
context.
pub fn has_capability(&self) -> bool
[src]
pub fn has_capability(&self) -> bool
pub fn has_hotplug(&self) -> bool
[src]
pub fn has_hotplug(&self) -> bool
Tests whether the running libusb
library supports hotplug.
pub fn has_hid_access(&self) -> bool
[src]
pub fn has_hid_access(&self) -> bool
Tests whether the running libusb
library has HID access.
pub fn supports_detach_kernel_driver(&self) -> bool
[src]
pub fn supports_detach_kernel_driver(&self) -> bool
Tests whether the running libusb
library supports detaching the kernel driver.
pub fn devices<'a>(&'a self) -> Result<DeviceList<'a>>
[src]
pub fn devices<'a>(&'a self) -> Result<DeviceList<'a>>
Returns a list of the current USB devices. The context must outlive the device list.
pub fn open_device_with_vid_pid<'a>(
&'a self,
vendor_id: u16,
product_id: u16
) -> Option<DeviceHandle<'a>>
[src]
pub fn open_device_with_vid_pid<'a>(
&'a self,
vendor_id: u16,
product_id: u16
) -> Option<DeviceHandle<'a>>
Convenience function to open a device by its vendor ID and product ID.
This function is provided as a convenience for building prototypes without having to
iterate a DeviceList
. It is not meant for production
applications.
Returns a device handle for the first device found matching vendor_id
and product_id
.
On error, or if the device could not be found, it returns None
.
Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more