pub struct ProbeTable { /* private fields */ }Expand description
Lookup table used by crate::describe_device / crate::open_port.
Implementations§
Source§impl ProbeTable
impl ProbeTable
Sourcepub fn default_table() -> Self
pub fn default_table() -> Self
Built-in VID/PID map aligned with usb-serial-for-android defaults.
Sourcepub fn add_product(
&mut self,
vendor_id: u16,
product_id: u16,
driver: DriverType,
)
pub fn add_product( &mut self, vendor_id: u16, product_id: u16, driver: DriverType, )
Register a product binding (last write wins on duplicates).
Sourcepub fn find(
&self,
vendor_id: u16,
product_id: u16,
interfaces: &[InterfaceInfo],
) -> DriverType
pub fn find( &self, vendor_id: u16, product_id: u16, interfaces: &[InterfaceInfo], ) -> DriverType
Resolve driver for (vid, pid); falls back to CDC-ACM when interfaces look CDC.
Sourcepub fn port_count(
&self,
driver: DriverType,
interfaces: &[InterfaceInfo],
) -> usize
pub fn port_count( &self, driver: DriverType, interfaces: &[InterfaceInfo], ) -> usize
How many serial ports this driver + interface layout exposes.
Sourcepub fn port_count_product(
&self,
vendor_id: u16,
product_id: u16,
driver: DriverType,
interfaces: &[InterfaceInfo],
) -> usize
pub fn port_count_product( &self, vendor_id: u16, product_id: u16, driver: DriverType, interfaces: &[InterfaceInfo], ) -> usize
Port count when interface list is not yet known (enumeration / probe_table fixtures).
Sourcepub fn entries(&self) -> &[ProbeEntry]
pub fn entries(&self) -> &[ProbeEntry]
Immutable view of registered bindings.
Trait Implementations§
Source§impl Clone for ProbeTable
impl Clone for ProbeTable
Source§fn clone(&self) -> ProbeTable
fn clone(&self) -> ProbeTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProbeTable
impl Debug for ProbeTable
Source§impl Default for ProbeTable
impl Default for ProbeTable
Source§fn default() -> ProbeTable
fn default() -> ProbeTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProbeTable
impl RefUnwindSafe for ProbeTable
impl Send for ProbeTable
impl Sync for ProbeTable
impl Unpin for ProbeTable
impl UnsafeUnpin for ProbeTable
impl UnwindSafe for ProbeTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more