pub struct DeviceFeature(/* private fields */);Expand description
Capability bit-flags, matching libfprint’s FpDeviceFeature (fp-device.h).
The bit positions are load-bearing: IDENTIFY = 1<<1 and VERIFY = 1<<2 (note the
order is not alphabetical in libfprint). STORAGE distinguishes match-on-chip (MOC)
devices — which keep templates on the sensor — from host-side-storage devices.
Hand-rolled (no bitflags dependency) to keep fprint-core allocation- and dependency-free.
Implementations§
Source§impl DeviceFeature
impl DeviceFeature
Sourcepub const NONE: DeviceFeature
pub const NONE: DeviceFeature
The empty set (FP_DEVICE_FEATURE_NONE). Every set contains it.
Sourcepub const CAPTURE: DeviceFeature
pub const CAPTURE: DeviceFeature
FP_DEVICE_FEATURE_CAPTURE: the device can return a raw image (fp_device_capture).
Image sensors have it; match-on-chip sensors normally do not.
Sourcepub const IDENTIFY: DeviceFeature
pub const IDENTIFY: DeviceFeature
FP_DEVICE_FEATURE_IDENTIFY: the device can match one scan against a gallery
(Device::identify).
Sourcepub const VERIFY: DeviceFeature
pub const VERIFY: DeviceFeature
FP_DEVICE_FEATURE_VERIFY: the device can match one scan against one print
(Device::verify).
Sourcepub const STORAGE: DeviceFeature
pub const STORAGE: DeviceFeature
FP_DEVICE_FEATURE_STORAGE: the device keeps templates on the sensor, which marks it
match-on-chip — see DeviceFeature::is_match_on_chip.
Sourcepub const STORAGE_LIST: DeviceFeature
pub const STORAGE_LIST: DeviceFeature
FP_DEVICE_FEATURE_STORAGE_LIST: on-sensor storage can be enumerated
(Device::list_prints).
Sourcepub const STORAGE_DELETE: DeviceFeature
pub const STORAGE_DELETE: DeviceFeature
FP_DEVICE_FEATURE_STORAGE_DELETE: a single template can be removed from on-sensor
storage (Device::delete_print).
Sourcepub const STORAGE_CLEAR: DeviceFeature
pub const STORAGE_CLEAR: DeviceFeature
FP_DEVICE_FEATURE_STORAGE_CLEAR: on-sensor storage can be erased wholesale
(Device::clear_storage).
Sourcepub const DUPLICATES_CHECK: DeviceFeature
pub const DUPLICATES_CHECK: DeviceFeature
FP_DEVICE_FEATURE_DUPLICATES_CHECK: the device rejects enrolling a finger it already
holds, reporting Error::DataDuplicate.
Sourcepub const ALWAYS_ON: DeviceFeature
pub const ALWAYS_ON: DeviceFeature
FP_DEVICE_FEATURE_ALWAYS_ON: the sensor runs continuously rather than being powered up
per operation.
Sourcepub const UPDATE_PRINT: DeviceFeature
pub const UPDATE_PRINT: DeviceFeature
FP_DEVICE_FEATURE_UPDATE_PRINT: enrolling can extend an existing template with new scans
instead of replacing it.
Sourcepub const fn from_bits_truncate(bits: u32) -> DeviceFeature
pub const fn from_bits_truncate(bits: u32) -> DeviceFeature
Build from a raw bitmask, keeping only defined bits.
Takes a u32 (libfprint’s FpDeviceFeature is a 32-bit flags type) and masks to the
defined 0..=9 bits here, so callers never narrow before masking.
Sourcepub const fn contains(self, other: DeviceFeature) -> bool
pub const fn contains(self, other: DeviceFeature) -> bool
fp_device_has_feature: true iff every bit in other is set in self.
Sourcepub const fn is_empty(self) -> bool
pub const fn is_empty(self) -> bool
Whether no flag is set (equal to DeviceFeature::NONE).
Sourcepub const fn intersects(self, other: DeviceFeature) -> bool
pub const fn intersects(self, other: DeviceFeature) -> bool
Whether self and other share any flag.
Sourcepub const fn is_match_on_chip(self) -> bool
pub const fn is_match_on_chip(self) -> bool
Whether this looks like a match-on-chip device (persistent on-sensor storage).
Trait Implementations§
Source§impl BitAnd for DeviceFeature
impl BitAnd for DeviceFeature
Source§fn bitand(self, rhs: DeviceFeature) -> DeviceFeature
fn bitand(self, rhs: DeviceFeature) -> DeviceFeature
Set intersection: the flags in both sets.
Source§type Output = DeviceFeature
type Output = DeviceFeature
& operator.Source§impl BitAndAssign for DeviceFeature
impl BitAndAssign for DeviceFeature
Source§fn bitand_assign(&mut self, rhs: DeviceFeature)
fn bitand_assign(&mut self, rhs: DeviceFeature)
&= operation. Read moreSource§impl BitOr for DeviceFeature
impl BitOr for DeviceFeature
Source§type Output = DeviceFeature
type Output = DeviceFeature
| operator.Source§fn bitor(self, rhs: DeviceFeature) -> DeviceFeature
fn bitor(self, rhs: DeviceFeature) -> DeviceFeature
| operation. Read moreSource§impl BitOrAssign for DeviceFeature
impl BitOrAssign for DeviceFeature
Source§fn bitor_assign(&mut self, rhs: DeviceFeature)
fn bitor_assign(&mut self, rhs: DeviceFeature)
|= operation. Read moreSource§impl Clone for DeviceFeature
impl Clone for DeviceFeature
impl Copy for DeviceFeature
Source§impl Debug for DeviceFeature
impl Debug for DeviceFeature
Source§impl Default for DeviceFeature
impl Default for DeviceFeature
impl Eq for DeviceFeature
Source§impl Not for DeviceFeature
impl Not for DeviceFeature
Source§fn not(self) -> DeviceFeature
fn not(self) -> DeviceFeature
Set complement within the defined flags — unknown/high bits never appear, so
!!x == x for every representable set.
Source§type Output = DeviceFeature
type Output = DeviceFeature
! operator.Source§impl PartialEq for DeviceFeature
impl PartialEq for DeviceFeature
impl StructuralPartialEq for DeviceFeature
Source§impl Sub for DeviceFeature
impl Sub for DeviceFeature
Source§fn sub(self, rhs: DeviceFeature) -> DeviceFeature
fn sub(self, rhs: DeviceFeature) -> DeviceFeature
Set difference: the flags in self that are not in rhs (self & !rhs).
Source§type Output = DeviceFeature
type Output = DeviceFeature
- operator.Source§impl SubAssign for DeviceFeature
impl SubAssign for DeviceFeature
Source§fn sub_assign(&mut self, rhs: DeviceFeature)
fn sub_assign(&mut self, rhs: DeviceFeature)
-= operation. Read more