[−][src]Struct rusb::Context
A libusb
context.
Methods
impl Context
[src]
pub fn new() -> Result<Self>
[src]
Opens a new libusb
context.
pub fn with_options(opts: &[UsbOption]) -> Result<Self>
[src]
Creates a new libusb
context and sets runtime options.
Trait Implementations
impl UsbContext for Context
[src]
fn as_raw(&self) -> *mut libusb_context
[src]
fn devices(&self) -> Result<DeviceList<Self>>
[src]
fn open_device_with_vid_pid(
&self,
vendor_id: u16,
product_id: u16
) -> Option<DeviceHandle<Self>>
[src]
&self,
vendor_id: u16,
product_id: u16
) -> Option<DeviceHandle<Self>>
fn set_log_level(&mut self, level: LogLevel)
[src]
fn register_callback(
&self,
vendor_id: Option<u16>,
product_id: Option<u16>,
class: Option<u8>,
callback: Box<dyn Hotplug<Self>>
) -> Result<Registration>
[src]
&self,
vendor_id: Option<u16>,
product_id: Option<u16>,
class: Option<u8>,
callback: Box<dyn Hotplug<Self>>
) -> Result<Registration>
fn unregister_callback(&self, reg: Registration)
[src]
fn handle_events(&self, timeout: Option<Duration>) -> Result<()>
[src]
impl Send for Context
[src]
impl Sync for Context
[src]
impl Clone for Context
[src]
impl Eq for Context
[src]
impl PartialEq<Context> for Context
[src]
impl StructuralPartialEq for Context
[src]
impl StructuralEq for Context
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,