pub struct DeviceRule {
pub role: RoleId,
pub vid: u16,
pub pid: u16,
pub serial: Option<String>,
pub port_path: Option<String>,
}Expand description
单个设备的配置规则
Fields§
§role: RoleId§vid: u16§pid: u16§serial: Option<String>§port_path: Option<String>Implementations§
Source§impl DeviceRule
impl DeviceRule
Sourcepub fn matches(&self, device: &RawDeviceInfo) -> Option<MatchMethod>
pub fn matches(&self, device: &RawDeviceInfo) -> Option<MatchMethod>
核心匹配算法:严格模式
Trait Implementations§
Source§impl Clone for DeviceRule
impl Clone for DeviceRule
Source§fn clone(&self) -> DeviceRule
fn clone(&self) -> DeviceRule
Returns a duplicate of the value. Read more
1.0.0 · 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 DeviceRule
impl Debug for DeviceRule
Source§impl<'de> Deserialize<'de> for DeviceRule
impl<'de> Deserialize<'de> for DeviceRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DeviceRule
impl RefUnwindSafe for DeviceRule
impl Send for DeviceRule
impl Sync for DeviceRule
impl Unpin for DeviceRule
impl UnwindSafe for DeviceRule
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